Office 365
#Restored the deleted user using the -AutoReconcileProxyConflicts parameter
-:Connect
Connect-MsolService
-:To get a list of users in the recycle bin:
Get-MsolUser -ReturnDeletedUsers
-:Restore a deleted user that’s still in the recycle bin:
Restore-MsolUser –UserPrincipalName user@mydomain.com
Restore-MsolUser -UserPrincipalName "user@mydomain.com" -AutoReconcileProxyConflicts
Restore-MsolUser -UserPrincipalName "user00@mydomain.com" -NewUserPrincipalName "user99@shera.com"
#Rename UserPrincipalName
Connect-MsolService
Get-MsolUser -UserPrincipalName mf13_ir@shera.com |select DisplayName,SignInName,UserPrincipalName
Set-msoluserprincipalname -userprincipalname pawinee_p@shera.com -newuserprincipalname pawinee_p2@shera.com
#Removed the ImmutableID
Set-MSOLUser -UserPrincipalName user@domain.com -ImmutableID "$null"
#Add new the ImmutableID
$userUPN = "user@domain.com"
$guid = [guid]((Get-ADUser -LdapFilter "(userPrincipalName=$userUPN)").objectGuid)
$immutableId = [System.Convert]::ToBase64String($guid.ToByteArray())
$immutableId
Set-MsolUser -UserPrincipalName user@domain.com -ImmutableId
$immutableId
ไม่มีความคิดเห็น:
แสดงความคิดเห็น