Using Powershell or VBScript in a Task Sequence to rename computer before domain join - Windows 7
Alright, I had this working fine in MDT, but I am trying a similar approach in SCCM to no avail; I added a package to SCCM with the necessary Powershell script (tested and working) to rename the destination PC with the SMBios computer name (Lenovo computers use the system s/n, which we use to identify them in Active Directory/SCCM). Right before the rename TS I have a command line running the PS comand to set the execution policy to unrestricted. These two TS' I put right after the configure Windows TS, it didn't rename the pc. I moved it to other locations, and cannot get it to work regardless. I figured the trouble might be with UAC, but then every application package I have created thus far works fine during the software install phase, but I tested my script within Windows and found that it worked as expected. A couple points/questions: 1. I do NOT want to prompt for a computer name during any stage of the OSD, this must be a fully automated process. 2. Is VBScript a better option? 3. Should I perhaps try creating an MDT TS in SCCM and then mimic the process that used to work when all I was running was MDT? 4. Is there any better method to accomplish this?
April 8th, 2011 7:23pm

What does your script do to rename the system? All you need to do is set the OSDCompterName Task Sequence variable before the Setup Windows and ConfigMgr task in a ConfigMgr TS.Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 9:30pm

If possible I would use Jasons Soloution. If you for any reason can't do that you can rename a computer with WMI or netdom. I have done it with netdom -rename and SCCM but you must provide proper credentials to netdom so that it has the needed permissions in AD to do the job
April 11th, 2011 6:59am

You can also use a script to get it done. On my blog I have described which script can be used for assigning a dynamic computername. http://henkhoogendoorn.blogspot.com/2011/03/how-to-assign-dynamic-computername.html This works great on XP and Win7 systems, without the need for MDT functionality. My ConfigMgr blog: http://henkhoogendoorn.blogspot.com Follow me on Twitter: @henkhoogendoorn
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 7:18am

What does your script do to rename the system? All you need to do is set the OSDCompterName Task Sequence variable before the Setup Windows and ConfigMgr task in a ConfigMgr TS. Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys My script reads the BIOS information via WMI: $Bios = GWMI win32_bios $Sn = $Bios.SerialNumber $ComputerInfo = Get-WmiObject -Class Win32_ComputerSystem $ComputerInfo.rename($Sn) Does your method of setting the OSDCompterName TS variable automatically rename the PC using the BIOS s/n? Or does it prompt you? I must have the process hands off, and I don't want to pre-populate any serial numbers in the TS. I will read up more on OSDCompterName and see if that is indeed what I need to use. Thanks!
April 11th, 2011 10:13am

Your blog posting looks like it is exactly what I'm looking for; is it much harder to use the integrated MDT versus a configmgr TS to accomplish the dynamic renaming? I'm going to try your way and I"ll report back on the progress. Thanks to everyone who gave advice!
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 10:24am

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

Other recent topics Other recent topics