In SCVMM there is no option to send a mail when a job is completed.
This can be archived with PowerShell. Here is an simple example script to monitor the SCVMM Job status:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import-module virtualmachinemanager $VMMJob = Get-scjob | where{$_.status -match "running"} | Select-Object -Property ID,Owner,Description,Progress IF([string]::IsNullOrEmpty($VMMJob)) { Write-Host "No runnning jobs" Exit } While((Get-SCJob -ID $VMMJob.ID).Status -eq 'Running') { Start-Sleep -Seconds 3 Write-host "VMMJob"$VMMJob.Description"" Write-Host "Progress"$VMMJob.Progress"%" Write-host "Owner"$VMMJob.Owner"" } $status = (Get-SCJob -ID $VMMJob.ID).Status if($status -notmatch "Running"){ $PSEmailServer = "mailserver01.mailserver.local" $subject = $VMMJob.Description.Name + "is " + $Status $body = $VMMJob.Description.Name + "started by " + $VMMJob.Owner + " is " + $status send-mailmessage -to "test@test.com" -from "test@test.com" -subject $subject -body $body } |