 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Multifunctioning DBA &#187; Audit</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/dba/tag/audit/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/dba</link>
	<description></description>
	<lastBuildDate>Wed, 06 Feb 2013 01:01:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Auditor Nightmare</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/auditor-nightmare/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/auditor-nightmare/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 21:00:44 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Audit]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/auditor-nightmare/</guid>
		<description><![CDATA[My company has an audit coming up and I saw this post and thought I should take a look since we are getting ready for our audit. So take a look and let me know what you think about this. /* Style Definitions */ table.MsoNormalTable {mso-style-name:&#8221;Table Normal&#8221;; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:&#8221;"; mso-padding-alt:0in 5.4pt [...]]]></description>
				<content:encoded><![CDATA[<p>My company has an audit coming up and I saw this post and thought I should take a look since we are getting ready for our audit. So take a look and let me know what you think about this.</p>
<p><!--[if gte mso 9]&gt;  Normal 0     false false false  EN-US X-NONE X-NONE              MicrosoftInternetExplorer4              &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!--[if gte mso 10]&gt;--><br />
 /* Style Definitions */<br />
 table.MsoNormalTable<br />
	{mso-style-name:&#8221;Table Normal&#8221;;<br />
	mso-tstyle-rowband-size:0;<br />
	mso-tstyle-colband-size:0;<br />
	mso-style-noshow:yes;<br />
	mso-style-priority:99;<br />
	mso-style-qformat:yes;<br />
	mso-style-parent:&#8221;";<br />
	mso-padding-alt:0in 5.4pt 0in 5.4pt;<br />
	mso-para-margin:0in;<br />
	mso-para-margin-bottom:.0001pt;<br />
	mso-pagination:widow-orphan;<br />
	font-size:11.0pt;<br />
	font-family:&#8221;Calibri&#8221;,&#8221;sans-serif&#8221;;<br />
	mso-ascii-font-family:Calibri;<br />
	mso-ascii-theme-font:minor-latin;<br />
	mso-fareast-font-family:&#8221;Times New Roman&#8221;;<br />
	mso-fareast-theme-font:minor-fareast;<br />
	mso-hansi-font-family:Calibri;<br />
	mso-hansi-theme-font:minor-latin;<br />
	mso-bidi-font-family:&#8221;Times New Roman&#8221;;<br />
	mso-bidi-theme-font:minor-bidi;}</p>
<p class="MsoNormal"><a href="http://serverfault.com/questions/293217/our-security-auditor-is-an-idiot-how-do-i-give-him-the-information-he-wants">http://serverfault.com/questions/293217/our-security-auditor-is-an-idiot-how-do-i-give-him-the-information-he-wants</a></p>
<p class="MsoNormal">
<p class="MsoNormal">My thoughts are that one of two things are going on here.</p>
<p class="MsoNormal">1. The poster just wanted to get a rise out of the community and if that is true he did it!!</p>
<p class="MsoNormal">or</p>
<p class="MsoNormal">2. The person that is the rep is really a hacker that somehow found out all the information about the audit and decided to represent the company and attempt to get some information. So be vigilant and aware and look for the red flags.</p>
<p class="MsoNormal">
<p class="MsoNormal">
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/auditor-nightmare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Triggers for protection</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/triggers-for-protection/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/triggers-for-protection/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 21:21:19 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Audit]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[MS SQL Admin]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/triggers-for-protection/</guid>
		<description><![CDATA[I have recently had to find a way to prevent someone that has elevated privileges from removing logins, databases, as well as keep them from adding new databases to my production systems. I was amazed at how easy this was to do thanks to event level ddl triggers. I created a table in master called [...]]]></description>
				<content:encoded><![CDATA[<p>I have recently had to find a way to prevent someone that has elevated privileges from removing logins, databases, as well as keep them from adding new databases to my production systems. I was amazed at how easy this was to do thanks to event level ddl triggers. I created a table in master called ddlaudit. The format is below:</p>
<div><span style="color: #000000;font-family: Tahoma;font-style: normal;font-variant: normal;font-weight: normal;font-size: medium"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">create</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">table</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">DDLAUDIT</span></span></span></div>
<div><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">PostTime</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">datetime</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span></div>
<div><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">DatabaseName</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">varchar</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">100</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></div>
<div><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Event</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">nvarchar</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">100</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></div>
<div><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">ObjectName</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">varchar</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">256</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></div>
<div><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">TSQL</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">nvarchar</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">2000</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></div>
<div><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Login</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">varchar</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">100</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">))</span></span></div>
<div></div>
<div>Now that I have a table to push data into I just needed to create the triggers. Below is one of them but I did create all three.</div>
<div></div>
<div>
<div><span style="color: #000000;font-family: Tahoma;font-style: normal;font-variant: normal;font-weight: normal;font-size: medium"><span style="font-family: Courier New;font-size: x-small"><span style="font-size: 10pt"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Create</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Trigger</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">AUDIT_Drop_Login</span></span></span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">On</span></span><span> </span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">all</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">server</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">for</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">drop_login</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">as</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Declare</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">@audit</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">XML</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">DECLARE</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">@ed</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">XML</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">SET</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">@ed</span></span><span> </span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">=</span></span><span> </span><span style="font-family: Courier New;color: #ff00ff;font-size: x-small"><span style="font-size: 10pt">EVENTDATA</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">()</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Print</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;You are not allowed to drop logins from this instance of SQL Server. Please contact the DBA&#8217;</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">rollback</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt"><br />
</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">INSERT</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">INTO</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">DDLAudit</span></span><span> </span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">PostTime</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">DatabaseName</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Event</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">ObjectName</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">TSQL</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">Login</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">)</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">VALUES</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> </span></span><span style="font-family: Courier New;color: #ff00ff;font-size: x-small"><span style="font-size: 10pt">GetDate</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(),</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> @ed</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">.</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">value</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;(/EVENT_INSTANCE/DatabaseName)[1]&#8216;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;varchar(256)&#8217;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> @ed</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">.</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">value</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;(/EVENT_INSTANCE/EventType)[1]&#8216;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;nvarchar(100)&#8217;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> @ed</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">.</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">value</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;(/EVENT_INSTANCE/ObjectName)[1]&#8216;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;varchar(256)&#8217;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> @ed</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">.</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">value</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;(/EVENT_INSTANCE/TSQLCommand)[1]&#8216;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;nvarchar(2000)&#8217;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">),</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"> @ed</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">.</span></span><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt">value</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">(</span></span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;(/EVENT_INSTANCE/LoginName)[1]&#8216;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">,</span></span><span> </span><span style="font-family: Courier New;color: #ff0000;font-size: x-small"><span style="font-size: 10pt">&#8216;varchar(256)&#8217;</span></span><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">)</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #808080;font-size: x-small"><span style="font-size: 10pt">)</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #010101;font-size: x-small"><span style="font-size: 10pt"><br />
</span></span></span></div>
<div><span style="font-family: Courier New;font-size: x-small"><span style="font-family: Courier New;color: #0000ff;font-size: x-small"><span style="font-size: 10pt">go</span></span></span></div>
</div>
<div></div>
<div></div>
<div>Now that I have them create no one, not even me, can perform these actions. And when someone does attempt one of the actions you will have an audit trail of who did what and when they did it. Now if you want to be able to drop a login after this is in place you will need to disable or drop the trigger. You can find the trigger by running the following query.</div>
<div></div>
<div>select * from sys.server_triggers</div>
<div></div>
<div>Disable trigger trigger_name</div>
<div>on all server</div>
<div></div>
<div>Enable trigger_name</div>
<div>on all server</div>
<div></div>
<div>That way you, as the DBA, can make the changes you need to make.</div>
<div></div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/triggers-for-protection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IT Audit</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/it-audit/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/it-audit/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 20:36:43 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Audit]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Roles]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/it-audit/</guid>
		<description><![CDATA[Recently my company went through an internal audit of our financial systems. First let me say that I am proud because we did well and do not have many issues to resolve, and no issues on the Database Side. Any way I also want to point out that the auditors are not IT people. They [...]]]></description>
				<content:encoded><![CDATA[<p>Recently my company went through an internal audit of our financial systems. First let me say that I am proud because we did well and do not have many issues to resolve, and no issues on the Database Side. Any way I also want to point out that the auditors are not IT people. They are accountants and they have no idea what they are asking for from us or what we give them. An example of this is that I was working in Powershell when the auditor came over to me and asked for a screenshot of all sysadmin role users on a particular server. I pulled it up in powershell and printed it out. No he said this is no good. I need the SQL Server screen that will tell me. OK I say and I go into SSMS and pull it up and print it out for him. To me this said that he does not know what he is looking at and I could, not that I ever would, give him the same screenshot from last year and he would not know.  For the remaining time that he was around I tried to point out what was what and help him learn abit about what he was asking for. Hope that will help in in future audits.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/it-audit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell Sysadmin Role Audit Script</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/powershell-sysadmin-role-audit-script/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/powershell-sysadmin-role-audit-script/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:00:51 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Audit]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Seperation of Roles]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/powershell-sysadmin-role-audit-script/</guid>
		<description><![CDATA[I am working on a Powershell script that will audit my SQL Servers Logins and tell me who is a member of the sysadmin role. I think that this is a good idea for any DBA. I know that I do not want to have very many people with this type of access to data [...]]]></description>
				<content:encoded><![CDATA[<p>I am working on a Powershell script that will audit my SQL Servers Logins and tell me who is a member of the sysadmin role. I think that this is a good idea for any DBA. I know that I do not want to have very many people with this type of access to data that I am in charge of protecting. This script will enumerate a list of users and groups with sysadmin role and then for each group it will list the members of the group. I am doing this because the Local Admin group has the sysadmin role on all of my servers. I have a vested interest in knowing who is a part of that group. I have already found some dev application service accounts that are a member of the local admin group on one of my servers. I do not like this and I do not like applications that require it. If an application does require sysadmin role then I am a big fan of giving that appllication its own instance of SQL Server.</p>
<p>Another reason that I am doing this is to show how many people have access that they do not need. I will use this as ammunition to remove the local admin group from the sysadmin role. I would like to have very tight control over that role and not turn over the keys to the SQL kingdom to anyone or anything that I do not deem worthy of it.  Now that is not to say that I think that the people in that group are not technically sound, I just do not want more hands in the cookie jar than are necessary.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/powershell-sysadmin-role-audit-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Health Check into SQL Server</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/health-check-into-sql-server/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/health-check-into-sql-server/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 13:12:48 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[Audit]]></category>
		<category><![CDATA[Baselining]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MSSQL Administration]]></category>
		<category><![CDATA[Trending]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/health-check-into-sql-server/</guid>
		<description><![CDATA[I have recently posted about my new job and how I am walking into the unknown. Like I have said in the past, I did get a list of Host Names that are running SQL Server. I have written a script to go out and look at each of those hosts and get me all [...]]]></description>
				<content:encoded><![CDATA[<p>I have recently posted about my new job and how I am walking into the unknown. Like I have said in the past, I did get a list of Host Names that are running SQL Server. I have written a script to go out and look at each of those hosts and get me all instances. I have put together a list of about 150 SQL Servers that are running but I still no very little about. I have also posted about a Powershell script that I have written that goes out and gathers information about the SQL Server instances in question. I ran this and I was shocked. After glancing at the output I see things that just should not be. I see many DB&#8217;s that have logs larger than the Database. I see many that are running from the system drive, I see some that are far behind on patching, I even see one with only system databases on it. Like I said I have about 150 identified running instances and just over 1000 databases. You read that correctly over 1000. I just really do not even know where to start.</p>
<p>Because I have so many servers and so many databases, I thought that a simple Excel Spreadsheet is just not going to do it for me this time. I need more than just a simple report. I want to put all this data in a database so that I can slice and dice the data more easily, when I finally figure out how to prioritize what needs to be done. So here is what I have so far. I will use the same Powershell script to go get all the data that I am after and then I will have it insert the data into the database. This is just the beginning for this database as I have some bigger plans brewing in my head now. For now though, I just need something quick and basic to get the data into so I can prioritize and identify the largest problem areas.</p>
<p>I have two tables consisting of the following:</p>
<table style="width: 235pt" border="0" cellspacing="0" cellpadding="0" width="313">
<col style="width: 114pt" span="1" width="152"></col>
<col style="width: 121pt" span="1" width="161"></col>
<tbody>
<tr style="height: 16.5pt">
<td class="xl69" style="width: 114pt;height: 16.5pt" width="152" height="22"><span style="font-size: small;font-family: Calibri">Instance Table</span></td>
<td class="xl70" style="width: 121pt" width="161"><span style="font-size: small;font-family: Calibri">Database Table</span></td>
</tr>
<tr style="height: 15.75pt">
<td class="xl67" style="height: 15.75pt" height="21"><span style="font-size: small;font-family: Calibri">ID<span>          </span>PK</span></td>
<td class="xl68"><span style="font-size: small;font-family: Calibri">I_ID<span>               </span>FK to I.ID</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri">Host_Name</span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">DB_Name</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri">Instance_Name</span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Recovery_Model</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri">SQL_Version</span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Data_Disk</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri">SQL_SP</span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Log_Disk</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri">OS_Version</span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Database _Size</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri"> </span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Log_Size</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri"> </span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Type (Test or Prod)</span></td>
</tr>
<tr style="height: 15pt">
<td class="xl63" style="height: 15pt" height="20"><span style="font-size: small;font-family: Calibri"> </span></td>
<td class="xl64"><span style="font-size: small;font-family: Calibri">Dbspace_Available</span></td>
</tr>
<tr style="height: 15.75pt">
<td class="xl65" style="height: 15.75pt" height="21"><span style="font-size: small;font-family: Calibri"> </span></td>
<td class="xl66"><span style="font-size: small;font-family: Calibri">Logspace_Available</span></td>
</tr>
</tbody>
</table>
<p>I think that this will give me the ability to look at the basics and identify major problems. As I get things taken care of I will then start to add more to this Database so that I can do some more tunning, baselining, trending, and so forth.</p>
<p> </p>
<p>Got any thoughts on what I should add to this initially. I am all ears.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/health-check-into-sql-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AD Audit in Powershell</title>
		<link>http://itknowledgeexchange.techtarget.com/dba/ad-audit-in-powershell/</link>
		<comments>http://itknowledgeexchange.techtarget.com/dba/ad-audit-in-powershell/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:37:58 +0000</pubDate>
		<dc:creator>Colin Smith</dc:creator>
				<category><![CDATA[AD]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Audit]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/dba/ad-audit-in-powershell/</guid>
		<description><![CDATA[I have mentioned this before but I have finally done what I set out to do and re-wrote my old vbscript that audits AD Accounts based on Create Date and Last LogonDate in Powershell. This is another great example of how much better powershell is and why everyone should now it. My VB Script was [...]]]></description>
				<content:encoded><![CDATA[<p>I have mentioned this before but I have finally done what I set out to do and re-wrote my old vbscript that audits AD Accounts based on Create Date and Last LogonDate in Powershell. This is another great example of how much better powershell is and why everyone should now it. My VB Script was just under 800 lines of code and that was without many comments that documented the process. Now I feel that documenting scripts is very important. This is because I have had to try to fix other peoples scripts when they did not document it well and it is not fun. My powershell version of the same script with added functionality as well as over 100 lines of comments is only just over 400 lines. That means that I was able to remove about 500 lines of actual code from the script as well as add functionality to the script.<br />
I will break the script down and post each one of the functions with a good explanation of each in my next few posts. It is a very cool script and it could be added to and customized to fit any situation that you may need. My version is based on my companies policy of disabling an account after 90 days of inactivity and deleting the account after 180 days of inactivity. My company runs the script weekly and the script sends out emails about the accounts that have been disabled and deleted to the needed personal so that the appropriate paperwork can be completed for those accounts. The script is soon to be posted. I am still testing but I will have it very soon.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/dba/ad-audit-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
