What do you mean about "User's ID number"? Do you mean "ExchangeGuid"? If not, could you explain about it and where it from?
If so, you could use a source file like below:
Then use the script below to check them (Save it to a ".ps1" file, then run it in EMS):
$users= Import-Csv c:\temp\users.csv
$Result= @()
foreach($user in $users){
if (Get-Mailbox $user.ExchangeGuid -ErrorAction SilentlyContinue){
$temp = Get-Mailbox $user.ExchangeGuid | select Name,ServerName,@{Expression={$_.ExchangeGuid};Label="ExchangeGuid";}
$Result+=$temp
}
}$Result | Export-Csv c:/temp/LocalMailbox.csv -NoTypeInformation
It will export the Exchange on-premises mailbox to the "LocalMailbox.csv"
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.