Here is a sample PowerShell script to export all users and computers from Azure AD:
# Import the Azure Active Directory module Import-Module AzureAD # Connect to Azure AD Connect-AzureAD # Get all users from Azure AD $users = Get-AzureADUser -All $true # Export the users to a CSV file $users | Export-Csv -Path "AzureAD_Users.csv" -NoTypeInformation # Get all computers from Azure AD $computers = Get-AzureADDevice -All $true # Export the computers to a CSV file $computers | Export-Csv -Path "AzureAD_Computers.csv" -NoTypeInformation
This script will import the Azure Active Directory module, connect to your Azure AD tenant,
retrieve all users and computers, and export the information to separate CSV files.
You can modify the file paths as needed to suit your requirements.
No comments:
Post a Comment