Hi, I am trying to check status of sql agent jobs on various servers using powershell howerver I successfully list all the servers but cant seem to be able toWrite-Output$job.namefor any of the servers including the monitoring server that I am absolutely sure I have all required permissions. I get no errors which makes troubleshooting that much more difficult. Any ideas? Thank you
...
foreach($sqlserverin$sqlservers){
#***THIS WORKS***
write-host$sqlserver.instancename
$srv=New-Object ('Microsoft.SqlServer.Management.Smo.Server')$sqlserver;
foreach ($jobin$srv.Jobserver.Jobs)
{
$jobName=$job.Name;
$jobEnabled=$job.IsEnabled;
...
#***THIS DOESN'T WORK***write-host $jobName
write-host $job.Name
...
Paula