Link to home
Start Free TrialLog in
Avatar of CameronFrasnelly
CameronFrasnelly

asked on

AD script to change PC name based on GUID in Active Directory

In Active Directory you can assign a PC a GUID when you create it's account.  We are wanting to write a script that looks up the computer name based on this GUID.  We want to do this in case we image a bunch of machines we can run this script to 1) connect to AD 2) lookup the GUID based on the local PC 3) look at the pc name associated with the GUID 4) change the name of the local PC 5) join the pc back to the domain.

Any thoughts would be appreciated!
Avatar of TheCleaner
TheCleaner
Flag of United States of America image

You want to change the name to the GUID?  I'm lost I guess.

Are you talking about prestaging a RIS computer?

If you image a bunch of PCs then the GUID will only show up in AD if you pre-stage the computers, in which case you'll be setting the name of the local PC and joining the domain anyway...so I'm not sure what you are asking, unless you are wanting something that does the "prestaging" automatically.
Avatar of CameronFrasnelly
CameronFrasnelly

ASKER

: ) We want to lookup the PC name based on the netbootGUID in AD.  So first we'll retrieve the local UUID (which we will have prestaged as the netbootGUID in AD) then we'll lookup the computer in AD that has the same GUID set for it's netboodGUID and grab the computer name.  At that point we'll rename the pc and join the domain and life will be good! : )
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial