zanderkid
asked on
Powershell and sid history
Currently we are using the following script to move users via intraforest from servera to server b. I need a way to transfer the sid history from server a to server b as well.
$GroupNames = Get-QADMemberOf "Username" -Service "domainA.com" | Select-Object -ExpandProperty Name
admt user /N "Username" /IF:YES /MGS:NO /SD: "domainA.com" /TD: "domainB" /TO:"server users" /UUR:YES /PO:Complex /FGM:YES
$GroupNames | ForEach-Object { Add-QADGroupMember $_ -Member "username" -Service "domainB" }
I found the following script online but do not know how to integrate it into the script to move the users.
function Add-SidHistory {
Param($sourceDC,$sourceDom ain,$sourc eUsername, $targetDC, $targetDom ain,$Targe tUsername)
$clonePrincipal = New-Object -COMObject DSUtils.ClonePrincipal
$clonePrincipal.Connect($s ourceDC,$s ourceDomai n,$targetD C,$targetD omain)
$clonePrincipal.AddSidHist ory($sourc eUsername, $targetUse rname,0)
}
$GroupNames = Get-QADMemberOf "Username" -Service "domainA.com" | Select-Object -ExpandProperty Name
admt user /N "Username" /IF:YES /MGS:NO /SD: "domainA.com" /TD: "domainB" /TO:"server users" /UUR:YES /PO:Complex /FGM:YES
$GroupNames | ForEach-Object { Add-QADGroupMember $_ -Member "username" -Service "domainB" }
I found the following script online but do not know how to integrate it into the script to move the users.
function Add-SidHistory {
Param($sourceDC,$sourceDom
$clonePrincipal = New-Object -COMObject DSUtils.ClonePrincipal
$clonePrincipal.Connect($s
$clonePrincipal.AddSidHist
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.