Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save varunchandak/8d8fe34dbac5c3dc0e8671aacf171683 to your computer and use it in GitHub Desktop.
Save varunchandak/8d8fe34dbac5c3dc0e8671aacf171683 to your computer and use it in GitHub Desktop.
create permanently delete user in powershell
Connect-MsolService

New-MsolUser -DisplayName "User Name" -FirstName User -LastName Name -UserPrincipalName username@yourdirectory.onmicrosoft.com

get-msoluser -UserPrincipalName username@yourdirectory.onmicrosoft.com | select *immutableid*

set-MsolUser –UserPrincipalName username@yourdirectory.onmicrosoft.com -ImmutableId "username@domain.tld"

get-msoluser -UserPrincipalName username@yourdirectory.onmicrosoft.com | select *immutableid*

set-MsolUserPrincipalName -UserPrincipalName username@yourdirectory.onmicrosoft.com -NewUserPrincipalName username@domain.tld

get-msoluser -UserPrincipalName username@domain.tld | select *immutableid*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment