Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (10 sloc) 600 Bytes
import-csv .\emailbox.csv | ForEach-Object { get-msoluser -UserPrincipalName $_.mail `
| Select-Object -Property displayname, UserPrincipalName, isLicensed, `
@{label='MailboxLocation';expression={ `
switch ($_.MSExchRecipientTypeDetails) { `
1 {'Onprem'; break} `
2147483648 {'Office365'; break} `
default {'Unknown'} `
} `
}}} '
| export-csv .\emailbox-location.csv -NoTypeInformation
You can’t perform that action at this time.