I am wondering about the script:
1.Which stops and disable all the Backup service and stops Veeam SQL Service before windows update,
and checks the windows update and if there is any, starts windows update.
2.After Windows update restarts the Veeam SQL Server service and Backup server.
I have made the script but it doesn't check the windows update. It is only for before windows update and after windows update, which I need to put on task scheduler before and after scheduled windows update time.
It would be great if you could help me on this:

1. StopVeeam_1.ps1
Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue # Adding VeeamSnapin
Connect-VBRServer -Server "localhost"-Port "9392" # To connect Veeam Server
Get-Vbrjob | Stop-Vbrjob # Stop Jobs
Start-Sleep -s 30 #Wait for 30seconds
Get-Vbrjob | Disable-Vbrjob # Disable all jobs
Disconnect-VBRServer #Disconnect Server
Start-Sleep -s 30 #Wait for 30seconds
Get-Service -computername winabcde -Name MSSQLSERVER | Stop-Service #Stop SQL Server
2.StartVeeam_1.ps1
Code: Select all
Get-Service -computername winabcde -Name MSSQLSERVER | Start-Service #Start SQL Server
Start-Sleep -s 30 #Wait for 30seconds
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue # Adding VeeamSnapin
Connect-VBRServer -Server "localhost"-Port "9392" # To connect Veeam Server
Get-Vbrjob | Enable-Vbrjob # Enable all jobs
Start-Sleep -s 30 #Wait for 30seconds
Get-Vbrjob | Start-Vbrjob # Start all Jobs