Skip to content

Instantly share code, notes, and snippets.

@thoughtful-solutions
Last active August 4, 2022 10:29
Show Gist options
  • Save thoughtful-solutions/b7b8e4af0f2843f833b89343b8530215 to your computer and use it in GitHub Desktop.
Save thoughtful-solutions/b7b8e4af0f2843f833b89343b8530215 to your computer and use it in GitHub Desktop.
Azure-AD

Azure-AD

Install PowerShell AZ modules

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
Install-Module -Name AzureAD -Scope CurrentUser

Connect Azure Account

Connect-AzureAD

Verify connectivity

Get-AzureADUser -Top 10
get-AzureADGroup

Convert output to JSON

get-AzureADuser -Top 10 | select UserPrincipalName,userState,mailnickname | Convertto-Json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment