<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Most Recent Job Status of All Enabled Jobs</title>
	<atom:link href="http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/feed/" rel="self" type="application/rss+xml" />
	<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 15:10:28 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: @littlefuzz</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4500</link>
		<dc:creator>@littlefuzz</dc:creator>
		<pubDate>Thu, 19 Nov 2009 18:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4500</guid>
		<description>Good SQL script Colin... It works great for me on 2000/2005/2008. And it&#039;s really slick when ran as multi-server CMS query. 

It&#039;s very useful for our environment and I wonder why I haven&#039;t seen anything like this before!

+1 bacon nugget</description>
		<content:encoded><![CDATA[<p>Good SQL script Colin&#8230; It works great for me on 2000/2005/2008. And it&#8217;s really slick when ran as multi-server CMS query. </p>
<p>It&#8217;s very useful for our environment and I wonder why I haven&#8217;t seen anything like this before!</p>
<p>+1 bacon nugget</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Stasiuk</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4499</link>
		<dc:creator>Colin Stasiuk</dc:creator>
		<pubDate>Thu, 19 Nov 2009 15:12:44 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4499</guid>
		<description>Not doing much :D just being anal and not trusting my job notification failures... so this is my adhoc sniff test :)

I even have a policy setup to check that all my prod jobs have notification on failure configured... but I have trust issues LOL</description>
		<content:encoded><![CDATA[<p>Not doing much <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  just being anal and not trusting my job notification failures&#8230; so this is my adhoc sniff test <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I even have a policy setup to check that all my prod jobs have notification on failure configured&#8230; but I have trust issues LOL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @SQLCrotch</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4498</link>
		<dc:creator>@SQLCrotch</dc:creator>
		<pubDate>Thu, 19 Nov 2009 15:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4498</guid>
		<description>Sweetness man! I am happy that worked out. Next blog you&#039;ll have to show us what you are doing with it! Killer bro!</description>
		<content:encoded><![CDATA[<p>Sweetness man! I am happy that worked out. Next blog you&#8217;ll have to show us what you are doing with it! Killer bro!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Stasiuk</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4497</link>
		<dc:creator>Colin Stasiuk</dc:creator>
		<pubDate>Thu, 19 Nov 2009 15:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4497</guid>
		<description>#########################################################################################
# Job_Failures Script – Used to report status of jobs
#########################################################################################
#Declare the Central Management Server
$CMSGroup = &#039;SQLSERVER:\SQLRegistration\Central Management Server Group\MyCMSSQLServer\MyCMSGroup\&#039;

#Read the servers list into a variable 
$InstanceListFromCMS = dir $CMSGroup -recurse &#124; where-object { $_.Mode.Equals(&quot;-&quot;) } &#124; select-object Name -Unique



foreach ($InstanceName in $InstanceListFromCMS) 
{
	$InstanceNameJustName = (Encode-SqlName $InstanceName.Name) 
	[System.Reflection.Assembly]::LoadWithPartialName(’Microsoft.SqlServer.SMO’) &#124; out-null
	$s = New-Object (’Microsoft.SqlServer.Management.Smo.Server’) $InstanceNameJustName 
	$s.JobServer.Jobs &#124; Where-Object{$_.IsEnabled -eq $true -and $_.LastRunOutCome -eq “Failed”} &#124; SELECT PARENT, NAME, LASTRUNOUTCOME, LASTRUNDATE
}</description>
		<content:encoded><![CDATA[<p>#########################################################################################<br />
# Job_Failures Script – Used to report status of jobs<br />
#########################################################################################<br />
#Declare the Central Management Server<br />
$CMSGroup = &#8216;SQLSERVER:\SQLRegistration\Central Management Server Group\MyCMSSQLServer\MyCMSGroup\&#8217;</p>
<p>#Read the servers list into a variable<br />
$InstanceListFromCMS = dir $CMSGroup -recurse | where-object { $_.Mode.Equals(&#8220;-&#8221;) } | select-object Name -Unique</p>
<p>foreach ($InstanceName in $InstanceListFromCMS)<br />
{<br />
	$InstanceNameJustName = (Encode-SqlName $InstanceName.Name)<br />
	[System.Reflection.Assembly]::LoadWithPartialName(’Microsoft.SqlServer.SMO’) | out-null<br />
	$s = New-Object (’Microsoft.SqlServer.Management.Smo.Server’) $InstanceNameJustName<br />
	$s.JobServer.Jobs | Where-Object{$_.IsEnabled -eq $true -and $_.LastRunOutCome -eq “Failed”} | SELECT PARENT, NAME, LASTRUNOUTCOME, LASTRUNDATE<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Stasiuk</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4496</link>
		<dc:creator>Colin Stasiuk</dc:creator>
		<pubDate>Thu, 19 Nov 2009 14:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4496</guid>
		<description>SQL Crotch this is fantastical... I&#039;m going to tweak it to link to a SQL 2008 Central Management server and get it&#039;s server list from there... but all in all this is looking like a SQL Bacon Nugget of Excellence award in the making

Nice work sir... very nice work!</description>
		<content:encoded><![CDATA[<p>SQL Crotch this is fantastical&#8230; I&#8217;m going to tweak it to link to a SQL 2008 Central Management server and get it&#8217;s server list from there&#8230; but all in all this is looking like a SQL Bacon Nugget of Excellence award in the making</p>
<p>Nice work sir&#8230; very nice work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @SQLCrotch</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4491</link>
		<dc:creator>@SQLCrotch</dc:creator>
		<pubDate>Tue, 17 Nov 2009 22:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4491</guid>
		<description>One thing too, to filter out to see only the faleid, replace this line (16) 
		$s.JobServer.Jobs &#124; Where-Object{$_.IsEnabled -eq $true -and $_.LastRunOutCome -ne &quot;Succeeded&quot;} &#124; SELECT NAME, LASTRUNOUTCOME, LASTRUNDATE 

To get a an idea of what objects are available, try puting a SELECT * where SELECT NAME, LAST... etc that&#039;s where those objects are coming from</description>
		<content:encoded><![CDATA[<p>One thing too, to filter out to see only the faleid, replace this line (16)<br />
		$s.JobServer.Jobs | Where-Object{$_.IsEnabled -eq $true -and $_.LastRunOutCome -ne &#8220;Succeeded&#8221;} | SELECT NAME, LASTRUNOUTCOME, LASTRUNDATE </p>
<p>To get a an idea of what objects are available, try puting a SELECT * where SELECT NAME, LAST&#8230; etc that&#8217;s where those objects are coming from</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @SQLCrotch</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4490</link>
		<dc:creator>@SQLCrotch</dc:creator>
		<pubDate>Tue, 17 Nov 2009 22:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4490</guid>
		<description>Hey buddy, give this a shot! Not sure about the 2000 requirement, not sure if SMO was there yet.


Copy/Paste to a .ps1
#########################################################################################
# Job_Failures Script - Used to report status of jobs
#########################################################################################
# - Variables
$instance = &quot;sqldev&quot;
##** Uncomment to Loop through text file ** 
##	Parse the Servers.txt file (SQL1, SQL2, SQL3) One per line
##	foreach ($instance in get-content &quot;\\slc-fs01\users\jcrosby\Servers.txt&quot;)
##	{
#########################################################################################
#This script gets SQL Server database information using PowerShell
	[System.Reflection.Assembly]::LoadWithPartialName(&#039;Microsoft.SqlServer.SMO&#039;) &#124; out-null
	
	# Create an SMO connection to the instance
	$s = New-Object (&#039;Microsoft.SqlServer.Management.Smo.Server&#039;) $instance
		$s.JobServer.Jobs &#124; Where-Object{$_.IsEnabled -eq $true} &#124; SELECT NAME, LASTRUNOUTCOME, LASTRUNDATE
	
## }</description>
		<content:encoded><![CDATA[<p>Hey buddy, give this a shot! Not sure about the 2000 requirement, not sure if SMO was there yet.</p>
<p>Copy/Paste to a .ps1<br />
#########################################################################################<br />
# Job_Failures Script &#8211; Used to report status of jobs<br />
#########################################################################################<br />
# &#8211; Variables<br />
$instance = &#8220;sqldev&#8221;<br />
##** Uncomment to Loop through text file **<br />
##	Parse the Servers.txt file (SQL1, SQL2, SQL3) One per line<br />
##	foreach ($instance in get-content &#8220;\\slc-fs01\users\jcrosby\Servers.txt&#8221;)<br />
##	{<br />
#########################################################################################<br />
#This script gets SQL Server database information using PowerShell<br />
	[System.Reflection.Assembly]::LoadWithPartialName(&#8216;Microsoft.SqlServer.SMO&#8217;) | out-null</p>
<p>	# Create an SMO connection to the instance<br />
	$s = New-Object (&#8216;Microsoft.SqlServer.Management.Smo.Server&#8217;) $instance<br />
		$s.JobServer.Jobs | Where-Object{$_.IsEnabled -eq $true} | SELECT NAME, LASTRUNOUTCOME, LASTRUNDATE</p>
<p>## }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Stasiuk</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4487</link>
		<dc:creator>Colin Stasiuk</dc:creator>
		<pubDate>Tue, 17 Nov 2009 20:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4487</guid>
		<description>I can&#039;t use that cause it&#039;s a SQL 2005+ stored procedure and I still have SQL 2000 in my environment.

sp_help_jobactivity does look cleaner then sp_help_job and I don&#039;t think I&#039;d get the same:

Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 67
An INSERT EXEC statement cannot be nested.


error from the looks of the source code behind sp_help_jobactivity... but the whole SQL 2000 thing kills this idea :(


Thanks though!</description>
		<content:encoded><![CDATA[<p>I can&#8217;t use that cause it&#8217;s a SQL 2005+ stored procedure and I still have SQL 2000 in my environment.</p>
<p>sp_help_jobactivity does look cleaner then sp_help_job and I don&#8217;t think I&#8217;d get the same:</p>
<p>Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 67<br />
An INSERT EXEC statement cannot be nested.</p>
<p>error from the looks of the source code behind sp_help_jobactivity&#8230; but the whole SQL 2000 thing kills this idea <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Thanks though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLRockstar</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4486</link>
		<dc:creator>SQLRockstar</dc:creator>
		<pubDate>Tue, 17 Nov 2009 19:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4486</guid>
		<description>did you try msdb..sp_help_jobactivity?</description>
		<content:encoded><![CDATA[<p>did you try msdb..sp_help_jobactivity?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @SQLCrotch</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/comment-page-1/#comment-4485</link>
		<dc:creator>@SQLCrotch</dc:creator>
		<pubDate>Tue, 17 Nov 2009 19:45:53 +0000</pubDate>
		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255#comment-4485</guid>
		<description>I may have something for ya buddy, I&#039;ll send it your way if it fits the bill :)</description>
		<content:encoded><![CDATA[<p>I may have something for ya buddy, I&#8217;ll send it your way if it fits the bill <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

