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.
ARM2009Asked:
Who is Participating?
 
Todd NelsonConnect With a Mentor Systems 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

0
 
Vasil Michev (MVP)Connect With a Mentor Commented:
Simply look at the recipient type details for the object on-prem, it should give you the relevant information.
0
 
Todd NelsonSystems EngineerCommented:
Sufficient information provided to obtain answer.
0
All Courses

From novice to tech pro — start learning today.