Removing Computer Objects in AD

Removing Computer Objects in AD

I've got a question that I can't seem to find the answer to.

What methods are there for automating the removal of computer objects in AD as part of a lab imaging job?

I understand that sysprep will remove the "master PC" from the domain thus deleting the computer object. But when the image is distributed and new SIDs are generated as each PC runs sysprep, is renamed, and rejoins the domain it creates a conflict because we want the PCs to keep their old names in AD but the old objects in AD were never removed.

Any help is appreciated.

As part of your job in

As part of your job in Altiris you can have a script run before it images like:
"netdom /remove /domain:YOURDOMAIN COMPUTERNAME"

That'll remove the workstation from YOURDOMAIN - and after it's imaged you shouldn't have any problem rejoining it.

Nice!

We have been needing something like this as well. Thanks!