looking for a script that can identify if user is on premise or cloud

have a list of UPN's or email addresses in a csv format and looking to generate an output with location of mailbox... i.e prem or on cloud.
Who is Participating?
Todd NelsonSystems EngineerCommented:
Unfortunately, Get-Mailbox will only get you a list of on premises mailboxes and not a list of Exchange Online mailboxes; and vice versa with Get-RemoteMailbox.

Therefore, you will need to use Get-Recipient to provide the informaiton you are looking for.  Similar to this...

Get-RecipientType | Select DisplayName,Alias,RecipientType,RecipientTypeDetails | Export-Csv C:\RecipientType.csv -NoTypeInformation

Open in new window

Vasil Michev (MVP)Commented:
Simply look at the recipient type details for the object on-prem, it should give you the relevant information.
Todd NelsonSystems EngineerCommented:
Sufficient information provided to obtain answer.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.