Request :
disable “A program is trying to send an e-mail message on your behalf” warning in Outlook
Solution:
#Create Session
$session= New-PSSession Server01,Server02,Server03
#Checking Specifed registry value status
Invoke-Command -Session $session -ScriptBlock { Get-ItemProperty HKLM:\Software\Microsoft\Office\16.0\Outlook\Security\ -Name ObjectModelGuard }
#Create new key
Invoke-Command -Session $session -ScriptBlock { new-Item HKLM:\Software\Microsoft\Office\16.0\Outlook\ -name Security}
#Create new specified registry type/value/name
Invoke-Command -Session $session -ScriptBlock { new-ItemProperty HKLM:\Software\Microsoft\Office\16.0\Outlook\Security -Name ObjectModelGuard -Value 2 -PropertyType DWORD}