Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tostka/efad264864d4dc70cc1e3918f57c02d1 to your computer and use it in GitHub Desktop.
Save tostka/efad264864d4dc70cc1e3918f57c02d1 to your computer and use it in GitHub Desktop.
<# all mailboxes in a site Ex10 EMS query #>
# one-line follows
get-exchangeserver |
where { $_.IsMailboxServer -eq $true -AND $_.Site -like '*SiteA*' -AND $_.admindisplayversion.major -eq 14 } |
get-mailboxdatabase |
where {$_.ReplicationType -eq "Remote"} |
get-mailbox -resultsize unlimited |
select samaccountname,DisplayName,Alias, Office,WindowsEmailAddress, @{Name='Addresses';Expression={[string]::join(";", ($_.EmailAddresses))}}, Database,ServerName,IsResource,IsLinked,IsShared, UseDatabaseQuotaDefaults,IssueWarningQuota, ProhibitSendQuota,ProhibitSendReceiveQuota, ArchiveDatabase,ArchiveGuid,ArchiveName, ArchiveQuota,ArchiveWarningQuota,WhenMailboxCreated, HasPicture,HasSpokenName,OrganizationalUnit, LegacyExchangeDN,PrimarySmtpAddress,RecipientType, RecipientTypeDetails,RequireSenderAuthenticationEnabled, SimpleDisplayName,ExchangeVersion,Name,DistinguishedName, Guid,ObjectCategory,WhenChanged,WhenCreated |
export-csv .\Ex2010-mbx-users.csv -notype ;
@tostka
Copy link
Author

tostka commented Mar 29, 2018

gisting up antique blog post code from circa 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment