Files
management-scripts/Fix-OfficeModernAuth.ps1
T

9 lines
493 B
PowerShell
Raw Normal View History

$REG_PATH = 'HKCU:\SOFTWARE\Microsoft\Exchange'
$REG_PROP = 'AlwaysUseMSOAuthForAutoDiscover'
2021-03-22 15:42:21 -04:00
If ( !((Get-ItemProperty -Path $REG_PATH -Name $REG_PROP -ErrorAction SilentlyContinue).$REG_PROP) ) {
LogMsg "Adding registry entry: ""${REG_PATH}\${REG_PROP}"" = 1"
2021-03-22 15:42:21 -04:00
Try { New-ItemProperty -Path $REG_PATH -Name $REG_PROP -PropertyType DWord -Value 1 | Out-Null }
Catch { LogErr $_.Exception.Message }
2021-03-22 15:43:23 -04:00
}
Else { LogMsg "The registry path already exists: ""${REG_PATH}\${REG_PROP}""" }