Updating the Replication server should be updated as a whole.  if done manually, use this process which does everything listed below:
NEW! Level 2 Upgrade Procedure to upgrade A2E, Windows and MSO

For uninterrupted operation, this server should be considered a "low risk target". There is no active user logged in here pressing buttons or using Microsoft office or downloading and running weird software, it runs as a service. This means that it can and should be considered as a exception to your normal patching and security model, and there should be changes to patching and security exceptions made for continued and uninterrupted operation.  This system is unique and should not be patched as  one of your servers or workstations, There should be exceptions to normal policy by including antivirus exclusions of certain folders, exclusions from mfa of this machine and account with a strict conditional access policy and by patching in a very specific way..  

After reading this, many installation decide it is impossible to do this with their existing patch software and easier to unmanage the sync system for their existing patch management, and either do the above process manually at some interval by internal team members, or rely on one of our Premier Support Engineers, to recertify their system.  

System Updates: 
IF this system is being managed and must be managed by your patch management tool, please see if your system can do the update process outlined below and implement them for this server. 

Otherwise, let us know so we can either put you on the certification schedule.

Make a new updating exception and include this machine or sync account.  Run pre and post command sequence as per below.
We usually do all maintenance on the system as part of Premier Support, when we update the system as a whole, Add2Exchange Enterprise, MSO and Windows Critical updates and recertify the replication server, but you can too with the link above.

Update Pre commands:

“Net stop “Add2Exchange Service”” or “PS\netbiosname Stop “Add2Exchange Service”,
Do all MS Windows critical updates including all MS products on the box wait for completion.
Optional: Do all MSO updates - optional because if skipped, the post MSO commands below do not have to be run. 
This step is the critical need for your RMM tool, and  seems to be very hard for most RMM systems to accomplish.

Post command1:

After MSO successful has updated, at the ultimate completion, run the powershell "Outlook_profile_set.ps1" – this file has been included below.  Save and Run as powershell after any successful or unsuccessful MSO update process, and do it every time.

Post command2:

Finally, after all updates are completed and with the Add2Exchange Service still in the stopped state, reboot by running the command “shutdown -r -t 0”
The replication server will reboot, apply updates and it will come back alive and if syncing with O365, auto log in and lock.

Exclusions:
If there is any login banner or a program stopping auto login like Duo, this should be removed so auto updates can be handled without IT support having to log back in and check the Add2Exchange Logs and then subsequently lock.This can be avoided by an exclusion.

Antivirus Exclusions:
Antivirus Exclusions from active file scanning
(These are default locations) 
C:\Program Files (x86)\OpenDoor Software®\
- Note the *Circle r* in the directory name. Copy and paste to antivirus program
C:\Program Files (x86)\DidItBetterSoftware
C:\Program Files\Microsoft SQL Server\
C:\Users\zadd2exchange\AppData
C:\Zlibrary

MFA:  Remove so sync user can log in without challenge and run bitlocked powershells to onboard new users.
MFA for Sync Service account can stop complete automation 

When leaving the machine, lock the machine or disconnect the session while the service account is logged in. 


Make and run this file after MSO updates. 
Contents of Outlook_Profile_set.ps1.  Copy the text of the following and create the OutlookProfileSetup.PS1 file 

Start starts at <#

<#
        .SYNOPSIS
        Outlook Profile Setup

        .DESCRIPTION
        Setup Outlook profile for Add2Exchange
        Setup GAL Options
        Setup Send/Recieve
        Disables COM Addins
        Sets Options
        Disables Outlook Popups

        .NOTES
        Version:        3.2023
        Author:         DidItBetter Software

    #>

if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
  # Relaunch as an elevated process:
  Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
  exit
}

#Execution Policy
Set-ExecutionPolicy -ExecutionPolicy Bypass -Force

#Logging
Start-Transcript -Path "C:\Program Files (x86)\DidItBetterSoftware\Support\A2E_PowerShell_log.txt" -Append

# Script #

#Check Outlook Version
$Version = Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\Outlook.Application\CurVer" | Select-object -expand '(default)' -ErrorAction SilentlyContinue -ErrorVariable E1
If ($E1) {
  Write-Host "There seems to be an error or conflict in Outlook Versions. Exiting"
  Pause
  Exit
}

