-
Notifications
You must be signed in to change notification settings - Fork 14
/
ATP Implementation.ps1
32 lines (16 loc) · 1.2 KB
/
ATP Implementation.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
####SET UP ATP#########
##########Connect to Exchange Online##########
Install-Module PowershellGet -Force
Update-Module PowershellGet
Set-ExecutionPolicy RemoteSigned
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline
############# Setting Domain Name ##################
$DomainName = Read-Host -Prompt "Enter Tenant Domain Name"
$WhiteListURl = Read-Host -Prompt "Enter any URLs you want to whitelist. If you have none, press enter"
##############Creating Safe Attachments Policy ########################################
New-SafeAttachmentPolicy -Name "Policy 1" -Action Dynamicdelivery -Enable $true -ActionOnError $true
New-SafeAttachmentRule -Name "Safe Attachment Policy" -SafeAttachmentPolicy "Policy 1" -RecipientDomainIs $DomainName
###############Creating Safe Links Policy###########################
New-SafeLinksPolicy -Name "Policy 1" -DoNotTrackUserClicks $true -EnableForInternalSenders $true -DoNotAllowClickThrough $True -TrackClicks $false -ScanUrls $true -AllowClickThrough $false -DoNotRewriteUrls $WhiteListURl -IsEnabled $true
New-SafeLinksRule -Name "SafeLinksPolicy" -SafeLinksPolicy "Policy 1" -RecipientDomainIs $DomainName -Enabled $true