Skip to content

Change Computer name during SCCM 2012 OSD TS

Featured Replies

I am moving from WDS to SCCM 2012 for OSD. I have the image ready and deploys very nicely. The one thing that we need to do is, change the computer name based on the serial number. We set all of our names with the asset tag in the name. We have a DB that we scan all Serials, Asset Tags, Computer Name in.

 

For example:

Asset Tag: XXXXX

 

Serial Number: 123456

 

Would have a computer name: LC0D401TO1XXXXX

 

When using WDS we did this after the OS was installed using a bat file (code below). Now when doing this in SCCM 2012, the name either will not change or the computer will be deleted from the domain.

 

Any help would be great!!

set newMN=
cscript.exe \\file_Location\inventory-sn.vbs //nologo %computername%>c:\install\machsn.txt
FOR /f %%p IN (c:\install\machsn.txt) DO SET machisn=%%p
find /c /i ",%machisn%," \\file_location\MNs.txt

FOR /f "tokens=1,2,3 delims=," %%q in ('findstr /s %machisn% \\File_Location\MNs.txt') DO SET newMN=%%s
SET MACHNAME=%newMN%

NETDOM RENAMECOMPUTER %newMN% /NewName:%MACHNAME% /userD:domain\user /PasswordD:**** /FORCE
  • Author

In ConfigMgr you have to start using task sequence variables. In this case your script has to create and set the OSDComputerName variable to your computer name,

Thank You so much for your help! I will check this out and let you know how it goes...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.