Created
March 13, 2019 18:05
-
-
Save austinsonger/d8ea8a2db7fc575279c9c85624f30153 to your computer and use it in GitHub Desktop.
Safe Links Policy and Rule using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UserCredential = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session -DisableNameChecking | |
New-SafeLinksPolicy -Name "Accounts Block URL" -IsEnabled $true -TrackClicks $true -ScanUrl $true -EnableForInternalSenders $true | |
New-SafeLinksRule -Name "Accounts URL Rule" -SafeLinksPolicy "Accounts Block URL" -SentToMemberOf "Accounts" -ExceptIfSentToMemberOf "Accounts Department Managers" | |
Get-SafeLinksPolicy | |
Get-SafeLinksRule | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment