Client Computer Naming like WDS (AD DS)? Possible in SCCM OSD w/MDT?
Currently we are using WDS on Windows Server 2008 R2 for deploying desktop clients. At our locale site we got 5 different departments, and using WDS "Client Naming Policy" the desktop clients get computer name based on the department name followed by a incremental number. This way we always know which department the computer belongs to and ensure that it will get an unique computer name in Active Directory. The big question: Is it possible to get the same feature with SCCM OSD? I have installed MDT 2010, and managed to create the processes required to deploy Windows 7, install software, and join them to the domain. But the computer name is just some random number (the deployment task is advertised to "All Unknown Computers"). I don't want to pre-register my clients in SCCM, I want all new unknown computers to automatic get the right computer name, and without being prompted to insert one. Is it possible to get the SCCM deployment to check for the next available computer name in Active Directory based on department? Example: For Departement1 the first given computer name should be "DEPT1-001", the next computer "DEPT1-002" and so on. For Departement2 the first given computer name should be "DEPT2-001", the next computer "DEPT2-002" and so on. The System is running on Windows Server 2008 R2 with SCCM 2007 SP2 and MDT 2010.
December 16th, 2009 9:01am

This is a very interesting question.Does anybody have a solution for this?Please let me know...
Free Windows Admin Tool Kit Click here and download it now
December 17th, 2009 3:09am

Bump -
December 18th, 2009 4:53am

How do you know what department the computer is for without prompting?
Free Windows Admin Tool Kit Click here and download it now
December 18th, 2009 2:48pm

When I used WDS 2008 R2 I logged in with a user that had the department name, and the WDS added a incremental number. Example "DEPT1", and then the computer would get the next available computer name (number) i Active Directory, DEPT1-001 etc. To do this in SCCM I thougt I could create different advertisement tasks for each department, so I don't need to specify a computer name. I want to skip the part with any manual insertion of computer naming, and be certain to not get a dublicate record of computer names. I got 5 different apartments, which I want the computer name starting with the department name followed by an incremental number. Also there will be installed different software to each of the departments. What is the best and easiest way to accomplish this fully automatically?
January 4th, 2010 4:31am

If those departments has some kind of identifier like separet ip networks you could use the location part of MDT or of you have a specific AD Site for them you could have a script doing the naming for you. Its definetly possible if you have some kind of identifier to use.
Free Windows Admin Tool Kit Click here and download it now
January 4th, 2010 4:00pm

I'm not familiar at all with MDT but in the TS there is a variable that controls the computer name. You can script a change to the name using a 2 line script (obviously the real script will be more than two lines). Depending on how automated you want this to be it could be either a popup where the tech imaging the machine enters the dept code, or as Stefan said, if there is some other method to identify the dept (IP scope, model, anything really), it could be fully automated.Sorry forgot to link to the example script: http://t3chn1ck.wordpress.com/2009/04/24/script-to-prompt-for-system-name-in-sccm-osd/ Scott GillSCCM Consultant
January 4th, 2010 4:29pm

Thanks for the reply... but.. The departments don't got any unique identifier. This is little Norway, where we got polar bears terrorizing our streets, and we only got 300 computers (of different models) in one single AD site and also in the same ip network. When a person from the service desk is deploying a new computer, the service desk knows which department the computer will be placed in. Let say they are deploying a client for DEPT1, and that department already have a few machine up and running, I don't want to go to Active Directory to check for the next available computer name (DEPT1-00X). I was thinking I could make one task schedule for each department, and insert the department starting computer name in the "OSDComputerName”, but how can I then make sure they get a 3 digits incremental number at the end of the computer name? And the computers are not pre-associated in SCCM, but all of our old Windows XP computers (deployed by WDS) have been discovered and added to the SCCM. We now want to deploy Windows XP and Windows 7 with SCCM instead of WDS. Our current computer naming standard is a short name for the department followed by a 3 digit incremental number. When using WDS this is a included feature where the WDS server checks Active Directory for the next available computer name (or reuse the old name if the client has bin deployed with WDS earlier). This is called "Client Naming Policy" and we are using setting this setting: "%Username%03#" This will give the deployed client the name of the user logging in to the WDS and also a 3 digits incremental number. example: DEPT1013.
Free Windows Admin Tool Kit Click here and download it now
January 5th, 2010 7:19am

