' This script is provided "AS IS" with no warranties, and confers no rights.
' For more information please visit
DIM strComputer, strSourceAcct, strSourceAcctDomain, strTargetAcct
DIM strTargetAcctDomain, strTargetAcctSID
DIM objProfile, objCommand, objRecordSet, objConnection, objWMIService, objSID
DIM dtStart, colProfiles, oSID, oUsr
DIM Revision, IssueAuthorities(11), strSDDL, subAuthorities
' This script has hard coded variables in it that must be filled out.
' We need the proper Active Directory domain name where the user exists in a DN format. You can
objCommand.CommandText = _
Set objWMIService = GetObject("winmgmts:\" & strComputer &"rootcimv2")
' Testing to verify that the current profile handle is for the Source Account that we want to
' Flag 1 = Change ownership of the source profile to target account
' Flag 2 = Delete the target account Profile and change ownership
' To use the ChangeOwner method, both the source and
function SDDL_SID ( oSID )
Please keep in mind if you have not installed Service Pack 1 for Vista, you will need to download the MSI installer to get the new
WMI Profile provider
since it was released after Vista shipped.
Well, I hope that you find this functionality helpful. Happy scripting.
- Rob Greene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.