-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathoutlook-windows.ps1
52 lines (39 loc) · 2.24 KB
/
outlook-windows.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$UserDataPath = $Env:appdata
$FolderLocation = $UserDataPath + '\Microsoft\Signatures\'
$url = Read-Host -Prompt 'enter url'
$osVersion = [System.Environment]::OSVersion.Version.Major
IF ($osVersion -ge 10) {
[Net.ServicePointManager]::SecurityProtocol = "Tls12, Tls11, Tls, Ssl3"
} ELSE {
[Net.ServicePointManager]::SecurityProtocol = "Tls, Ssl3"
}
$wc = New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
$wc.CachePolicy = New-Object System.Net.Cache.HttpRequestCachePolicy([System.Net.Cache.HttpRequestCacheLevel]::NoCacheNoStore)
$signatureHTML = $wc.DownloadString($url)
mkdir $FolderLocation -force
$signatureFile = $FolderLocation + "signature.htm"
$signatureHTML | Out-File -Encoding Unicode $signatureFile
IF (Test-Path "HKCU:\Software\Microsoft\Office\14.0") {
IF (!(Test-Path "HKCU:\Software\Microsoft\Office\14.0\Outlook\Options\Mail")) {
New-Item "HKCU:\Software\Microsoft\Office\14.0\Outlook\Options\Mail" -Force
}
New-ItemProperty "HKCU:\Software\Microsoft\Office\14.0\Outlook\Options\Mail" -Name "BlockExtContent" -Value 0 -PropertyType DWORD -Force
New-ItemProperty "HKCU:\Software\Microsoft\Office\14.0\Outlook\Options\Mail" -Name "Send Pictures With Document" -Value 0 -PropertyType DWORD -Force
}
IF (Test-Path "HKCU:\Software\Microsoft\Office\15.0") {
IF (!(Test-Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail")) {
New-Item "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Force
}
New-ItemProperty "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "BlockExtContent" -Value 0 -PropertyType DWORD -Force
New-ItemProperty "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "Send Pictures With Document" -Value 0 -PropertyType DWORD -Force
}
IF (Test-Path "HKCU:\Software\Microsoft\Office\16.0") {
IF (!(Test-Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail")) {
New-Item "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Force
}
New-ItemProperty "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "BlockExtContent" -Value 0 -PropertyType DWORD -Force
New-ItemProperty "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "Send Pictures With Document" -Value 0 -PropertyType DWORD -Force
}
""
"done."