Hello, I'm just trying to connect to the SQL server using powersehll and check the job status of all the jobs in that server.
The server I'm trying to connect to is a local host and instance is MSSQLSERVER(Localhost\MSSQLSERVER)
Here's the code that I'm using
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null $sql = New-Object ('Microsoft.SqlServer.Management.Smo.Server') ".\MSSQLSERVER" $sql| Get-Member -name *job* $sql.JobServer
As far as I know, this should give me a list of all the job exists in that instance. But the script simply executes but would not shown an output on the screen, except for this
$sql| Get-Member -name *job*
which simply lists all the members of the object 'sql.' Further, I've verified that the server agent is running and also a job is running currently.
Any inputs here ?
Thank