<<

1 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) V 0.1 Install Prerequisites In order to install Exchange 2019 on Windows 2019, a series of prerequisites need to be installed Install-WindowsFeature Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Static-Content,Web-Http-Redirect,Web-Health,Web-Http- Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Basic- Auth,Web-Client-Auth,Web-Digest-Auth,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Mgmt-Tools,Web-Mgmt- Compat,Web-Metabase,Web-WMI,Web-Mgmt-Service,NET-Framework-45-ASPNET,NET-WCF-HTTP-Activation45,NET-WCF-MSMQ-Activation45,NET-WCF-Pipe-Activation45,NET-WCF- TCP-Activation45,Server-Media-Foundation,MSMQ-Services,MSMQ-Server,RSAT-Feature-Tools,RSAT-Clustering,RSAT-Clustering-PowerShell,RSAT-Clustering-CmdInterface,RPC-over- HTTP-Proxy,WAS-Process-Model,WAS-Config-APIs [string]$expression = ".\UcmaRuntimeSetup.exe /quiet /norestart” Pro Tip Invoke-Expression $expression Some cmdlets produce a lot of results and Exchange will cap the display at 1000. To get greater [string]$expression = ".\vcredist_x64.exe /quiet /norestart” than 1000 results Use these parameters: Invoke-Expression $expression ‘-ResultSize Unlimited’ OR ‘-ResultSize ’ Prerequisite Script: https://gallery.technet.microsoft.com/Exchange-2019-Preview-b696abcc Configure Exchange Service URLs Additional Configuration Global Names (example): PageFile: Set-CIMInstance cmdlet $BaseURL = ‘.domain.com’ Event Logs: Limit-EventLog cmdlet $AutoDiscoverURL = ‘autodiscover.domain.com’ Server PowerManagement: Powercfg.exe Outlook Web Access (OWA) – Web client version access for end-users Set-OWAVirtualDirectory -Identity "$server\OWA (Default Web Site)" -InternalURL $BaseURL/OWA -ExternalURL https://$BaseURL/OWA NIC PowerManagement: Registry entry Offline Address Book – used by Outlook to download address book copy PnPCapabilities Set-OabVirtualDirectory -Identity "$Server\OAB (Default Web Site)" -InternalURL https://$BaseURL/OAB -ExternalUrl https://$BaseURL/OAB TCP Keep Alive: Registry – ‘KeepAliveTime’ ActiveSync – For mobile device connections TLS Capabilities (1.x): Registry Set-ActiveSyncVirtualDirectory -Identity "$Server\-Server-ActiveSync (Default Web Site)" -InternalURL https://$BaseURL/Microsoft-Server- SSL 3.0 Disabled: Registry entry ActiveSync -ExternalURL https://$BaseURL /Microsoft-Server-ActiveSync (Exchange) Web Services (EWS) Windows Core Configuration Set-WebServicesVirtualDirectory -Identity "$Server\EWS (Default Web Site)" -InternaURL https://$BaseURL/EWS/Exchange.asmx -ExternalURL https:// Sconfig.Cmd: $BaseURL/EWS/Exchange.asmx Option 1: Domain membership Exchange Control Panel (ECP) Option 2: Computer name Set-ECPVirtualDirectory -Identity "$Server\ECP (Default Web Site)" -InternalURL https://$BaseURL/ECP -ExternalUrl https://$BaseURL/ECP Option 5: Windows Updates AutoDiscover – Used by Outlook to discover where to connect to for a mailbox as well as other configuration information Set-ClientAccessServer $Server -AutoDiscoverServiceInternalUri https://$BaseURL/Autodiscover/Autodiscover.xml Option 8: Network settings MAPI – Used by Outlook to connect to mailbox Option 9: Date and Time Set-MAPIVirtualDirectory -Identity "$server\MAPI (Default Web Site)" -InternalURL $BaseURL/MAPI -ExternalURL https://$BaseURL/MAPI Option 11: Windows Activation Mailbox Databases Get-Help / Commands Used to store mailboxes in Exchange 2019: Find Exchange Cmdlets: List Databases: Create new Databases: Get-ExCommands Get-MailboxDatabase New-MailboxDatabase -Name "DB01" -EdbFilePath E:\Databases\DB01\DB01.edb -Server Ex01 Get Help for One Cmdlet: Get-MailboxDatabase -Server EX01 Change settings on existing Databases: Get-Help Remove exisiting Databases: Set-MailboxDatabase DB01 -DeletedItemRetention 10.00:00:00 (i.e.) Get-Help Get-Mailbox -Full Remove-MailboxDatabase DB01 Mount/Dismount Mailbox Databases Get-MailboxDatabase DB01 | Remove-MailboxDatabase Move an existing Database: Dismount-Database DB01 Move-DatabasePath –Identity –EDBFilePath E:\Databases\DB01\Database01.edb –LogFolderPath F:\logs\DB01 Mount-Database DB01 2 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) V 0.1 Distribution Groups Created By: Distribution Groups in Exchange 2019 come in two different varieties – Dynamic and Static and can be used for groups of users or rooms. Damian Scoles ** (Examples separated by ‘/’) ** Microsoft MVP Distribution Groups Book Author Disable-DistributionGroup ‘Temp Workers – Satellite Office 4 – Summer 2019’ www.practicalpowershell.com Enable-DistributionGroup ‘Temp Workers – Satellite Office 1’ www.powershellgeek.com Get-DistributionGroup -ManagedBy Damian / Get-DistributionGroup Sales* / Get-DistributionGroup -OrganizationalUnit Users @PPowerShell New-DistributionGroup -Name ‘Help Desk Operators’ / New-DistributionGroup -Name ‘Admins’ -Type Security Remove-DistributionGroup ‘Help Desk Operators’ / Get-DistribtionGroup Test* | Remove-DistributionGroup Helpful Tips Set-DistributionGroup ‘HR Department’ -MaxReceiveSize 10MB -MailTip ‘HR is limited to 10MB ’ Use tab to autocomplete cmdlets Tab through parameters to see all available Dynamic Distribution Groups Check for latest module version Get-DynamicDistributionGroup / Get-DynamicDistributionGroup -OrganizationUnit ‘Groups’ Read latest Microsoft Docs for Exchange New-DynamicDistributionGroup -Name ‘Chicago Office’ -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (Office -eq 'Chicago')} Read Exchange MVP blogs for more tips New-DynamicDistributionGroup -Name ‘Executives’ -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (CustomAttribute1 -eq 'Exec')} Remove-DynamicDistributionGroup ‘Chicago Office’ Set-DynamicDistributionGroup ‘Executives’ -ManagedBy ‘Bert’

