o1-mini-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Powershell code to disable a windows account in azure ad with mggraph and convert his…
- User
Powershell code to disable a windows account in azure ad with mggraph and convert his mailbox to a shared mailbox. No need explanation in the code
- Assistant
$UserPrincipalName = "user@domain.com" Connect-MgGraph -Scopes "User.ReadWrite.All","Directory.AccessAsUser.All" Update-MgUser -UserId $UserPrincipalName -AccountEnabled $false Connect-ExchangeOnline -UserPrincipalName admin@domain.com Set-Mailbox -Identity $UserPrincipalName -Type Shared