Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "C:\Program Files\Windows Azure Directory Sync\DirSync\DirSyncConfigShell.psc1"
- Import-Module msonline
- $cred = Get-Credential
- Connect-MsolService -cred $cred
- $msolusers = Get-MsolUser -Verbose
- $OLcurrentuser = $msolusers|where-object{$_.UserPrincipalName -ilike "*Burton*" -and $_.UserPrincipalName -notlike "*test*"}
- #$OLcurrentuser.ObjectId
- $FN = $OLcurrentuser.FirstName
- $LN = $OLcurrentuser.LastName
- $aduser = Get-ADUser -filter *|where-object{$_.GivenName -eq $FN -and $_.Surname -eq $LN -and $_.UserPrincipalName -notlike "*test*"}
- $adguid = $aduser.ObjectGUID
- #$OLcurrentuser.ObjectId = $adguid
- $immutableID = [System.Convert]::ToBase64String($adguid.tobytearray())
- Set-MSOLuser -UserPrincipalName $OLcurrentuser.UserPrincipalName -ImmutableID $immutableID
- #Set-MSOLuser -UserPrincipalName $OLcurrentuser.UserPrincipalName -ImmutableID $adguid
- $OLcurrentuser.ImmutableId
- Start-OnlineCoexistenceSync -Fullsync
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement