Listing all users in Microsoft 365 can be useful in various scenarios, such as managing user accounts, auditing, or using with sync.blue®. In this article, we'll show you how to list all users in Microsoft 365 using PowerShell.
2. Define the user used with sync.blue® as “syncblueuser”:
$syncblueuser = "m.mustermann@xxx.onmicrosoft.com"
3. Install the ExchangeOnlineManagement module:
Install-Module -Name ExchangeOnlineManagement
4. ExchangeOnlineManagement authorize:
Connect-ExchangeOnline -UserPrincipalName $syncblueuser -ShowProgress $true
5. Read the users:
$users = (Get-Mailbox -ResultSize Unlimited).PrimarySmtpAddress -join ","
6. View the output:
Write-Output $users
Use this output, for example, when synchronizing contacts with multiple Exchange Online users or for granting mailbox permissions.
Comments
0 comments
Please sign in to leave a comment.