[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") $server = new-object "Microsoft.SqlServer.Management.Smo.Server" "localhost" $job = $server.JobServer.Jobs["Test Job"] $now = Get-Date do { Start-Sleep -Seconds 1 $job | select Name,CurrentRunStatus,LastRunDate $job.Refresh() } while($job.LastRunDate -lt $now) $job | select Name,CurrentRunStatus,LastRunDate
3 comments:
I am new to powershell.IF I pass vaiable instead of job name "Test Job" it does not work.what will be work around
I am new to powershell.IF I pass vaiable instead of job name "Test Job" it does not work.what will be work around
Nice posts. Even i admired from your title of hiring Star Employee. Actually screening for the best and effective candidates is much tedious and also important thing for every HR team. Anyway thank you for this posts.
Manpower Consultancy in Chennai
Post a Comment