I don't understand how you are going to be able to do this completely unattended because the dept needs to be selected at some point. An HTA could be added that would provide a dropdown with departments and take the department name like DEPT1 and look up all computer objects in AD beginning with DEPT1- and increment to the next available number like DEPT-0002 if it found DEPT-0001 in the query. This would not be a totally automated solution because it does not appear you have an automated way to tie the computer to the department that can be leveraged for automation. The HTA would tie the computer to the department and then automatically generate the computer name and place it in an OSD Task Sequence variable named OSDComputerName.Update - I guess I didn't read your post well enough but if you had a TS for each dept then you could add a ts variable for each dept and then a script could be added at the beginning of the TS that would read the OSDComputerName and query AD to get the next available computer name and update the OSDComputerName variable. I will see if I can throw something together for you.
January 5th, 2010 11:29am

Ok I guess the short answer is, No there is no "built in" way to do that with SCCM. At this point I'd say you basically have two options.1) Add an HTA or VBscript to the TS that pops up, requiring user interaction to enter in the Dept Name. From there the script can query AD and find out the next available name and add that into the Computer Name variable.2) For a "fully automated" (not really) solution, you'd need to setup something on the backend as a way to identify the machine and assign it to a dept. In this example I would suggest a database where you can pre-assign serial numbers to a specific dept. From there a similar script would run to first query the DB for the dept, then query AD for the next available name. This isn't really "fully automated" as it does require some admin overhead but it's the closest I can see you getting to fully automated.Scott Gill SCCM Consultant
Free Windows Admin Tool Kit Click here and download it now
January 5th, 2010 12:29pm

You said you could make a seperate TS for each dept. If you drop this script in each TS and set the DEPT in each script it will query AD and get the next available dept computername. It is a very simple script and I just threw it together as a proof of concept. I think you would need to add this after the Apply Operating System action in the TS. I have not tested this so I cannot be sure it works. Since you would not be joined to the domain yet and you would not be running the script with a domain account you will need to provide a domain account and password in the script. You could just create a generic account with no privileges in order to get read access to AD. You may also be able to use the option in Run Command Line that allows "run this step as the following account" but not really sure if that would work or not. Const ADS_SCOPE_SUBTREE = 2 set env = CreateObject("Microsoft.SMS.TSEnvironment") strOSDdepartment = "DEPT1" assuming the format is DEPT1-XXX Set objConnection = CreateObject("ADODB.Connection")Set objCommand = CreateObject("ADODB.Command")objConnection.Provider = "ADsDSOObject"objConnection.Open "Active Directory Provider"Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREEobjCommand.Properties("Sort On") = "name"objCommand.Properties("User ID") = "Username"objCommand.Properties("Password") = "Password" objCommand.CommandText = _ "SELECT Name FROM 'LDAP://dc=domain,dc=com' WHERE objectCategory='computer' AND name='" & strOSDdepartment & "'"Set objRecordSet = objCommand.Execute objRecordSet.MoveLastDo Until objRecordSet.EOF strDept = left(objRecordSet.Fields("name").value,6) strLastIncrement = mid(objRecordSet.Fields("name").value,7) strNewIncrement = strDept & "00" & strLastIncrement + 1 env("OSDComputerName") = strNewIncrement objRecordSet.MoveNextLoop
January 5th, 2010 12:51pm

You could also e.g. use a hta at the beginning of the process either called by the Task Sequence itself, or using the preexecution Hook, where the tech could choose from a list of possible Departmens. Michael Niehaus, one of the developers of MDT, posted an example recently using a webservice to create those RIS styled names. It takes a prefix (which could be the choosen department) and will automatically query AD for all computers with this prefix and return a proper computername with an incremented counter. If the computer exists already in AD it will return the before used name. Find the example at http://blogs.technet.com/mniehaus/archive/2009/12/06/ris-style-naming-with-mdt-2010-use-a-web-service.aspx. RegardsMaik http://myitforum.com/cs2/blogs/maikkoster/default.aspx
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2010 12:52pm

You could also e.g. use a hta at the beginning of the process either called by the Task Sequence itself, or using the preexecution Hook, where the tech could choose from a list of possible Departmens. Michael Niehaus, one of the developers of MDT, posted an example recently using a webservice to create those RIS styled names. It takes a prefix (which could be the choosen department) and will automatically query AD for all computers with this prefix and return a proper computername with an incremented counter. If the computer exists already in AD it will return the before used name. Find the example at http://blogs.technet.com/mniehaus/archive/2009/12/06/ris-style-naming-with-mdt-2010-use-a-web-service.aspx. RegardsMaik http://myitforum.com/cs2/blogs/maikkoster/default.aspx You could also have an HTA that only has a dropdown of departments. When the tech selects a department, the dept name gets queried against AD to pull back all instances of that dept name like DEPT001 and DEPT002. The result comes back in a recordset that can be enumerated. The recordset can be sorted. Once the recordset is sorted the script would go to the biggest number and increment by one. I also had a script that actually pulled back all computer names like DEPT* and would even reuse computernames that weren't being used any longer like if the recordset brought back DEPT001,DEPT002,DEPT003,DEPT005, I would use DEPT004 as the next available computername.If this is something you would be interested in I would be happy to post a sample.Mike
January 28th, 2010 2:59pm

