Getting WDS computer naming policy to work (with MDT 2008)
-
Mittwoch, 15. Oktober 2008 10:38Hi all!
I'm busy working on a Vista deployment, using Lite Touch in Deployment Toolkit 2008, and WDS. Everything is working so far, apart from getting the computer name generation to work the way RIS works - i.e. generating a name in the format PC001, PC002 etc. I've looked at various threads on this forum, but can't seem to find a definitive answer on how to get this to work. I've tried various combinations of settings for Computername (computername=* / %machinename% / blank), Unsecurejoin etc. in my unattend.xml file and in customsettings.ini, but whatever I try the computername ends up being a randomly generated name. The machine does get joined to the domain, with the computer account in the correct OU however. I have configured the policy in the server properties in WDS.
I looked at this TechNet article regarding the 255 computer account upper limit bug, but I don't think it applies to us as we're using a Vista source that includes SP1:-
http://support.microsoft.com/kb/937333
I've found the Help for Deployment Toolkit confusing and not very logically laid out, and haven't found any clear instructions on how to do this.
thanks very much,
Ray
Alle Antworten
-
Donnerstag, 16. Oktober 2008 08:12Moderator
Hi Ray,
The naming policy in string works as follows:
%First: the first name of the user.
%Last: the last name of the user.
%Username: the user name of the user.
%MAC: the MAC address of the computer.
%n#: an incremental n-digit number. For example, %2# will add a number to the computer name in the following order: 1,2,3,…99.
%0n#: an incremental n-digit number, with zeros added before the digit. For example, %02# will add a number to the computer name in the following order: 01,02,03,…99.
These can be combined in any order. A number before a tag string (such as %3First or %5Username) will crop the string to that length. For example:
%61Username%# equals JohnSmi12
%2first.%last equals Jo.Smith
The preceding procedure sets the netbootNewMachineNamingPolicy DS attribute to the specified policy.
For more information, please refer to the following article:
How to Manage Your Server
http://technet.microsoft.com/en-us/library/cc770637.aspx
Hope it helps.
Tim Quan - MSFT
-
Donnerstag, 16. Oktober 2008 08:26Hi Tim
Thanks for your reply. I understand how the policy works - the syntax etc. We're using KZN%4# (KZN1, KZN2, KZN3 etc.) which we've specified on the properties of our WDS server. However, when deploying Vista via PXE boot (having imported the lite touch .wim file from Distribution\boot into WDS) this policy is ignored, and the computer name is randomly generated (includes the organisation name followed by a random number).
Here's my customsettings.ini:-
[Settings]
Priority=Default
Properties=MyCustomProperty
[Default]
OSInstall=Y
WipeDisk=TRUE
SkipBDDWelcome=YES
SkipBuild=YES
BuildID=INSTALL_VISTA
SkipDeploymentType=Yes
DeploymentType=NEWCOMPUTER
_SMSTSORGNAME=My CompanyName
OrgName=My CompanyName
FullName=Admin
UserDomain=OURDOMAIN
UserID=username
UserPassword=password
Administrators1=DOMAIN\group1
Administrators2=DOMAIN\group2
CountryCode=27
AreaCode=031
SkipAppsOnUpgrade=Yes
SkipCapture=YES
SkipAdminPassword=YES
AdminPassword=adminpass
SkipProductKey=YES
ProductKey=12345-12345-12345-12345-12345
SkipDomainMembership=Yes
JoinDomain=ourdomain.com
DomainAdmin=username
DomainAdminDomain=ourdomain.com
DomainAdminPassword=password
MachineObjectOU=OU=Workstations,DC=ourdomain,DC=com
SkipUserData=Yes
UserDataLocation=NONE
SkipTaskSequence=Yes
TaskSequenceID=INSTALL_VISTA
SkipComputerName=Yes
ComputerName=*
SkipPackageDisplay=Yes
SkipLocaleSelection=Yes
UILanguage=en-ZA
UserLocale=en-ZA
KeyboardLocale=0409:00000409
SkipTimeZone=Yes
TimeZoneName=South Africa Standard Time
SkipApplications=Yes
SkipBitLocker=Yes
SkipSummary=Yes
SkipFinalSummary=Yes
WSUSServer=http://WSUSserver:8530
Here's our bootstrap.ini:-
[Settings]
Priority=Default
[Default]
SkipBDDWelcome=YES
DeployRoot=\\SERVER\Distribution$
UserDomain=OURDOMAIN
UserID=username
UserPassword=password
Thanks man - would appreciate any suggestions.
cheers
Ray -
Montag, 20. Oktober 2008 09:19No ideas anyone? Getting a bit desperate here... does anyone know if it's even possible to use WDS for computer name generation when you're deploying images created in deployment toolkit?
-
Montag, 20. Oktober 2008 13:52
I'm not sure exactly how the deployment toolkit fits into the picture, the only things I use is WDS and the Vista SP1 Automated Installation toolkit (System image manager and Windows PE command prompt). I'll give you a basic overview of how I go about creating and deploying an image.1. I setup my base computer, all the software installed fully updated, etc..2. Run sysprep (oobe, generalize, shutdown)3. boot computer to WDS server and upload image.4. Unlike windows XP when you sysprep an image it doesn't save any drivers you installed when the computer was setup, if you need instructions for injecting drivers into an image I can post a link for that.5. Create a unattended XML file for the image (I reuse the same one for all my images) in windows system image manager, regarding the computername field I use "%MACHINENAME%" so in the XML file it looks like this:<ComputerName>%MACHINENAME%</ComputerName>If you want a copy of the XML file I can either post it or send it to you.6. To deploy it, I have a few settings setup in WDS. If you go to PXE Response setting in the server properties there is the option to require admin approval for unknown clients. Check this box. Now when you boot a computer to our WDS server, it will display a number and a message basically saying you need admin approval. If you go back to your WDS server and go to the pending devices it will list any computers that are currently waiting for approval listed by number (the number that appears on the screen of the computer). To approve that computer right click on it and you have three options:Approvethis will boot the computer to the server, and name it according to the naming policy set in the server properites of WDS.Name and approveClick this a textbox will appear. Put in the name you want for the computer and it will approve the computer and it will use whatever name you put in the box.Rejectany rejected computer can be restarted and it will ask for approval againTo use this method you have to give the server create rights(delegation) to the OU where the new computer accounts are created.Note: once a computer has been imaged using this method it will always reuse the name that it was given by WDS. So if you image a computer using this method and then have to re-image it, it will not ask for approval it will use what ever name you gave it last time.Also if you have an existing computer that already has joined the domain but its AD account was not created by WDS then it will ask for approval when it trys to boot into WDS.This method also works for windows XP if you use the %MACHINENAME% tag in the sysprep.inf file.Just reply to this thread if anyone has any other questions on this.Justin -
Montag, 20. Oktober 2008 14:13Hi Justin
Thanks very much for your post. I've just tried changing the PXE settings in WDS to request approval for unknown clients. I approved the request for my VM which is busy installing now. Will see if the computername is any different. This would at best be a workaround though - as our desktop team often deploys new PC's and I don't want them to have to come to me to approve the pending requests every time. I want it to be automated like RIS was...
But I suspect the problem lies in the fact that we're using MDT on top of WDS. The only thing we use WDS for is to initiate the installation via PXE. Basically you add your install images to MDT, update MDT's deployment point, and then import the boot image that gets created in your \boot folder in the deployment point into WDS. To initiate the installation you then PXE boot and choose the image as you would if you were using a pure WDS environment. MDT is great because it makes it very easy to inject drivers, and it also has powerful scripting capability.
In the unattend.xml in MDT I've tried the %MACHINENAME% setting under the computername property, but the installation comes up with an error during the specialize pass when I specify this option. I've also tried '*', leaving it blank etc. and played with various combinations of settings in customsettings.ini, which MDT uses.
I'm beginning to wonder if using WDS for computer name generation is even supported when using the lite touch installation (LTI) method with MDT.
cheers
Ray -
Montag, 20. Oktober 2008 14:24I can understand your frustration it isn't very fun right clicking through 40 computers at a time when you need to approve the things. Also I know that if you use the %MACHINENAME% tag you get that specialize error if you don't use WDS. I did at one point have it working where it would use the generated name without going through the whole approval process but its been awhile and I don't remember the exact settings. I know I stopped using that method though because XP didn't work that way. The only way I have been able to get XP to work was through the approval method. If I come across anything that might help you I will post it here.Justin
-
Montag, 20. Oktober 2008 14:31Thanks man. Aah that clears up the error I was getting with %MACHINENAME% then. That variable is obviously not defined or whatever when using MDT. To me it just seems like something they'd surely build into MDT - it's such a comprehensive toolkit - the guys at MS must've thought about this. I'm guessing it's something easy i'm missing / something that hasn't been documented. The documentation for MDT doesn't seem to provide much info on this in terms of MDT's interaction with WDS for computer naming. Perhaps MDT doesn't use WDS at all for this, and I'll need to script it in MDT.
According to the documentation MDT allows you to generate a computer name based on the serial number, or MAC address of the machine, or to prestage the account in AD. None of these options will suffice in our environment - we need to retain the same functionality we had with RIS.
cheers man,
Ray -
Dienstag, 10. Februar 2009 12:46Hi Raymond,
Late picking up the thread, but still curious, did you find any solution to your problem with computer names?
Regards,
Mats -
Mittwoch, 25. Februar 2009 15:23Anyone else have any success with this issue? I am currently using WDS/RIS way of automatically naming our XP workstations. I would love to find a way to have MDT2008 and LT be able to use this same naming system.
-
Donnerstag, 25. Juni 2009 09:04Hi guys
Sorry this is a VERY late reply - not sure why i wasn't monitoring this thread anymore, but didn't get alerted to your posts. I never got to the bottom of this unfortunately. In the end we decided to skip Vista, and wait for Windows 7. I'm REALLY hoping this functionality has been included in MDT 2010. Am waiting to download MDT 2010 Beta 2 to start getting ready for Windows 7. Anyone from MSFT - can you comment on this?
Mats, Ben -- What did you guys decide to do in the end? It probably wouldn't be too hard to write a script to query the domain for the last used computername and then increment it by one, but since we decided against a Vista deployment we didn't spend any more time on this.
thanks
Ray -
Montag, 29. Juni 2009 15:50
Probably a moot point to reply to this, but in case anyone finds interest in how to properly use this type of functionality - the way you are currently generating your PC Names via RIS (Now WDS) Injecting the PC name, does not pull that value into the MDT Deployment process.
There is a seperate variable inside of the MDT (%COMPUTERNAME%) that would need to be populated. In order for you to properly utilize this functionality you would need to determine where/what the "generated" PC Name is (by script, or registry) and then pull that data into your build (again, by script) and set the %computername% variable to that value as a task in your tasksequence. You can do this with a userexit script, and a variable in your CustomSettings.ini setting the ComputerName=to the result of the UserExit script.
If the %computername% variable is left empty, as you have experienced - it automatically generates a PCName. All you need to do is tie the two variables together and it will function exactly as you are asking.
-Dustin Martin
-Dustin -
Montag, 29. Juni 2009 17:24Ray:
I didn't find an answer to this. I just made a Vista image and deployed it just using WDS (which is still a bit of a pain to get it to read the computername correctly -- but at least it is a matter of making sure certain parameters are set in the xml files). I am going to try to check out Dustin's suggestion right after your post.
Benjamin -
Montag, 29. Juni 2009 17:26Dustin:
I still think this will be important -- I think this makes it a whole lot easier even for future Windows 7 deployments. I am going to try to do what you mention. Any idea how to pull that name, though? I tried to look for the way that the PE does it that WDS uses -- couldn't find much there, though.
Benjamin -
Dienstag, 30. Juni 2009 06:45Thanks Dustin. I guess it will need to be a vbscript that queries the destination OU for a list of PC's, drops off the "PC" bit from "PC001" (or whatever naming convention you are using), sorts the numbers numerically, increments the last one by one, then appends "PC" to it again? Dustin, you don't perhaps have a vbscript doing similar that you could share with us hey?
Ray
RayDiack -
Montag, 24. August 2009 16:31I don't actually use WDS to deploy any systems and havent really used it to do anything but deliver a boot image to date. I'm sure if it sets a system name during the boot process you can find a registry key or something to do this, and as i mentioned in utilizing a user exit for this purpose, simply return it from the userexit like
userexit returns value: "WDSName=PC0003"
ComputerName=%WDSName%
you simply need a script to tie the two together, if your WDS box is automatically incrementing the name, you don't need a script to manually do this for you, you just need to find a place to 'grab' the already generated one while in your boot environment.
You could also shy away from the WDS initiated process and simply use that to *only* deliver the WinPE environment that starts your LTI Image build.
use the wizards to assign the PC names from your MDT database (i believe you could script WDS to create a PC name + mac address when oyu approve a connection, or create a little applet to do so)
That way, when you approve a PC's mac address -> it adds it as a "computer" to the MDT database -> your MDT customsettings.ini wizard will query for computer settings, and grab the computer name.
You could then use this for any of the computer-related settings you want also.
-Dustin
-Dustin -
Freitag, 15. Januar 2010 11:29Sorry for join in the conversation very very late.from few days I am working on MDT2010. And my doubt is , In the scenario of we have an XP client machine to deploy and we are going to deploy Win7 on it. And the XP machine is having a computer name in the domain. How can we get a new computer name(the chosen one) for the machine after deployment. Is it possible only with the database or with the Script. For one machine scenario we can do the setting in custom.ini file likeCOMPUTERNAME="Win7"SKIPCOMPUTERNAME=YESHow can we proceed in the case of multiple clients.-Veerla
-
Freitag, 26. Februar 2010 23:38I know this is going to be bad news to all but here is my 2 cents.
I just finished the new Windows 7 Deployment methods using LTI and ZTI. I've also been digging around for more answers to questions now that the class is over with but I did come across several answers.
1) MDT LTI will not use the computer name based prestaged in AD so that is a bummer - I used RIS for years like this and loved it.
2) MDT LTI with the MTD database will allow you to do more of a custom installation for larger deployments. You have to pick, like the mac, and prestage it in MTD.
3) ZTI requires Configuration Manager and is much more work to get going
I'm looking forward to deploying windows 7 and the computer name seems to be the only problem we are having to solve.
Yes the class was good but was not very advanced. :-( -
Dienstag, 12. Oktober 2010 21:34
Hi guys - two years from my original post, and we finally have a solution. Not sure if anyone is still monitoring this thread, but here goes... my colleague found a web service written by Michael Niehaus for implementing "RIS-style" naming with MDT 2010 (which we're now using). See his blog post along with the comments made by myself and my colleague that has a minor addition to his code to get the domain join working:-
http://blogs.technet.com/b/mniehaus/archive/2009/12/06/ris-style-naming-with-mdt-2010-use-a-web-service.aspx
It works really well, and the code is fairly simple. The catch is that you'll need Visual Studio to compile the code and create the web service, and an IIS instance to host it somewhere. His blog entry contains instructions on how to call the web service. You basically pass it some info and it spits out the computer name to use, which gets assigned to the OSDComputerName variable in your CustomSettings.ini file. The web service also creates the computer account, setting the netbootguid property in AD based on the UUID of the machine you're installing. That way, next time you re-install the same machine, the web service spits out the same computer name as it originally had, just like RIS does :-)
Why MS dropped this from MDT we'll never know... ;-) But Michael's workaround works really well. The beauty is, it can return different names based on the prefix parameter you pass to it. In our case, we're using something like PC001 for PC's, and NOTEBOOK001 for notebooks, with two sections in CustomSettings.ini and a UserExit.vbs script:
[Settings]
Priority=IsNotebookCheck, ByComputerType, GetName, Default
Properties=IsNotebook, DnsDomain, Prefix
[IsNotebookCheck]
UserExit=UserExit.vbs
IsNotebook=#CheckNotebook#
[ByComputerType]
Subsection=Notebook-%IsNotebook%
[Notebook-Yes]
Prefix=NOTEBOOK
DnsDomain=mydomain.com
MachineObjectOU=OU=Laptops,DC=mydomain,DC=com
[Notebook-No]
Prefix=PC
DnsDomain=mydomain.com
MachineObjectOU=OU=Workstations,DC=mydomain,DC=com
[GetName]
WebService=http://myserver.mydomain.com:8081/MDTService.asmx/GenerateName
Parameters=DnsDomain, Prefix, UUID, MachineObjectOU
OSDComputerName=stringWe shouldn't really have to use a UserExit script to check if it's a notebook or not, but MDT's built-in IsLaptop variable doesn't seem to work consistently. In my UserExit script I'm trying to use a WMI query to check for the existence of a battery to see whether it's a laptop or not. This part still isn't working too consistently and needs some work - our Acer laptops are detected as PC's :-(. Here's my UserExit code anyway in case it helps anyone:
Function UserExit(sType, sWhen, sDetail, bSkip)
UserExit = Success
End Function
Function CheckNotebook()
' Checks if a computer has a battery
On Error Resume Next
IsNotebook = "No"
Set objWMIService = GetObject( "winmgmts://" & "." & "/root/cimv2" )
Set colItems = objWMIService.ExecQuery( "Select * from Win32_Battery", , 48 )
For Each objItem in colItems
IsNotebook = "Yes"
Next
If IsNotebook = "Yes" Then
CheckNotebook = "Yes"
oLogging.CreateEntry "USEREXIT:UserExit.vbs|CheckNotebook: Returned Yes.", LogTypeInfo
Else
CheckNotebook = "No"
oLogging.CreateEntry "USEREXIT:UserExit.vbs|CheckNotebook: Returned No.", LogTypeInfo
End If
End Function
'For testing purposes
'Result = CheckNotebook
'WScript.echo "Result is " & Result
Hope that helps someone out there,Ray
RayDiack- Als Antwort markiert Raymond Diack Dienstag, 12. Oktober 2010 21:35
-
Donnerstag, 3. März 2011 15:12
Ray:
Just stumbled back across this post. Thanks for the information. Right now, I am using plain WDS for the deployment (primarily for the naming ability). I have been able to re-create the other things that MDT makes easy, such as dynamically adding drivers.
However, if I change the deployment strategy, this information that you provided will be most useful. Thanks for posting.
Benjamin
-
Mittwoch, 27. April 2011 09:19
Thanks for the information Raymond, its very useful
Fermin
-
Freitag, 27. April 2012 17:14
All of these are good work arround (At least trying), but you guys are not alone on this.
I wonder what would be the problem if Microsoft allowed a manual injected file to the WDS by the admin that will include Client MAC Address and the chosen name to it, is that fancy? It's just a matter of a table lookup from the WDS and voila, period.