Distribution Group Membership Add-DistributionGroupMember -Identity ‘Research Group’ -Member FSJurgeon $Members = Get-DistributionGroupMember -Identity $Group Remove-DistributionGroupMember ‘Help Desk’ -Member Damian Get-DistributionGroup Test* |Remove-DistributionGroupMember -Member Damian Update-DistributionGroupMember -Identity ‘IT Department’ -Members Sam,Donna,Frank,Dave Full Exchange Server 2019 PowerShell Book – https://PracticalPowershell.com Exchange Server Blog (EHLO): Http://aka.ms/ehlo Room Lists More On PowerShell Room lists are special Distribution Groups used in Exchange to organize groups of rooms for Outlook users when they search for rooms. Windows PowerShell Blog https://devblogs.microsoft.com/scripting/ Create Room List based on Rooms with a particular name: $Members = Get-Mailbox -Filter {Name -Like "Chicago*"} | Where {$_.RecipientTypeDetails -eq "RoomMailbox"} Script Center New-DistributionGroup -Name "ChicagoMeetingRooms" -DisplayName "Chicago Meeting Rooms" -RoomList -Members $Members technet.microsoft.com/scriptcenter

Create Room List based on Rooms located in one physical location: $Members = Get-Mailbox -Filter {Office -eq "Headquarters"} | Where {$_.RecipientTypeDetails -eq "RoomMailbox"} PowerShell Tips of the Week New-DistributionGroup -Name "HeadquartersMeetingRooms" -DisplayName "Headquarters Meeting Rooms" -RoomList -Members $Members www.practicalpowershell.com/blog

