Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Get SQL Agent Job step ID from powershell

$
0
0

Hi again guys!!!

Now this time I would like to get the SQL Agent Job stepID from powershell.  I only have the StepName and I would like to get information from the Job History as follow:

write-host "Name: $($job.JobSteps[$stepID].Name) RunDate: $($job.JobSteps[$stepID].LastRunDate) Status: $($job.JobSteps[$stepID].LastRunOutCome)"

Can I get this information using the stepname?


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>