powershell VD Code workbench.action.terminal.runSelectedText Get All Groups for the current user is a member of (get-aduser $env:USERNAME -Properties memberof | select -expand memberof | get-adgroup) | select Name,groupscope | sort name Get All Groups for the current user is a member of Get-ADPrincipalGroupMembership $env:username | select name Add admin to user net localgroup Administratörer "AzureAD\xxx@xx.se" /add net localgroup Administratörer "AzureAD\xxx@xx.se" /delete Install the Az.Accounts PowerShell module manually Download Az.Accounts: https://www.powershellgallery.com/packages/Az.Accounts/ Rename the .nupkg file to .zip Extract the contents of the zip file to folder Az.Accounts. Copy the Az.Accounts folder to C:\Program Files\WindowsPowerShell\Modules\Az.Accounts Run these command: Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\Az.Accounts" -Recurse | Unblock-File Get-Module -ListAvailable -Name Az.Accounts Import-Module -Name Az.Accounts PowerShell execution policy using Local Group Policy Editor gpedit.msc > Computer Configuration → Administrative Templates → Windows Components → Windows PowerShell → Turn on Script Execution