Display all Room Lists: PowerShell Team – GitHub Get-DistributionGroup -RecipientTypeDetails RoomList https://github.com/powershell 3 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) V 0.1 User Mailboxes Archive Mailboxes Mailbox Management Archive Mailbox Management Connect, Disable, Enable, Get, New, Remove, Set-Mailbox Managing Archive mailboxes uses the same cmdlets as a regular mailbox, but requires the List all mailboxes in Exchange environment: ‘-Archive’ switch. Sample tasks for archive mailboxes: Get-Mailbox -ResultSize Unlimited List all mailboxes in OU, Database or Server: Find all archive mailboxes: Get-Mailbox -Database "" / Get-Mailbox -Server Get-Mailbox -Archive -ResultSize Unlimited Create New Mailbox Find archive mailboxes in a specific database: New-Mailbox Damian -password p@ssword -UserPrincipalName [email protected] Get-Mailbox -Database "" – Archive Create new mailbox for existing user: Find archive mailboxes on a specific server: Enable-Mailbox -Identity Get-Mailbox -Server -Archive Disable mailbox (not delete): Change Settings (Location) Disable-Mailbox -Identity Dom.Rigel -Confirm:$False Set-Mailbox -Archive Remove mailbox (deletes user object): Add an archive: Remove-Mailbox -Identity Dom.Rigel -Confirm:$False Enable-Mailbox Administrator -Archive / Enable-Mailbox -Identity Administrator -Archive Remove a user’s archive: Other Mailbox Management Cmdlets Remove-Mailbox -Archive A variety of cmdlets and options exists to manage mailboxes. Some are listed below: Get-Mailbox -Archive | Remove-Mailbox Set mailbox quotas Archive Quota Settings Set-mailbox administrator -IssueWarningQuota 8GB -ProhibitSendQuota 10GB - Set-Mailbox -ArchiveQuota 10GB -ArchiveWarningQuota 9GB ProhibitSendReceiveQuota 12GB Archive mailbox sizes: Set users Out of Office: Get-Mailbox -Archive | Get-MailboxStatistics | Ft Name,TotalItemSize Set-MailboxAutoReplyConfiguration Administrator -AutoReplyState Enabled Move Archive Mailbox(es) to new Database Set user’s Junk Mail configuration: Get-Mailbox Damian -Archive | New-MoveRequest -TargetDatabase DB04 Set-MailboxJunkEmailConfiguration -Identity [email protected] - Get-Mailbox -Archive | New-MoveRequest -TargetDatabase ArchiveDB01 TrustedSendersAndDomains fabrikam.com Get-MailboxJunkEmailConfiguration -Identity [email protected] System Mailboxes Configure mailbox regional settings: Set-MailboxRegionalConfiguration -Identity "Hans de Vries" -Language nl-nl -DateFormat Exchange has a series of system mailboxes that are needed for various internal operations. "dd-MM-yy" -LocalizeDefaultFolderName -TimeZone "W. Europe Standard Time" Typically these are moved when a newer server version is added or if a server where the Mailbox Sizes mailboxes reside will be decommissioned: Get-Mailbox | Get-MailboxStatistics | Ft Name,TotalItemSize Add a retention policy to an existing mailbox List System Mailboxes Set-Mailbox Damian -RetentionPolicy ‘Corporate Retention Policy’ Get-Mailbox -Arbitration Manage Mailbox Folder Settings Get-Mailbox -Monitoring List folder permissions (Calendar in this case): Get-Mailbox -Auditlog Get-MailboxFolderPermission Damian:\Calendar Get-Mailbox -AuxAuditlog Add permissions to a folder Add-MailboxFolderPermission ‘Damian:\Contacts’ -User John -AccessRights Editor Move These mailboxes to a new server/database: Remove an existing folder permission: New-MoveRequest -arbitration -TargetDatabase NewDB01 Add-MailboxFolderPermission ‘Damian:\Calendar’ -User Administrator Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase NewDB01 Modify existing Folder permissions: Set-MailboxFolderPermission ‘Damian:\Contacts’ -User John -AccessRights FullAccess System Mailbox that contains Offline Address book : Get-Mailbox -Arbitration | Where {$_.PersistedCapabilities -Like ‘*oab*’} | Ft Name,Server 4 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) Non-User Mailboxes Room Mailboxes Shared Mailboxes Get-Mailbox -RecipientTypeDetails ‘RoomMailbox’ Shared mailboxes are special mailboxes where users have access to the mailbox, but the Get-Mailbox *ConferenceRoom* -RecipientTypeDetails RoomMailbox AD Account is disabled, preventing direct login/mailbox access. New-Mailbox ‘Large Conference Room’ -Room -ResourceCapacity 100 Remove-Mailbox ‘Large conference Room’ Get-Mailbox -Filter {RecipientTypeDetails -eq "SharedMailbox"}). Get-Mailbox *Chicago* -RecipientTypeDetails RoomMailbox | Remove-Mailbox New-Mailbox ‘Suggestion Box’ -Shared Set-Mailbox ‘Medium Conference Room’ -LitigationHoldEnabled $True -Capacity 55 Get-Mailbox ‘Test*’ -RecipientTypeDetails ‘SharedMailbox’ | Remove-Mailbox Disable-Mailbox ‘Small Conference Room’ Remove-Mailbox ‘Suggestion Box’ Enable-Mailbox ‘Small Conference Room’ Disable-Mailbox ‘Suggestion Box’ Set-CalendarProcessing LargeConferenceRoom –AutomateProcessing AutoAccept Linked Mailboxes Equipment Mailboxes A linked mailbox is a mailbox with a disabled user account in the Exchange environment Get-Mailbox -Filter {RecipientTypeDetails -eq "EquipmentMailbox"} (i.e. the resource forest). New-Mailbox Projector1 -Equipment Set-Mailbox Projector1 -ModerationEnabled $True -ModeratedBy Damian $RemoteCred = Get-Credential accountforest\administrator New-Mailbox -Name "Sjon Lont" -LinkedDomainController dc.accountforest.com - LinkedMasterAccount accountforest\Sjon.Lont -LinkedCredential $RemoteCred Full Exchange Server 2019 PowerShell Book – https://PracticalPowershell.com Server Management Exchange Certificates provide secure communications for SMTP and IIS connections. Database Availability Groups (DAG) are groups of Exchange 2019 servers used to provide high availability for mailbox databases. Enable a new certificate for Exchange Services: Enable-ExchangeCertificate -Thumbprint -Services SMTP,IIS,POP Get Database Availability Groups: Enable-ExchangeCertificate -Server Ex01 -Thumbprint -Services SMTP $DAGServers = (Get-DatabaseAvailabilityGroup).Servers Export an existing Exchange certificate for backup or copy to another server: Get-DatabaseAvailablityGroup ‘ChiDAG-01 | Fl Export-ExchangeCertificate -Thumbprint Create a new Database Availability Group: 28578A7923D5696AA92FA7DF4E4FF8ED4611FAB6 -FileName "c:\cert\cert.pfx" - New-DatabaseAvailabilityGroup -Name NYCDAG01-WitnessDirectory c:\FSW -WitnessServer FS01 BinaryEncoded -Password (ConvertTo-SecureString -String ‘c3rt123’ -AsPlainText -Force) Remove an existing Database Availability Group: List certificates by server or Thumbprit: Remove-DatabaseAvailablityGroup ‘ChiDAG-01 Get-ExchangeCertificate -Server Ex01/Get-ExchangeCertificate -Thumbprint Restore DAG for Disaster Recovery purposes: Import a certificate for later usage: Restore-DatabaseAvailabilityGroup -Identity CorpDAG -ActiveDirectorySite NYC Import-ExchangeCertificate -Server $Server -FileName"\\FS01\Cert\Exchange2019.pfx" - Start a server in a DAG: Password (ConvertTo-SecureString -String '3xch@ng31sb35t' -AsPlainText -Force) Start-DatabaseAvailabilityGroup CHIDAG01 -MailboxServer CHIEX01 Create a new certificate for Exchange 2019: Stop an exiting DAG when a server is offline: New-ExchangeCertificate Stop-DatabaseAvailabilityGroup NYCDAG01 -MailboxServer NYCEX01 -ConfigurationOnly Remove an existing Certificate by the Thumbprint value: Add Exchange server to DAG Remove-ExchangeCertificate -Thumbprint 28578A7923D5696AA92FA7DF4E4FF8ED4611FAB6 Add-DatabaseAvailabilityGroupServer SFCDAG01 -MailboxServer SFCEX02 Remove-ExchangeCertificate -Thumbprint | Remove-ExchangeCertificate Remove Exchange server from DAG Remove-DatabaseAvailabilityGroupServer ORL -MailboxServer ORLEX01 5 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) Mail Transport Accepted Domains Connectors Accepted Domains are domains for which Exchange will answer SMTP deliveries for. If a Proper mail flow is important in Exchange Server 2019. There are many PowerShell domain is not defined and an delivery is attempted for that domain, it will be cmdlets for managing these connectors and many types of connectors. rejected. Defining these domains is important. Receive Connector(s) Create a new Accepted Domain: Receive connectors receive emails from other Exchange servers, printers, applications or New-AcceptedDomain -DomainName PracticalPowerShell.com -DomainType remote mail servers to route emails to local mailboxes or relay to external recipients. Authoritative -Name PracticalPowerShell List Receive Connector(s) in Exchange (All or for one server): List all Accepted Domains: Get-ReceiveConnector Get-AcceptedDomain Get-ReceiveConnector -Server EX01 Remove an existing Accepted Domain: Create new Receive Connector: Remove-AcceptedDomain PracticalPowerShell New-ReceiveConnector ‘Internal Relay’ -TransportRole FrontendTransport -Usage Custom Change settings on an existing Accepted Domain: -RemoteIPRanges 10.0.0.0/16 -Bindings 10.0.1.1:25 Set-AcceptedDomain PracticalPowerShell -DomainType InternalRelay Remove existing Receive Connectors: RFC 822 Check for Postmaster Address Remove-ReceiveConnector ‘EX02\Internal Relay’ Foreach ($Domain in (Get-AcceptedDomain).DomainName) { Change settings on an existing Receive Connector: $Postmaster = ‘Postmaster@’+$Domain Set-ReceiveConnector ‘EX02\Internal Relay’ -ProtocolLoggingLevel Verbose $Check = Get-Recipient $Postmaster -ErrorAction SilentlyContinue Send Connector(s) If (!$Check) {Write-Host $Postmaster” does not exist.” -ForegroundColor Yellow} By default, Exchange 2019 has no send connectors. Use these cmdlets to manage send If ($Check) {Write-Host $Postmaster” does exist” -ForegroundColor Cyan} } connectors in Exchange 2019: Journaling List Send Connectors (all or by server): Enable this to copy email messages to a central location. Get-SendConnector Create a New Journaling Rule Get-SendConnector ‘Internet Mail’ New-JournalRule -Name "FinancialPlanners" -JournalEmailAddress ‘FP-Journal’ -Scope Create New Send Connectors: Global -Recipient '[email protected]' -Enabled $True New-SendConnector ‘Internet Mail’ -AddressSpace ‘*’ Remove an existing Journal Rule: Remove existing Send Connectors: Remove-JournalRule -Name "FinancialPlanners" Remove-SendConnector ‘Research Server’ List any current Journal Rules: Change settings on an existing Send Connecto (add a domain): Get-JournalRule Set-SendConnector ‘Bank Partner’ -AddressSpace bankdomain1.com,bankdomain2.com Disable an existing Journal Rule: IntraOrganization Connector(s) Disable-JournalRule -Name "FinancialPlanners" IntraOrganization Connectors can connect dispersed Exchange environments across Forest Enable an existing Journal Rule: boundaries (for example). Hybrid Configuration Wizard also uses this for connect Enable-JournalRule -Name ‘FinancialPlanners’ Exchange 2019 to Exchange Online (do not do this manually). Journal Rule Collections List all IntraOrganization Connectors: With these cmdlets, we can export entire collections of Journal rules and import to a new Get-IntraOrganizationConnector Exchange Servers or for backup purposes. Create new IntraOrganization Connectors Export: New-IntraOrganizationConnector -DiscoveryEndpoint https://mail.domain.com -Name $Output = Export-JournalRuleCollection SubsidiaryConnector -TargetAddressDomains powershellgeek.com Set-Content -Path "C:\Temp\AllJournalRules.xml" -Value $Output.FileData -Encoding Byte Remove an existing IntraOrganization Connector: Import: Remove-IntraOrganizationConnector -Identity SubsidiaryConnector [Byte[]]$Data = Get-Content -Path "C:\Temp\AllJournalRules.xml -Encoding Byte - Change settings on an existing IntraOrganization Connector: ReadCount 0 Set-IntraOrganizationConnector SubsidiaryConnector -Enabled $False Import-JournalRuleCollection -FileData $Data Set-IntraOrganizationConnector SubsidiaryConnector -TargetAddressDomains FunToys.com 6 Exchange Server 2019 - PowerShell Quick Reference (v 1.01) Mail Transport Transport Rules Compliance / DLP Transport Rule control mail flow and provide administrators control for certain mail types, mail flows or New-DlpPolicy -Name "Big Box Personal Info" -Template "Big Box PII" New-DlpPolicy -Name "Japanese Subsidiary Finance Data" -Template List all Transport Rules: "Japan Financial Data" Get-TransportRule New-PolicyTipConfig -Name en\NotifyOnly -Value ‘This message Create New Transport Rules [Example 1]: contains private information that should not be shared outside of this New-TransportRule -Name “ZIP Block” -AttachmentNameMatchesPatterns zip -GenerateIncidentReport company.’ “[email protected]” -IncidentReportOriginalMail IncludeOriginalMail -DeleteMessage $True - Create Document Fingerprint (for HR) and use in a Transport Rule: SetAuditSeverity Medium $HRDoc1 = Get-Content "C:\Documents\HR\EmployeePII-Form.docx" - Create New Transport Rules [Example 2]: Encoding Byte New-TransportRule -SentToScope ‘NotInOrganization’ -ApplyHtmlDisclaimerLocation ‘Append’ - $HRDoc1_Fingerprint = New-Fingerprint -FileData $HRDoc1 -Description ApplyHtmlDisclaimerText ‘This email is for its intended recipient. If you are not the recipient, please delete "Employee PII Form" this email immediately.’ -ApplyHtmlDisclaimerFallbackAction ‘Wrap’ -Name ‘Legal Required Disclaimer’ - New-DataClassification -Name "HR Confidential Form 1" -Fingerprints StopRuleProcessing:$false -Mode ‘Enforce’ -RuleErrorAction ‘Ignore’ -SenderAddressLocation ‘Header’ - $HRDoc1_Fingerprint -Description "Message contains confidential ExceptIfSubjectOrBodyContainsWords ‘This email is for its intended recipient’ employee information." Disable and existing Transport Rule: Set-DataClassification -Name "HR Confidential Form 1" -Fingerprints Disable-TransportRule ‘Test Keyword block rule’ $HRDoc1_Fingerprint Change settings on an existing Transport Rule: New-TransportRule -Name ‘Notify: External Recipient BigBox Set-TransportRule ‘Inbound HR eMail’ -SetAuditSeverity Medium confidential’ -RejectMessageReasonText 'This file is restricted and may Remove an existing Transport Rule: not be emailed outside the company.' -Mode Enforce -SentToScope Remove-TransportRule “ZIP Block” NotInOrganization -MessageContainsDataClassification @{Name='HR Confidential Form 1'} Full Exchange Server 2019 PowerShell Book – https://PracticalPowershell.com Edge Transport Role Edge Subscription(s) Protection Configuration Create the Edge Subscription XML File (run on Edge Transport Server): Below are some sample cmdlets for inbound message hygiene: New-EdgeSubscription -FileName "C:\Subscriptions\EdgeServerSubscription.xml" Import XML on Exchange server in the AD Site: Add-IPAllowListEntry -IPAddress 157.166.168.213 New-EdgeSubscription -FileData ([byte[]]$(Get-Content -Path "C:\Subscriptions\ Add-IPAllowListProvider -Name “Spamhaus” -LookupDomain EdgeServerSubscription.xml" -Encoding Byte -ReadCount 0)) -Site "Corp" swl.spamhaus.org -AnyMatch $True Remove Edge Subscription: Add-ContentFilterPhrase -Phrase “Project X” -Influence GoodWord Remove-EdgeSubscription -Identity ChiEdge01 Remove-ContentFilterPhrase -Phrase “Free credit report” Set-ContentFilterConfig –ByPassedSenders [email protected] Address Rewriting Set-ContentFilterConfig –ByPassedSenderDomains PowerShellGeek.Com Add a new Address Rewrite Entry: Get-SenderIDConfig New-AddressRewriteEntry -Name LittleBox -InternalAddress LittleBox.Com -ExternalAddress BigCorp.Com - Set-SenderFilterConfig –BlockedDomains BobsSpamService.Com – ExceptionList “rnd.littlebox.com,sales.littlebox.com” -OutboundOnly $True BlankSenderBlockingEnabled $True –Action StampStatus – New-AddressRewriteEntry -Name “LittleBox to BigCorp address rewrite.” -InternalAddress LittleBox.com – RecipientBlockedSenderAction Delete ExternalAddress BigCorp.Com Get-RecipientFilterConfig Remove and existing Address Rewrite Entry: Set-RecipientFilterConfig –BlockedRecipients [email protected] – Get-AddressRewriteEntry LittleBox | Remove-AddressRewriteEntry BlockListEnabled $True –RecipientValidationEnabled $True