Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - How to output a powershell into a sql server 2008 table

Reply
 
Old 10-09-2008   #1 (permalink)
LPJ
Guest


 
 

How to output a powershell into a sql server 2008 table

Hy all, my english is veru bad so i try to explain

I get this script in the net and works percetly

[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 (uning this script) a sql server 2008
table and some kind of file (csv..txt)

Thanks a LOT




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
table type formatted output in powershell PowerShell
SQL Server 2008 and PowerShell v2 PowerShell
powershell in vista / server 2008 - gui (longhorn) PowerShell
Getting Powershell output into a sql table PowerShell
Where is Powershell in Server 2008 PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46