Skip to content

Instantly share code, notes, and snippets.

@anthonyspiteri
Last active February 2, 2018 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyspiteri/d53e637628153a71a3eda12a243f785a to your computer and use it in GitHub Desktop.
Save anthonyspiteri/d53e637628153a71a3eda12a243f785a to your computer and use it in GitHub Desktop.
$registryPath = "HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication"
$name = "CloudMaintenanceModeMessage"
clear
write-host
$existing = Get-ItemProperty "$registryPath"
$existingkey = $existing.CloudMaintenanceModeMessage
write-host "Existing Maintenance Mode Message (if blank default is set):" $existingkey
write-host
write-host "Would you like to do?"
write-host ""
write-host " 1. Reset to default Maintenance Mode Message"
write-host " 2. Add or Modify existing Maintenance Mode Message"
write-host ""
$answer = read-host "Please Make a Selection"
if ($answer -eq 1)
{
Remove-ItemProperty -path $regkeypath -name $name
write-host
write-host "--------------------------------------------------------------"
write-host "Custome Cloud Connect Maintenance Mode Custom Message Deleted!"
write-host "--------------------------------------------------------------"
write-host
}
elseif ($answer -eq 2)
{
$value = read-host "Enter your custom Cloud Connect Maintenance Mode Message"
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType STRING -Force | Out-Null
$regkey = Get-ItemProperty "$registryPath"
write-host
write-host "----------------------------------------------------"
write-host "Cloud Connect Maintenance Mode Custom Message Added!"
write-host "----------------------------------------------------"
write-host
write-host "New Message =" $regkey.CloudMaintenanceModeMessage
write-host
}
else
{
write-host "You choose....poorly"
exit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment