#Detect
try
{
if ((Get-ItemPropertyValue -LiteralPath 'HKCU:\Software\Microsoft\Office\16.0\Outlook\PST' -Name 'MaxLargeFileSize' -ea SilentlyContinue) -eq 4294967295)
{
Write-host "OST size correct"
Exit 0
}
}
catch{
$errMsg = $_.Exception.Message
Write-host $errMsg
Exit 1
}
#Remmediation
try
{
New-ItemProperty -LiteralPath 'HKCU:\Software\Microsoft\Office\16.0\Outlook\PST' -Name 'MaxLargeFileSize' -Value 4294967295 -PropertyType DWord -ea SilentlyContinue -Force;
exit 0
}
catch{
$errMsg = $_.Exception.Message
Write-host $errMsg
exit 1
}