Powershell Exchange

Audit Exchange Server permissions:
List Mailbox Permissions:
Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Select Identity,User,@{Name=’Access Rights’;Expression={[string]::join(‘, ‘, $_.AccessRights)}} | Export-Csv -NoTypeInformation mailboxpermissions.csv
Not sure:?
get-mailbox -identity <username or display name> | set-mailbox -type room
Change Mailbox Type:
Make user mailbox into shared:
Set-Mailbox user@something.com.au -Type shared
Verify the mailbox is now a shared mailbox:
Get-Mailbox -Identity shared@something.com.au | Format-List RecipientTypeDetails
Create a list of all users and mailbox types to a csv file:
Get-Mailbox | Select-Object name,RecipientTypeDetails| Sort-Object name| export-csv D:\Documents\output.csv
Give a user or group FullAccess rights:
Add-MailboxPermission username -User newuser -AccessRights FullAccess
Give a user or group SendAs rights:
Add-RecipientPermission username -Trustee newuser -AccessRights SendAs
Message Tracking:
Get-MessageTrackingLog -Server SERVERNAME -Start “Aug 28 2019” -sender “somebody@something.com.au” -resultsize unlimited | select-object Timestamp,Eventid,Source,SourceContext,MessageId,MessageSubject,Sender,Recipients,InternalMessageId,ClientIP, ClientHostname,ServerIp,ServerHostname,RecipientStatus,TotalBytes,RecipientCount, RelatedRecipientAddress,Reference,ReturnPath,MessageInfo | Out-Gridview
Get-MessageTrace –RecipientAddress user@something.com.au -StartDate 28/08/2019 -EndDate 28/08/2019
Find who owns an email:
Get-Recipient someone@something.com.au
~