This simple query requires WinPE to have ADSI support to run in a TS. I also add WMI, HTA, Scripting, etc. just so it's in there for future additions. It will prompt for dept name and give back the largest computername. At minimum the script would need to run as a domain user in order to access AD. Running a script in a TS in the latest SCCM allows defining an account to run the script as. Const adUseClient = 3 strDept = InputBox("Enter Department","","DEPT") Set objRootDSE = GetObject("LDAP://RootDSE") strDomainDN = objRootDSE.Get("defaultNamingContext") Set Conn = CreateObject("ADODB.Connection") Set Comm = createobject("ADODB.Command") Set RS = CreateObject("ADODB.Recordset") strQuery = "<LDAP://" & objRootDSE.Get("defaultNamingContext") & _ ">;(&(objectCategory=computer)(objectClass=computer)(name=" & strDept & "*));ADsPath,samAccountName;subtree" Conn.Provider = "ADsDSOObject" Conn.Open "ADs Provider" Conn.CursorLocation = adUseClient Comm.ActiveConnection = Conn Comm.Properties("Page Size") = 1000 Comm.CommandText = strQuery Comm.Properties("Sort on") = "samAccountName" Set rs = comm.Execute While Not rs.EOF rs.movelast strComputer = rs("samAccountName") rs.MoveNext Wend
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2010 3:22pm

You could also have an HTA that only has a dropdown of departments. When the tech selects a department, the dept name gets queried against AD to pull back all instances of that dept name like DEPT001 and DEPT002. The result comes back in a recordset that can be enumerated. The recordset can be sorted. Once the recordset is sorted the script would go to the biggest number and increment by one. I also had a script that actually pulled back all computer names like DEPT* and would even reuse computernames that weren't being used any longer like if the recordset brought back DEPT001,DEPT002,DEPT003,DEPT005, I would use DEPT004 as the next available computername. If this is something you would be interested in I would be happy to post a sample. Mike Hi Mike. Brilliant, this is exactly what i'm looking for! If you could post a sample I would be really happy. /anders
February 5th, 2010 8:01am

I wonder if the topic owner achieved what he wanted? And how? 'cause I've been trying to do the same. Any ideas?
Free Windows Admin Tool Kit Click here and download it now
March 6th, 2012 3:01am

Hey , you might check out my webservices I have written under http://itxsolutions.codeplex.com/ Feedback would allow to build it better! Let me know if that helpsBlog at http://www.rpieniaz.wordpress.com
August 24th, 2012 10:16am

Hey , you might check out my webservices I have written under http://itxsolutions.codeplex.com/ Feedback would allow to build it better! Let me know if that helpsBlog at http://www.rpieniaz.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2012 10:16am

I did not archive exactly what I wanted. Since I first posted this topic I have now installed SCCM 2012 and are again looking for a neat solution. I will try the webservice from ITX-Solutions, it looks like it would do the trick. I was hoping I could only use a script and get around the need of having a webservice.
October 2nd, 2012 7:10am

Hey , I might try to wrap it as independent class and you could use it as powershell script however without SCCM 2012 SP1 you still will need to use it after applying image and installing client (in full OS) You can @ me at : [string]$email="";"82;97;102;97;108;46;80;105;101;110;105;97;122;101;107;64;73;84;88;45;83;111;108;117;116;105;111;110;115;46;110;108;0".Split(";")|%{$email+=[char][int]$_};$email Blog at http://www.rpieniaz.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
October 31st, 2012 4:20am

Hey , If by neat solution you would mean SCCM console extension - I have just published that on codeplex http://itxsolutions.codeplex.com It basically alllows you to control autonaming in TS gui editor. Blog at http://www.itx-solutions.nl Codeplex at http://itxsolutions.codeplex.com/ Email me: PS:> [string]$email="";"82;97;102;97;108;46;80;105;101;110;105;97;122;101;107;64;73;84;88;45;83;111;108;117;116;105;111;110;115;46;110;108;0".Split(";")|%{$email+=[char][int]$_};$email
November 22nd, 2012 11:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics