4D HyperV and Exchange 2016 Powershell Cheat Sheet
4D HyperV and Exchange 2016 Powershell Cheat Sheet
To receive further 4D Cheat Sheets or share your tips for productivity, please email [email protected]. Improve productivity
More insights here: www.4d-dc.com/insight
General
Get-Service -Name *Exchange* | select Status, DisplayName | sort Status | ft -AutoSize Checking the Microsoft Exchange Server status
Get-Queue -Identity Submission Check the contents of the submission queue
Get-MailboxDatabase | fl Name,EdbFilePath,LogFolderPath View mailbox, database and log file location
Set-TransportService Mailbox01 -ReceiveProtocolLogPath “C:\Logs\Receive.log” Change the location of SMTP protocol logs
Test-ServiceHealth Test the services on the local server
Get-HealthReport -Identity Mailbox01-RollupGroup Health Report on Mailbox01
-WhatIf WhatIf switch simulates the actions of the command without applying
Connection Filtering (Disabled by default)
Get-TransportAgent “Connection Filtering Agent” Checks the status of the agent
Enable-TransportAgent “Connection Filtering Agent” Enables Filtering Agent
Add-IPBlockListEntry -IPRange 10.0.0.0/24 This will block messages that come from the 10.0.0.0/24 network
Recipient Filtering (Enabled by default)
Set-RecipientFilterConfig –BlockedRecipients “[email protected]” Will block emails sent to [email protected]
Set-RecipientFilterConfig -RecipientValidationEnabled $true Will enable recipient validation
Permissions on Mailboxes
Get-MailboxPermission -Identity [email protected] | Format-List Gets permissions on Mailbox that has address [email protected]
Get-MailboxPermission -Identity [email protected] -User “BenB” Gets permissions that user BenB has on [email protected]
Add-DistributionGroupMember -Identity “Allusers” -Member “[email protected]” Adds user Ian to Distribution Group “Allusers”
Add-ADPermission -Identity [email protected] -User “Ian” -ExtendedRights Send-As Gives user Ian permissions to “Send As” [email protected]
Set-Mailbox -Identity [email protected] -GrantsendOnBehalfTo [email protected] Allows user Brian to “Send on Behalf” [email protected]
Add-MailboxPermission -Identity [email protected] -User Ian -AccessRights FullAccess Gives user Ian Full Access permissions to Ben’s Mailbox
Manage Mailboxes
4DPSCS18
Enable-Mailbox [email protected] Creates Mailbox and associates it with existing user. Database automatically chosen
Get-MailboxDatabase | fl Name,EdbFilePath,LogFolderPath View Mailbox, database and log file location
New-Mailbox -Shared [email protected] -OrganizationaUnit Shared Creates Shared Mailbox on the specified OU. Database automatically chosen
Add-DistributionGroupMember -Identity “New Project” -Member Ian Adds Ian to “New Projects” Distribution Group