Hey guys,
So we recently enabled the feature in customsettings.ini that allows you to automatically join a computer to the domain. The computer name is dynamically-generated by MDT, is based on the computer's serial number and applied via the %OSDComputerName% variable. Because we frequently re-image the same machines MDT will dynamically generate the same name for a machine in a re-image scenario. When this happens it would be really handy if MDT could somehow delete the corresponding old computer account (that should have the same exact name as the new one) out of AD. I'm thinking this could be accomplished using our domain join account and maybe an MDT script, but I'm still a bit new to AD scripting. Does anyone have a solution like this already in place with a script or tool they can share to help me do the same?
So we recently enabled the feature in customsettings.ini that allows you to automatically join a computer to the domain. The computer name is dynamically-generated by MDT, is based on the computer's serial number and applied via the %OSDComputerName% variable. Because we frequently re-image the same machines MDT will dynamically generate the same name for a machine in a re-image scenario. When this happens it would be really handy if MDT could somehow delete the corresponding old computer account (that should have the same exact name as the new one) out of AD. I'm thinking this could be accomplished using our domain join account and maybe an MDT script, but I'm still a bit new to AD scripting. Does anyone have a solution like this already in place with a script or tool they can share to help me do the same?