MS AD/Azure

circle-info

Connect-AzAccount

User Accounts

Extracting U-Accounts by Filter

Get-AzureADUser -All $true | Where-Object {($_.Company -eq "Company-Name-1") -or ($_.Company -eq "Company-Name-2")} | Select displayName, state, department, country, objectID, userPrincipalName | Export-Csv -path here.csv

Get-AzureADUser

Exports every user account on Azure. Exporting displayName - state etc into a CSV file

 Get-AzureADUser -All $true | Select displayName, state, department, country, office, userPrincipalName | Export-Csv -path C:\psexport\Azure_User_Mapping.csv
Get-AzureADUser -All $true | Select displayName, state, department, country, objectID, userPrincipalName | Export-Csv -path C:\psexport\Azure_User_Mapping_With_AccObID.csv

Azure AZ Module

Filters

User Accounts

Litigation Hold Audit

O365 User Licences Audit

  • Connect via Powershell.

  • Run Get-MsolAccountSku to get a list of the current licenses in your Office 365 tenant. Make a note of the AccountSkuId value for the license you want to filter on.

  • Now you can edit this short script to get the users matching that license. In this case, we’re getting users with a specific license.

  • More filtering

Azure Powershell Graph Module

Authentication

The PowerShell SDK supports two types of authentication: delegated access, and app-only access. In this guide, you'll use delegated access to sign in as a user, grant consent to the SDK to act on your behalf, and call the Microsoft Graph.

Microsoft Active Directory

User module


List members of a group


Azure CLI

Last updated