#######Outlook V.16#############
If ($Version -eq "Outlook.Application.16") {
#Profile Check
Write-Host "Checking Profile Names"
$Profile = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\WOW6432Node\OpenDoor Software®\Add2Exchange" -Name ServiceAccount

Write-Host "Add2Exchange Profile in use is $Profile"

Write-Host "Writing $Profile Profile Changes...."

#Address Book
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\9207f3e0a3b11019908b08002b2a56c2" -Name "01023d06" -value ([byte[]](0x00,0x00,0x00,0x00,0xb1,0x84,0xb4,0xea,0xd0,0xab,0xcb,0x41,0xa8,0xd0,0x0d,0xea,0x0c,0x29,0xb0,0x44,0x01,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x2f,0x00))

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\0a0d020000000000c000000000000046" -Name "000b3d1c" -value ([byte[]](0x00,0x00))
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\0a0d020000000000c000000000000046" -Name "00033d1b" -value ([byte[]](0x01,0x00,0x00,0x00))

#Trust Center
$Privacy = Test-Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy"
If ($Privacy -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "Privacy"
}

$Anonymous = Test-Path -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous"

If ($Anonymous -eq $true){
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesState" -value 2
  $Date = Get-Date -Format 'yyy\-MM\-ddTHH:mm:ssZ'
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesStateTime" -value $Date
}

If ($Anonymous -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy" -Name "SettingsStore"
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore" -Name "Anonymous"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesState" -value 2
  $Date = Get-Date -Format 'yyy\-MM\-ddTHH:mm:ssZ'
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesStateTime" -value $Date
}


$Profile1 = Test-Path -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e"

If ($Profile1 -eq $true){
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e" -Name "00030354" -value ([byte[]](0x00,0x00,0x00,0x00))
}

If ($Profile1 -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile" -Name "c02ebc5353d9cd11975200aa004ae40e"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e" -Name "00030354" -value ([byte[]](0x00,0x00,0x00,0x00))
}

$Security = Test-Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security"
If ($Security -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook" -Name "Security"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security" -Name "InitEncrypt" -value 2
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security" -Name "InitSign" -value 2
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security" -Name "SharedFolderScript" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security" -Name "PublicFolderScript" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Security" -Name "Level" -value 1

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Preferences" -Name "DisableAttachmentPreviewing" -value 1

$Mail = Test-Path -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail"
If ($Mail -eq $true) {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSafeZone" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSpecificSenders" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockRSS" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSTS" -value 0
}


If ($Mail -eq $false) {
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options" -Name "Mail"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSafeZone" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSpecificSenders" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockRSS" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Mail" -Name "UnblockSTS" -value 0
  }

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "SendCustomerDataOptInReason" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "SendCustomerDataOptIn" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "SendCustomerData" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "UpdateReliabilityData" -value 0

$Helperviewer = Test-Path "HKCU:\Software\Microsoft\Office\16.0\Common\HelpViewer"
If ($Helperviewer -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "HelpViewer"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\HelpViewer" -Name "UseOnlineContent" -value 2

$PTWatson = Test-Path "HKCU:\Software\Microsoft\Office\16.0\Common\PTWatson"
If ($PTWatson -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common" -Name "PTWatson"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\PTWatson" -Name "PTWOptIn" -value 3

$ResearchOptions = Test-Path "HKCU:\Software\Microsoft\Office\16.0\Common\Research\Options"
If ($ResearchOptions -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Research" -Name "Options"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\Research\Options" -Name "DiscoveryNeedOptIn" -value 0

$Security = Test-Path -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\16.0\Outlook\Security"

If ($Security -eq $true){
  Set-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\16.0\Outlook\Security" -Name "ObjectModelGuard" -value 2
}

If ($Security -eq $false){
  New-Item -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\16.0\Outlook" -Name "Security"
  New-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\16.0\Outlook\Security" -Name "ObjectModelGuard" -value 2
}


#Outlook Social Connector
Write-Host "Disabling Outlook Social Connector"
Start-Process Powershell .\OSC_Disable.bat
Write-Host "Done"

#Disable Outlook Updates
Write-Host "Disabling Outlook Updates"

$Val = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "UpdatesEnabled"

if($val.UpdatesEnabled -eq $True)

{
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "UpdatesEnabled" -value False
Write-Host "Outlook Updates are now Disabled!"

}

Else {

  Write-Host "Outlook Updates Already Disabled!"

}

#Disable Outlook popups
Write-Host "Disabling Teaching Callouts"
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "AutoSaveTottleOnWord" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "MeetingAllowForwardTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "AutoSaveFirstSaveWord" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "CommingSoonTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "AutocreateTeachingCallout_MoreLocations" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "Search.TopResults" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "UseTighterSpacingTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "SLRToggleReplaceTeachingCalloutID" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "DataVisualizerRibbonTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "ExportToWordProcessTabTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\TeachingCallouts" -Name "PreviewPlaceUpdate" -value 0 -ErrorAction SilentlyContinue

#######Outlook V.15#############
If ($Version -eq "Outlook.Application.15") {
  #Profile Check
Write-Host "Checking Profile Names"
$Profile = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\WOW6432Node\OpenDoor Software®\Add2Exchange" -Name ServiceAccount

Write-Host "Add2Exchange Profile in use is $Profile"

Write-Host "Writing $Profile Profile Changes...."

#Address Book
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\9207f3e0a3b11019908b08002b2a56c2" -Name "01023d06" -value ([byte[]](0x00,0x00,0x00,0x00,0xb1,0x84,0xb4,0xea,0xd0,0xab,0xcb,0x41,0xa8,0xd0,0x0d,0xea,0x0c,0x29,0xb0,0x44,0x01,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x2f,0x00))

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\0a0d020000000000c000000000000046" -Name "000b3d1c" -value ([byte[]](0x00,0x00))
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\0a0d020000000000c000000000000046" -Name "00033d1b" -value ([byte[]](0x01,0x00,0x00,0x00))

#Trust Center
$Privacy = Test-Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy"
If ($Privacy -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "Privacy"
}

$Anonymous = Test-Path -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore\Anonymous"

If ($Anonymous -eq $true){
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesState" -value 2
  $Date = Get-Date -Format 'yyy\-MM\-ddTHH:mm:ssZ'
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesStateTime" -value $Date
}

If ($Anonymous -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy" -Name "SettingsStore"
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore" -Name "Anonymous"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesState" -value 2
  $Date = Get-Date -Format 'yyy\-MM\-ddTHH:mm:ssZ'
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Privacy\SettingsStore\Anonymous" -Name "ControllerConnectedServicesStateTime" -value $Date
}


$Profile1 = Test-Path -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e"

If ($Profile1 -eq $true){
  Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e" -Name "00030354" -value ([byte[]](0x00,0x00,0x00,0x00))
}

If ($Profile1 -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile" -Name "c02ebc5353d9cd11975200aa004ae40e"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles\$Profile\c02ebc5353d9cd11975200aa004ae40e" -Name "00030354" -value ([byte[]](0x00,0x00,0x00,0x00))
}

$Security = Test-Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security"
If ($Security -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook" -Name "Security"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security" -Name "InitEncrypt" -value 2
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security" -Name "InitSign" -value 2
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security" -Name "SharedFolderScript" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security" -Name "PublicFolderScript" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Security" -Name "Level" -value 1

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Preferences" -Name "DisableAttachmentPreviewing" -value 1

$Mail = Test-Path -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail"
If ($Mail -eq $true) {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSafeZone" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSpecificSenders" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockRSS" -value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSTS" -value 0
}


If ($Mail -eq $false) {
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options" -Name "Mail"
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSafeZone" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSpecificSenders" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockRSS" -value 0
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Options\Mail" -Name "UnblockSTS" -value 0
  }

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "SendCustomerDataOptInReason" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "SendCustomerDataOptIn" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "SendCustomerData" -value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "UpdateReliabilityData" -value 0

$Helperviewer = Test-Path "HKCU:\Software\Microsoft\Office\15.0\Common\HelpViewer"
If ($Helperviewer -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "HelpViewer"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\HelpViewer" -Name "UseOnlineContent" -value 2

$PTWatson = Test-Path "HKCU:\Software\Microsoft\Office\15.0\Common\PTWatson"
If ($PTWatson -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common" -Name "PTWatson"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\PTWatson" -Name "PTWOptIn" -value 3

$ResearchOptions = Test-Path "HKCU:\Software\Microsoft\Office\15.0\Common\Research\Options"
If ($ResearchOptions -eq $false){
  New-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Research" -Name "Options"
}

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\Research\Options" -Name "DiscoveryNeedOptIn" -value 0

$Security = Test-Path -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\15.0\Outlook\Security"

If ($Security -eq $true){
  Set-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\15.0\Outlook\Security" -Name "ObjectModelGuard" -value 2
}

If ($Security -eq $false){
  New-Item -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\15.0\Outlook" -Name "Security"
  New-ItemProperty -Path "HKLM:SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Wow6432Node\Microsoft\Office\15.0\Outlook\Security" -Name "ObjectModelGuard" -value 2
}


#Outlook Social Connector
Write-Host "Disabling Outlook Social Connector"
Start-Process Powershell .\OSC_Disable.bat
Write-Host "Done"


#Disable Outlook Updates
Write-Host "Disabling Outlook Updates"

$Val = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "UpdatesEnabled"

if($val.UpdatesEnabled -eq $True)

{
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "UpdatesEnabled" -value False
Write-Host "Outlook Updates are now Disabled!"

}

Else {

  Write-Host "Outlook Updates Already Disabled!"

}

#Disable Outlook popups
Write-Host "Disabling Teaching Callouts"
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "AutoSaveTottleOnWord" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "MeetingAllowForwardTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "AutoSaveFirstSaveWord" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "CommingSoonTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "AutocreateTeachingCallout_MoreLocations" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "Search.TopResults" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "UseTighterSpacingTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "SLRToggleReplaceTeachingCalloutID" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "DataVisualizerRibbonTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "ExportToWordProcessTabTeachingCallout" -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Common\TeachingCallouts" -Name "PreviewPlaceUpdate" -value 0 -ErrorAction SilentlyContinue

 

}

#######Outlook Not Supported#############
If ($Version -eq "Outlook.Application.14") { 
  Write-Host "This version of Outlook is not supported"
}


Write-Host "ttyl"
Get-PSSession | Remove-PSSession
Exit

# End Scripting

 

 

END - "End Scripting" concludes the powershell command.