Hy all, my english is very bad so i try to explain
I get this script in here (RON DAMERON article -
http://www.simple-talk.com/sql/database-administration/why-this-sql-server-dba-is-learning-powershell/) and works perfectly
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") |
out-null
foreach ($svr in get-content "C:\AllServers.txt")
{
write-host $svr
$srv=New-Object "Microsoft.SqlServer.Management.Smo.Server" "$svr"
$srv.jobserver.jobs | where-object {$_.lastrunoutcome -eq "Failed" -and
$_.isenabled -eq $TRUE} | format-table name,lastrunoutcome,lastrundate
-autosize
}
It´s list all sql server agent jobs with error in my servers. Ok
I want to know how a output this into (using this script) a sql server 2008
table and some kind of file (csv..txt)
Thanks a LOT