<?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>tinyint.com &#187; tcnolan</title>
	<atom:link href="http://www.tinyint.com/index.php/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tinyint.com</link>
	<description>An engineering and development &#60;em&#62;Factory of Knowledge&#60;/em&#62;™</description>
	<lastBuildDate>Mon, 09 Aug 2010 19:41:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CA certificate expiration monitoring</title>
		<link>http://www.tinyint.com/index.php/2010/08/09/ca-certificate-expiration-monitoring/</link>
		<comments>http://www.tinyint.com/index.php/2010/08/09/ca-certificate-expiration-monitoring/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 17:19:17 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[certificate services]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=181</guid>
		<description><![CDATA[A reader sent me a message asking how to modify the original CA monitoring script I wrote back in November so that instead of monitoring the pending requests, it would send a message based on expiring certificates. The answer is just a modification to the certutil command that was used in the original script.  The new [...]]]></description>
			<content:encoded><![CDATA[<p>A reader sent me a message asking how to modify the <a href="http://www.tinyint.com/index.php/2009/11/24/certificate-authority-request-monitoring-with-powershell/">original CA monitoring script</a> I wrote back in November so that instead of monitoring the pending requests, it would send a message based on expiring certificates.  The answer is just a modification to the certutil command that was used in the original script.  The new script also allows you to specify the number of days advanced notification you are looking for, the default is 30 days.  Just keep in mind that if you run this script once a day, you will receive a notification every day until the certificate is either revoked/superseded or the certificate is passed the time period specified.  Of course this is all irrelevant if you have the money to spend on <a href="http://www.microsoft.com/systemcenter/en/us/operations-manager.aspx">SCOM</a> which can do this with one of the released <a href="http://www.microsoft.com/downloads/details.aspx?familyid=15edbfeb-0b7d-4baf-a7bd-6bb84a6b822d&amp;displaylang=en&amp;tm">management packs</a>.</p>
<p>The modified <a href="http://technet.microsoft.com/en-us/library/cc732443%28WS.10%29.aspx">certutil</a> command looks a bit like this:</p>
<pre class="brush: plain;">certutil -view -restrict &quot;NotAfter&gt;=8/9/2010,NotAfter&lt;=9/9/2010&quot; -out &quot;Request ID, Request Submission Date, Request Common Name, Requester Name, Request Email Address, Request Distinguished Name, CertificateTemplate, NotAfter&quot; -config &quot;&lt;CA_SERVER_NAME&gt;\&lt;CA_NAME&gt;&quot;</pre>
<p>This will return to you all of the certificates that are scheduled to expire between today (August 9th, 2010) and 30 days from now (September 9th, 2010)</p>
<p>You can download the new script here: <a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=5">monitor_ca_expiry.ps1</a></p>
<p><strong>Update</strong>: Thanks to Aaron (from New Mexico? the original reader) who noticed I forgot one really useful bit of information from the status report that displays when you run the command: the date of expiration for the certificate.  I have updated the script and the sample above to reflect the change.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2010%2F08%2F09%2Fca-certificate-expiration-monitoring%2F&amp;linkname=CA%20certificate%20expiration%20monitoring"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2010/08/09/ca-certificate-expiration-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certificate Authority Request Monitoring with Powershell</title>
		<link>http://www.tinyint.com/index.php/2009/11/24/certificate-authority-request-monitoring-with-powershell/</link>
		<comments>http://www.tinyint.com/index.php/2009/11/24/certificate-authority-request-monitoring-with-powershell/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 23:26:46 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[certificate services]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=166</guid>
		<description><![CDATA[Rolling out a certificate authority in Windows 2003 and Windows 2008 is a relatively trivial task if you are deploying a stand-alone CA, Enterprise CA’s are a bit more complex, but that&#8217;s a post for another day. The web interface (http://server.domain.local/certsrv/) is pretty limited and doesn’t provide the greatest interface for manually requesting certificates, it [...]]]></description>
			<content:encoded><![CDATA[<p>Rolling out a certificate authority in Windows 2003 and Windows 2008 is a relatively trivial task if you are deploying a stand-alone CA, Enterprise CA’s are a bit more complex, but that&#8217;s a post for another day.  The web interface (http://server.domain.local/certsrv/) is pretty limited and doesn’t provide the greatest interface for manually requesting certificates, it even relies on cookies for managing requests.  It would be really nice to see Microsoft build this into a truly useful application like what you get with the <a href="https://ssl-certificate-center.thawte.com/process/retail/console_login?application_locale=THAWTE_US">Thawte Certificate Center</a>.</p>
<p>One thing that is a bit frustrating is that even when you have the logging options fully enabled for the CA, events aren’t logged for new certificate requests so you have to manually check the server on a regular basis for outstanding requests.  Usually this is a low priority kind of service in your enterprise and can get neglected, which has happened in my case a few times.</p>
<p>This neglect prompted me to write the following Powershell script which very simply uses <a href="http://technet.microsoft.com/en-us/library/cc732443%28WS.10%29.aspx">certutil</a> to check if there are any pending requests, and then fire off an email to a list of users if there are.  This script could also be easily modified to check for revoked certificates or to generate a weekly report on existing certificates to monitor expiration dates, among a bunch of other things, however I really only needed this for requests so that&#8217;s all it does for right now.  If anyone has any interest in something else, let me know and I’ll see about updating the script to include additional features.</p>
<p>To use this script, all you need to do is ensure you have a copy of certutil on the machine running this, update the configurable pieces of the script, then create a scheduled task to run it every hour or so, or whatever time-frame is appropriate for you and your organization.</p>
<p>More information and a download link is after the break&#8230;<br />
<span id="more-166"></span></p>
<p>The script uses a very simple function of certutil to check for pending requests.  You can execute the following code from a command prompt or powershell prompt to see a list of existing pending requests.</p>
<pre class="brush: plain;">

certutil -view -out &quot;Request ID, Request Submission Date, Request Common Name, Requester Name, Request Email Address, Request Distinguished Name, CertificateTemplate, Request Disposition&quot; -Restrict &quot;Request Disposition=9&quot; -config &quot;&lt;CA_SERVER_NAME&gt;\&lt;CA_NAME&gt;&quot;
</pre>
<p>Basically what this is doing is it is telling certutil to check for any certificates where the request dispoition is 9, in other words, any pending certificate requests.  It then outputs a few usefull properties related to the certificates.  All you need to change is the part with &#8220;\&#8221; to include the valid server and name.</p>
<p><strong>Note: </strong>You can omit the entire &#8220;-config &#8220;&lt;CA_SERVER_NAME&gt;\&lt;CA_NAME&gt;&#8221;" piece if you are running this locally from the CA server and only want to retrieve the local information.</p>
<p><strong>For the full powershell script, click the download link here:</strong> <a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=4">monitor_ca_requests.ps1</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F11%2F24%2Fcertificate-authority-request-monitoring-with-powershell%2F&amp;linkname=Certificate%20Authority%20Request%20Monitoring%20with%20Powershell"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/11/24/certificate-authority-request-monitoring-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vSphere Client on Windows 7</title>
		<link>http://www.tinyint.com/index.php/2009/09/04/vsphere-client-on-windows-7/</link>
		<comments>http://www.tinyint.com/index.php/2009/09/04/vsphere-client-on-windows-7/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:27:47 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[vsphere]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=122</guid>
		<description><![CDATA[Update 2010-03-03: Keep in mind that this was fixed in vSphere 4 Update 1. Although if you can&#8217;t move to Update 1 for some reason, this will still work. Update 2009-09-08: I just updated the script because I received a report from wohali (Joan) over at VMware communities that they had a problem when the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Update 2010-03-03: Keep in mind that this was fixed in vSphere 4 Update 1.  Although if you can&#8217;t move to Update 1 for some reason, this will still work.</p></blockquote>
<blockquote><p>Update 2009-09-08: I just updated the script because I received a report from wohali (Joan) over at VMware communities that they had a problem when the vSphere client was installed on a different drive and I have now fixed that problem.  I also added in support for making the host update utility work as well.  Lastly, I added a few output messages so you can see what&#8217;s going on and know what is getting done.</p></blockquote>
<p>The past few months I have been enjoying <a href="http://www.microsoft.com/windows/windows-7/">Windows 7</a> quite a bit (both the RC and now the RTM), but at the office we use VMware for many of our clients and the vSphere Client unfortunately has an issue with Windows 7 due to an incompatibility with a .Net 2.0 library dll that comes installed on Windows 7.  When you install the vSphere client, you will be able to get through the install without an issue usually (If you have <a href="http://communities.vmware.com/thread/211494">J# already installed</a> you may encounter issues installing the vSphere client), but once you try to connect to your vSphere server you get an error stating “Error parsing &lt;server&gt; clients.xml file  Login will continue contact your system administrator” followed immediately by another error “The type initializer for &#8220;VirtualInfrastrcture.Utils.HttpWebRequestProxy&#8221; threw an exception” which then brings you back to the login screen and you are unable to connect in.</p>
<p>There’s big <a href="http://communities.vmware.com/thread/211440">thread</a> over at VMware Communities that discusses this problem and ways to fix it.  Unfortunately, it’s a manual process and deploying this out to all of our Windows 7 employee workstations is a bit of a hassle, so I have created a Powershell script that will do the necessary work for you, and create a shortcut on your desktop as well.</p>
<p>By default, powershell security options may prevent you from executing the script, so you may have to change a setting temporarily to get it to work.  If you type “<a href="http://technet.microsoft.com/en-us/library/dd347644.aspx">Get-ExecutionPolicy</a>” from a powershell window you will most likely see “Restricted” but there are a few others as well which will all prevent you from executing the script.  You can read more about this over at dotnetvj.com where he goes into a little more detail about these execution policies and what they mean.  All you need to do though is type “<a href="http://technet.microsoft.com/en-us/library/dd347628.aspx">Set-ExecutionPolicy</a> Unrestricted”  Just remember that you should probably set the execution policy back to its previous value after you run the script for security purposes.  Lastly, you will also need to run powershell as an administrator if you have UAC turned on because this script has to add files to the installation folder of your vSphere client.</p>
<div id="attachment_124" class="wp-caption alignnone" style="width: 421px"><a href="http://www.tinyint.com/wp-content/uploads/2009/09/launch-powershell.png"><img class="size-full wp-image-124" title="Launch Powershell as Administrator" src="http://www.tinyint.com/wp-content/uploads/2009/09/launch-powershell.png" alt="Launch Powershell as Administrator" width="411" height="599" /></a><p class="wp-caption-text">Launch Powershell as Administrator</p></div>
<p>Once you have powershell running as an administrator and change the execution policy, it is a simple process to run this script, simply CD to the folder that you have extracted the script, and run it by typing “.Windows7vSphere.ps1” and it will do the work of copying over the System.dll and creating the necessary files to launch vSphere client in development mode so it can use the System.dll.</p>
<div id="attachment_125" class="wp-caption alignnone" style="width: 543px"><a href="http://www.tinyint.com/wp-content/uploads/2009/09/powershell-commands.png"><img class="size-full wp-image-125" title="Execute Windows7vSphere.ps1" src="http://www.tinyint.com/wp-content/uploads/2009/09/powershell-commands.png" alt="Execute Windows7vSphere.ps1" width="533" height="438" /></a><p class="wp-caption-text">Change execution policy and execute Windows7vSphere.ps1</p></div>
<p>You should now have an icon on your desktop called “VMware vSphere Client (Windows 7)” which you then simply run as administrator to launch the vSphere client.  The reason you have to launch it as administrator is because it creates an environment variable that lets the vSphere client know that you are giving it a different System.dll to work with.  This is something also discussed in detail in the thread over at VMware Communities.</p>
<p>For anyone interested in powershell, this script also shows a few cool things such as reading from the <a href="http://technet.microsoft.com/en-us/library/dd315408.aspx">registry</a>, writing to an <a href="http://msdn.microsoft.com/en-us/library/system.xml%28VS.85%29.aspx">xml</a> document, as well as creating a windows <a href="http://msdn.microsoft.com/en-us/library/xsy6k3ys%28VS.85%29.aspx">shortcut</a> using pretty simple commands.</p>
<p>Hopefully this will help a few people streamline the process of getting the vSphere client installed on your Windows 7 machines.  If you notice any problems with the script, feel free to comment and let me know and I&#8217;ll try to fix it as soon as possible.</p>
<p><strong>Download the script and the dll needed here:</strong> <a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=1">Windows7vSphere.zip</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F09%2F04%2Fvsphere-client-on-windows-7%2F&amp;linkname=vSphere%20Client%20on%20Windows%207"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/09/04/vsphere-client-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>401 Error on HttpWebRequest with NTLM Authentication</title>
		<link>http://www.tinyint.com/index.php/2009/08/24/401-error-on-httpwebrequest-with-ntlm-authentication/</link>
		<comments>http://www.tinyint.com/index.php/2009/08/24/401-error-on-httpwebrequest-with-ntlm-authentication/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 00:05:44 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[401 error]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[ntlm]]></category>
		<category><![CDATA[webrequest]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=109</guid>
		<description><![CDATA[Due to a security update to SMB that fixes a remote code execution vulnerability, you may experience 401.1 or 401.2 errors in certain situations while performing a WebRequest to one of your servers. This is because part of the security update institutes a loopback check on the authentication requests to prevent replay attacks. The Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>Due to a <a href="http://support.microsoft.com/kb/957097">security update</a> to SMB that fixes a remote code execution vulnerability, you may experience 401.1 or 401.2 errors in certain situations while performing a WebRequest to one of your servers.  This is because part of the security update institutes a loopback check on the authentication requests to prevent replay attacks.  The Microsoft KB article refers to a few different scenarios where you can see authentication problems after applying this patch, but the one I’m most interested in is when you start getting 401 errors after an HttpWebRequest on an ASP.Net page.</p>
<p>The issues I experienced were while creating a page to display general status of one of my companies Sharepoint servers.  The main issue which is the meat of this article was when I switched the authentication over to use NTLM instead of Digest, which broke my script.  Everything I had in place should have worked, but the previously mentioned security update slipped under the radar and it took a while to figure out what was going on.  You can do a basic web request on a server with Basic authentication by doing the following:</p>
<pre class="brush: vb;">Dim _response As String
Dim _auth As String = &quot;Basic&quot;
Dim _uri As Uri = New Uri(&quot;http://my.domain.local/my-page.aspx&quot;)
Dim _req As HttpWebRequest = WebRequest.Create(_uri)
Dim _cc As CredentialCache = New CredentialCache()
Dim _res As HttpWebResponse
Dim _sr As StreamReader

_cc.Add(_uri, _auth, New NetworkCredential(&quot;username&quot;, &quot;password&quot;, &quot;domain&quot;))
_req.PreAuthenticate = True
_req.Credentials = _cc.GetCredential(_uri, _auth)
_res = _req.GetResponse
_sr = New StreamReader(_res.GetResponseStream)
_response = _sr.ReadToEnd
_sr.Close()</pre>
<p>That code works perfectly well with Basic and even Digest(if you change the _auth value) authentication, however it will most likely not work for you if you are using NTLM authentication and your server has had the <a href="http://support.microsoft.com/kb/957097">MS08-068 patch</a> applied to it.  Prior to discovering the conflict with this patch I went through a lot of effort to investigate the issue.  One of the most useful debugging utilities in IIS7 is the failed request tracing logs.  These logs give you really great insight as to what is going on inside your web request traffic.  You can also use a tool like Fiddler to try and see what’s happening, but unfortunately because our Sharepoint server was live, it would have caused SSL certificate issues if I put it in the mix in my situation.</p>
<p>After looking at the failed request traces logs, I noticed an interesting difference between one of the failed requests from my health check script and a purposely failed request through a web browser that I pointed to a file I had no access to read.</p>
<p><strong>401.3 Error message &#8211; Unauthorized due to ACL on resource</strong></p>
<p><a href="http://www.tinyint.com/wp-content/uploads/2009/08/401_3.png"><img class="alignnone size-full wp-image-110 mceItem" title="401_3" src="http://www.tinyint.com/wp-content/uploads/2009/08/401_3.png" alt="401_3" width="579" height="427" /></a></p>
<p><strong>401.2 Error message &#8211; Logon failed due to server configuration</strong></p>
<p><a href="http://www.tinyint.com/wp-content/uploads/2009/08/401_2.png"><img class="alignnone size-full wp-image-111 mceItem" title="401_2" src="http://www.tinyint.com/wp-content/uploads/2009/08/401_2.png" alt="401_2" width="575" height="252" /></a></p>
<p><strong>Note: </strong>Check out <a href="http://support.microsoft.com/kb/943891">http://support.microsoft.com/kb/943891</a> for all the status codes in IIS7</p>
<p>The difference here is that on the WebRequest, it wasn’t even getting an NTLM token from the .Net app.  This lead me astray however and made me think that there was a problem with the pre-authentication of the credentials as well as whether I was missing something in the web.config, or even if it was some unique problem with Sharepoint.  After a lot of investigation I discovered the Microsoft KB article titled: “<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;896861">You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or IIS 6</a>”  After giving a thorough read of that document I realized the problem, Microsoft forgot to update the title of the KB article.  The sub status code I was getting on the 401 errors is different than Microsoft mentions in the article, and while they don’t mention IIS 7 in the article’s title, it does show up in the applies to section.</p>
<p>Since Microsoft recommends you leave the loopback check in place because it is part of the security update, I followed their recommended method of adding in a specified host name to the BackConnectionHostNames key in the registry.</p>
<p>As always, make registry modifications at your own risk, Microsoft always recommends you make a backup before making any modifications, check out the following KB article for backup instructions: <a href="http://support.microsoft.com/kb/322756">http://support.microsoft.com/kb/322756</a></p>
<blockquote><p><strong>Warning</strong> Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. TinyInt.Com cannot guarantee that these problems can be solved. Modify the registry at your own risk.</p></blockquote>
<blockquote><p>To specify the host names that are mapped to the loopback address and can connect to Web sites on your computer, follow these steps:</p>
<ol style="margin-top: 0in;" type="1">
<li>Click <strong>Start</strong>,      click <strong>Run</strong>, type regedit, and then click <strong>OK</strong>.</li>
<li>In Registry Editor,      locate and then click the following registry key:</li>
</ol>
<p style="padding-left: 60px;"><strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0</strong></p>
<ol style="margin-top: 0in;" type="1">
<li>Right-click <strong>MSV1_0</strong>,      point to <strong>New</strong>, and then click <strong>Multi-String Value</strong>.</li>
<li>Type      BackConnectionHostNames, and then press ENTER.</li>
<li>Right-click <strong>BackConnectionHostNames</strong>,      and then click <strong>Modify</strong>.</li>
<li>In the <strong>Value data</strong> box, type the host name or the host names for the sites that are on the      local computer, and then click <strong>OK</strong>.</li>
<li>Quit Registry Editor,      and then restart the IISAdmin service.</li>
</ol>
</blockquote>
<p>Now that you have taken care of editing the registry to include the hostname you are using in your code, you should be able to make your WebRequest over NTLM without a problem, just make sure you have impersonate=”true” in your web.config file.</p>
<p>Attached below is the code for the health check script that I have been talking about throughout this article.  As I mentioned earlier, it does some very basic checks on the server just to see if things are running smoothly.  To use it you would simply need to change the variables being passed into the various functions to check your database connectivity.  We use WhatsUp Gold to track the value of ALL_STATUS_OK to make sure things are working properly, and once one of the values fails it sends us an alert.  Another thing to keep in mind is if you are using the WebRequest piece in this code, make sure you grant the user you are authenticating as access to the Sharepoint page you are checking.  Lastly, if you use the code, make sure you read the comment in the web.config file about encrypting the settings so your password is not exposed, even if you are using a low privileged user account.</p>
<p>Download Source: <a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=2">sharepoint-contentscan.zip</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F08%2F24%2F401-error-on-httpwebrequest-with-ntlm-authentication%2F&amp;linkname=401%20Error%20on%20HttpWebRequest%20with%20NTLM%20Authentication"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/08/24/401-error-on-httpwebrequest-with-ntlm-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enumerate Distribution Groups Script Updated&#8230;</title>
		<link>http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/</link>
		<comments>http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 18:29:02 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[enumerate members]]></category>
		<category><![CDATA[get-distributiongroupmember]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=97</guid>
		<description><![CDATA[A reader sent in a question asking how to enumerate groups that have spaces in them and this lead me to realize I didn&#8217;t follow the specifications for valid distinguished names as well as I thought I had.  If you take a look at RFC 2253 and the Microsoft page that defines security group names, [...]]]></description>
			<content:encoded><![CDATA[<p>A reader sent in a question asking how to <a href="http://www.tinyint.com/index.php/2009/05/24/enumerate-distribution-group-members/" target="_self">enumerate groups</a> that have spaces in them and this lead me to realize I didn&#8217;t follow the specifications for valid distinguished names as well as I thought I had.  If you take a look at <a href="http://www.ietf.org/rfc/rfc2253.txt" target="_blank">RFC 2253</a> and the Microsoft page that <a href="http://technet.microsoft.com/en-us/library/cc776019%28WS.10%29.aspx" target="_blank">defines security group names</a>, you will see what the allowed characters are for these names.  At this point the validation is a lot better, but it still isn&#8217;t perfect.</p>
<p>If you encounter a situation where you need to enumerate members of a group that my validation does not allow, you can scroll down to line 271 in the script and change the $rx variable to &#8220;.+&#8221; to make it simple which will allow you to pass any characters.  If you pass invalid characters you will get some funny errors happening, but it should work.  You may have to use quotes around the name if you are looking to use spaces or other allowed special characters.</p>
<p>Taking another look at the code, I also found a small bug that was causing the display of notes associated with a group to print out an error about null strings.  This should be fixed now.  If anyone notices any other problems, feel free to comment and let me know and I will try to fix it or add in the change as soon as possible.  I&#8217;ll be posting another update soon that goes the other direction of this script, one that enumerates group membership for a specific user.</p>
<p>Thanks again to Darren from Brisbane(?), Australia for pointing this out.</p>
<p>Here is the updated script download link: <a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=3">enumerate_groups.ps1</a><a href="/wp-content/uploads/2009/05/enumerate_groups.ps1"></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F07%2F17%2Fenumerate-distribution-groups-script-updated%2F&amp;linkname=Enumerate%20Distribution%20Groups%20Script%20Updated%26%238230%3B"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sp_help_revlogin cleaned up and revised with roles</title>
		<link>http://www.tinyint.com/index.php/2009/07/08/sp_help_revlogin-cleaned-up-and-revised-with-roles/</link>
		<comments>http://www.tinyint.com/index.php/2009/07/08/sp_help_revlogin-cleaned-up-and-revised-with-roles/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 23:19:02 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[revlogin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql 2005]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=81</guid>
		<description><![CDATA[When working with SQL Server there are often times where you will need to script your logins over to another server such as when you have database mirroring or log shipping configured for certain databases.   This is such a common thing that Microsoft provides in-depth instructions on how to do this as well as [...]]]></description>
			<content:encoded><![CDATA[<p>When working with SQL Server there are often times where you will need to script your logins over to another server such as when you have database mirroring or log shipping configured for certain databases.   This is such a common thing that Microsoft provides in-depth instructions on how to do this as well as the T-SQL code required to do it, which you can read more about here: <a href="http://support.microsoft.com/kb/918992" target="_blank">http://support.microsoft.com/kb/918992</a>.  The script they provide is missing a few things so I took a little time to clean up the code, revise some of it, and add in a few of the missing pieces.</p>
<p>The three things that are overlooked in the Microsoft article that I have included are default language and default database (being mandatory) for logins as well as the scripting of roles.  The lack of the default language is pretty minor, but it&#8217;s something that could be important to people so I am including it in my script.  The lack of default databases being an option in the Microsoft script is not a big deal because it assumes you are scripting everything, but if you are only concerned with logins that are specific to a certain database you will get errors if you haven&#8217;t created that database on the target.  The lack of server roles is another important one that I have needed in previous configurations so it is also included here.  The resulting script is pretty long so you can check out the source of the revised procedure after the jump, which includes the sp_hexadecimal script from the Microsoft article.</p>
<p>Additionally, something just as important as the revlogin script itself is the question of <em>“Well now that I have this script, how do I schedule this to happen automatically for me instead of just generating more code that I have to execute on the target server?”</em> If you are asking that question then you might want to take a look at the next block of code.  In order to automate sp_help_revlogin there are a few options, but the one that I prefer over all else is using osql and a SQL Agent job with a single T-SQL step because it is very simple to implement in most server configurations.  The following script is relatively straight forward in that you only have one variable, the target server, to worry about.  The only pre-requisites being that xp_cmdshell is enabled and that the Windows account that the job is being executed under has sysadmin rights to both servers.  This script could easily be turned into a stored procedure but for the sake of brevity I have included it in its shortest form.</p>
<p><em><strong>Disclaimer: Use these scripts at your own risk!!</strong></em></p>
<pre class="brush: sql;">
-- Declare and set the target server...
DECLARE @TargetServer SYSNAME
SET @TargetServer = N'DB1.DOMAIN.LOCAL'

-- Define a temporary file to store the script output
DECLARE @guidfile VARCHAR(160)
SET @guidfile = '%TEMP%\' + CONVERT(SYSNAME, NEWID()) + '.txt'

-- execute sp_help_revlogin_roles and save the output to the temp file
DECLARE @cmd VARCHAR(8000)
SET @cmd = 'osql -E -n -h-1 -d master -w 8000 -Q &quot;exec sp_help_revlogin_roles&quot; -o &quot;' + @guidfile + '&quot;'
EXEC master.dbo.xp_cmdshell @cmd

-- execute the temp file on the target server
SET @cmd = 'osql -E -S ' + @TargetServer + ' -d master -w 8000 -i &quot;' + @guidfile + '&quot;' --' syntaxhighlighter fail <img src='http://www.tinyint.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />
EXEC master.dbo.xp_cmdshell @cmd

-- delete the temp file
SET @cmd = 'del &quot;' + @guidfile + '&quot;'
EXEC master.dbo.xp_cmdshell @cmd
</pre>
<p><span id="more-81"></span></p>
<p>Here is the code for the revised sp_help_revlogin which I renamed as sp_help_revlogin_roles to avoid confusion</p>
<pre class="brush: sql;">
USE master
GO

IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
	DROP PROCEDURE sp_hexadecimal
GO

CREATE PROCEDURE sp_hexadecimal
	@binvalue varbinary(256),
	@hexvalue varchar (514) OUTPUT
AS
BEGIN
	SET NOCOUNT ON
	DECLARE @charvalue varchar (514)
	DECLARE @i int
	DECLARE @length int
	DECLARE @hexstring char(16)

	SELECT @charvalue = '0x'
	SELECT @i = 1
	SELECT @length = DATALENGTH (@binvalue)
	SELECT @hexstring = '0123456789ABCDEF'

	DECLARE @tempint int
	DECLARE @firstint int
	DECLARE @secondint int
	WHILE (@i &lt;= @length)
	BEGIN
		SELECT @tempint = CONVERT(int, SUBSTRING(@binvalue,@i,1))
		SELECT @firstint = FLOOR(@tempint/16)
		SELECT @secondint = @tempint - (@firstint*16)
		SELECT @charvalue = @charvalue +
		SUBSTRING(@hexstring, @firstint+1, 1) +
		SUBSTRING(@hexstring, @secondint+1, 1)
		SELECT @i = @i + 1
	END

	SELECT @hexvalue = @charvalue
END
GO

USE master
GO

IF OBJECT_ID ('sp_help_revlogin_roles') IS NOT NULL
	DROP PROCEDURE sp_help_revlogin_roles
GO
CREATE PROCEDURE sp_help_revlogin_roles
	@login_name sysname=NULL,
	@databases bit=1,
	@roles bit=1
AS
BEGIN
	SET NOCOUNT ON
	DECLARE @name sysname
	DECLARE @role sysname
	DECLARE @type varchar (1)
	DECLARE @hasaccess int
	DECLARE @denylogin int
	DECLARE @is_disabled int
	DECLARE @PWD_varbinary  varbinary (256)
	DECLARE @PWD_string  varchar (514)
	DECLARE @SID_varbinary varbinary (85)
	DECLARE @SID_string varchar (514)
	DECLARE @is_policy_checked varchar (3)
	DECLARE @is_expiration_checked varchar (3)
	DECLARE @defaultdb sysname
	DECLARE @defaultlang sysname
	DECLARE @crlf varchar(2)
	DECLARE @return int

	SET @crlf = CHAR(13) + CHAR(10)

	PRINT '/* sp_help_revlogin script '
	PRINT '** Generated ' + CONVERT (varchar, GETDATE()) + ' on ' + @@SERVERNAME + ' */'
	PRINT ''
	PRINT '/* Begin Script Logins ------------------------- */'

	IF (@login_name IS NULL)
	BEGIN
		DECLARE rev_cursor CURSOR STATIC READ_ONLY FOR
			SELECT p.sid, p.name, p.type, p.is_disabled, ISNULL(p.default_database_name, 'master'), ISNULL(p.default_language_name, 'us_english'), l.hasaccess, l.denylogin
			FROM sys.server_principals p
			LEFT JOIN sys.syslogins l
				ON ( l.name = p.name )
			WHERE p.type IN ( 'S', 'G', 'U' )
				AND p.name &lt;&gt; 'sa'
	END
	ELSE
	BEGIN
		DECLARE rev_cursor CURSOR STATIC READ_ONLY FOR
			SELECT p.sid, p.name, p.type, p.is_disabled, ISNULL(p.default_database_name, 'master'), ISNULL(p.default_language_name, 'us_english'), l.hasaccess, l.denylogin
			FROM sys.server_principals p
			LEFT JOIN sys.syslogins l
				ON ( l.name = p.name )
			WHERE p.type IN ( 'S', 'G', 'U' )
				AND p.name = @login_name
	END

	OPEN rev_cursor

	FETCH NEXT FROM rev_cursor
		INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @defaultlang, @hasaccess, @denylogin

	IF (@@FETCH_STATUS = -1)
	BEGIN
		PRINT 'No login(s) found.'
		SELECT @return = -1
		GOTO Quit
	END

	WHILE (@@FETCH_STATUS = 0)
	BEGIN
		SELECT @name=LTRIM(RTRIM(@name))
		PRINT '-- Login: ' + @name
		IF (@type IN ( 'G', 'U'))
		BEGIN -- NT authenticated account/group
			PRINT 'IF NOT EXISTS ( SELECT * FROM sys.server_principals WHERE name = ''' + @name + ''' )'
			PRINT '	CREATE LOGIN ' + QUOTENAME( @name ) + ' FROM WINDOWS WITH DEFAULT_DATABASE = [' + @defaultdb + ']'
		END
		ELSE BEGIN -- SQL Server authentication
			-- obtain password and sid
			SET @PWD_varbinary = CAST( LOGINPROPERTY( @name, 'PasswordHash' ) AS varbinary (256) )
			EXEC sp_hexadecimal @PWD_varbinary, @PWD_string OUT
			EXEC sp_hexadecimal @SID_varbinary, @SID_string OUT

			-- obtain password policy state
			SELECT @is_policy_checked =
				CASE is_policy_checked
					WHEN 1 THEN 'ON'
					WHEN 0 THEN 'OFF'
					ELSE NULL
				END
			FROM sys.sql_logins
			WHERE name = @name

			SELECT @is_expiration_checked =
				CASE is_expiration_checked
					WHEN 1 THEN 'ON'
					WHEN 0 THEN 'OFF'
					ELSE NULL
				END
			FROM sys.sql_logins
			WHERE name = @name

			PRINT
				'IF NOT EXISTS ( SELECT * FROM sys.server_principals WHERE name = ''' + @name + ''' )' + @crlf +
				'	CREATE LOGIN ' + QUOTENAME( @name ) + @crlf +
				'		WITH PASSWORD = ' + @PWD_string + ' HASHED, ' + @crlf +
				'		SID = ' + @SID_string + ', ' + @crlf +
				'		DEFAULT_LANGUAGE = [' + @defaultlang + ']' +
				CASE WHEN ( @is_policy_checked IS NOT NULL ) THEN ',' + @crlf + '		CHECK_POLICY = ' + @is_policy_checked END +
				CASE WHEN ( @is_expiration_checked IS NOT NULL ) THEN ',' + @crlf + '		CHECK_EXPIRATION = ' + @is_expiration_checked END +
				';'
		END

		IF (@denylogin = 1)
		BEGIN -- login is denied access
			PRINT 'DENY CONNECT SQL TO ' + QUOTENAME( @name )
		END
		ELSE IF (@hasaccess = 0)
		BEGIN -- login exists but does not have access
			PRINT 'REVOKE CONNECT SQL TO ' + QUOTENAME( @name )
		END
		IF (@is_disabled = 1)
		BEGIN -- login is disabled
			PRINT 'ALTER LOGIN ' + QUOTENAME( @name ) + ' DISABLE'
		END

		PRINT ' '
		PRINT ' '
		FETCH NEXT FROM rev_cursor
			INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @defaultlang, @hasaccess, @denylogin
	END
	PRINT '/* End Script Logins ------------------------- */'
	PRINT ' '
	PRINT ' '

	IF @databases=1
	BEGIN
		FETCH FIRST FROM rev_cursor
			INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @defaultlang, @hasaccess, @denylogin
		PRINT '/* Begin Script Default Databases ------------------------- */'
		WHILE (@@FETCH_STATUS=0)
		BEGIN
			PRINT '-- Login: ' + @name
			PRINT 'IF EXISTS ( SELECT * FROM sys.server_principals WHERE name = ''' + @name + ''' )'
			PRINT '	ALTER LOGIN ' + QUOTENAME( @name ) + ' WITH DEFAULT_DATABASE = [' + @defaultdb + ']'
			PRINT ' '

			FETCH NEXT FROM rev_cursor
				INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @defaultlang, @hasaccess, @denylogin
		END
		PRINT '/* End Script Default Databases ------------------------- */'
		PRINT ' '
		PRINT ' '
	END
	CLOSE rev_cursor
	DEALLOCATE rev_cursor

	IF @roles=1
	BEGIN
		PRINT '/* Begin Script Roles ------------------------- */'
		DECLARE rev_cursor CURSOR STATIC READ_ONLY FOR
			SELECT p1.name role_principal_name, p2.name member_principal_name FROM sys.server_role_members rm
			INNER JOIN sys.server_principals p1
				ON p1.principal_id=rm.role_principal_id
			INNER JOIN sys.server_principals p2
				ON p2.principal_id=rm.member_principal_id
			WHERE
				p2.type IN ( 'S', 'G', 'U' )
				AND p2.name &lt;&gt; 'sa'
			ORDER BY p2.principal_id
		OPEN rev_cursor

		FETCH NEXT FROM rev_cursor
			INTO @role, @name
		IF (@@FETCH_STATUS = -1)
		BEGIN
			PRINT '-- No role member(s) found.'
		END

		WHILE (@@FETCH_STATUS = 0)
		BEGIN
			PRINT 'EXEC master.dbo.sp_addsrvrolemember @loginame=''' + @name + ''', @rolename=''' + @role + ''''

			FETCH NEXT FROM rev_cursor
				INTO @role, @name
		END
		PRINT '/* End Script Roles ------------------------- */'
		PRINT ' '
		PRINT ' '

		CLOSE rev_cursor
		DEALLOCATE rev_cursor
	END

	SELECT @return = 0

	Quit:
		RETURN @return

END
GO
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F07%2F08%2Fsp_help_revlogin-cleaned-up-and-revised-with-roles%2F&amp;linkname=sp_help_revlogin%20cleaned%20up%20and%20revised%20with%20roles"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/07/08/sp_help_revlogin-cleaned-up-and-revised-with-roles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Black Login Screen Showing Logo in Windows 2003</title>
		<link>http://www.tinyint.com/index.php/2009/06/22/black-login-screen-showing-logo-in-windows-2003/</link>
		<comments>http://www.tinyint.com/index.php/2009/06/22/black-login-screen-showing-logo-in-windows-2003/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 09:56:03 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[black login]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[windows 2003]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=71</guid>
		<description><![CDATA[Have you ever had a login screen show up in Windows where everything is black except for the logo like the image below? This happens sometimes when the system drive on a server fills up, and a bug in windows causing all of the color settings to default to black. It is a pretty common [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever had a login screen show up in Windows where everything is black except for the logo like the image below? This happens sometimes when the system drive on a server fills up, and a bug in windows causing all of the color settings to default to black. It is a pretty common problem, however for some reason Microsoft has not released a KB article about this even though I have seen this happen numerous times.</p>
<div id="attachment_72" class="wp-caption alignnone" style="width: 510px"><a href="http://www.tinyint.com/wp-content/uploads/2009/06/black-login-with-logo.png"><img class="size-full wp-image-72" title="black-login-with-logo" src="http://www.tinyint.com/wp-content/uploads/2009/06/black-login-with-logo.png" alt="Black Login Screen With Logo in Windows 2003" width="500" height="395" /></a><p class="wp-caption-text">Black Login Screen With Logo in Windows 2003</p></div>
<p>If you ever see this happen on one of your machines, the solution is actually pretty simple. The first thing you will need to do is clear up the disk space on the server. The easiest way is to do this remotely from another server. If you do not have that option, try and type the username in the blank screen, you should see the text cursor move across as if it is recognizing the letters you are typing, which it is. If you don&#8217;t see the cursor moving, it may just be waiting for you to press Ctrl-Alt-Del, so press that and try again. Once the username is entered, press tab and enter the password. Then hit enter and you should be able to login without an issue. Once you are logged in you will see that all of the color is back on the screen and you can use the machine like normal and you can now clear up the disk space issue.</p>
<p>Now that the disk space has been cleared up, you will want to make a few changes to the registry. You will want to take a backup of the registry before you make any changes though. For more information on backing up the registry check out the following link <a href="http://support.microsoft.com/kb/322756">http://support.microsoft.com/kb/322756</a> for Windows XP/Vista&#8230; the steps are pretty much the same for Windows 2003. Keep in mind that the next step of editing the registry can be dangerous if things are done improperly and you must do so at your own risk. To quote Microsoft, with one change to refer to this site:</p>
<blockquote><p><strong>Warning</strong> Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. TinyInt.Com cannot guarantee that these problems can be solved. Modify the registry at your own risk.</p></blockquote>
<p>Ok now that that is out of the way, and you have backed up your registry, you can try the following. You can manually edit the registry, specifically the string values located in the key [HKEY_USERS\.DEFAULT\Control Panel\Colors] to match the following block of text. You can also simply start up notepad, copy the text below into a blank document, then save the file to your desktop as something like colors.reg (make sure to change the &#8220;Files of Type&#8221; to &#8220;All Files&#8221; so it doesn&#8217;t save as a text file) then simply double click on that file on your desktop and click yes to allow it to be imported into your registry. Then you can log off and you should see that the colors have been updated!</p>
<pre class="brush: plain;">
Windows Registry Editor Version 5.00

[HKEY_USERS\.Default\Control Panel\Colors]
&quot;ActiveBorder&quot;=&quot;212 208 200&quot;
&quot;ActiveTitle&quot;=&quot;10 36 106&quot;
&quot;AppWorkSpace&quot;=&quot;128 128 128&quot;
&quot;Background&quot;=&quot;102 111 116&quot;
&quot;ButtonAlternateFace&quot;=&quot;181 181 181&quot;
&quot;ButtonDkShadow&quot;=&quot;64 64 64&quot;
&quot;ButtonFace&quot;=&quot;212 208 200&quot;
&quot;ButtonHilight&quot;=&quot;255 255 255&quot;
&quot;ButtonLight&quot;=&quot;212 208 200&quot;
&quot;ButtonShadow&quot;=&quot;128 128 128&quot;
&quot;ButtonText&quot;=&quot;0 0 0&quot;
&quot;GradientActiveTitle&quot;=&quot;166 202 240&quot;
&quot;GradientInactiveTitle&quot;=&quot;192 192 192&quot;
&quot;GrayText&quot;=&quot;128 128 128&quot;
&quot;Hilight&quot;=&quot;10 36 106&quot;
&quot;HilightText&quot;=&quot;255 255 255&quot;
&quot;HotTrackingColor&quot;=&quot;0 0 128&quot;
&quot;InactiveBorder&quot;=&quot;212 208 200&quot;
&quot;InactiveTitle&quot;=&quot;128 128 128&quot;
&quot;InactiveTitleText&quot;=&quot;212 208 200&quot;
&quot;InfoText&quot;=&quot;0 0 0&quot;
&quot;InfoWindow&quot;=&quot;255 255 225&quot;
&quot;Menu&quot;=&quot;212 208 200&quot;
&quot;MenuText&quot;=&quot;0 0 0&quot;
&quot;Scrollbar&quot;=&quot;212 208 200&quot;
&quot;TitleText&quot;=&quot;255 255 255&quot;
&quot;Window&quot;=&quot;255 255 255&quot;
&quot;WindowFrame&quot;=&quot;0 0 0&quot;
&quot;WindowText&quot;=&quot;0 0 0&quot;
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F06%2F22%2Fblack-login-screen-showing-logo-in-windows-2003%2F&amp;linkname=Black%20Login%20Screen%20Showing%20Logo%20in%20Windows%202003"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/06/22/black-login-screen-showing-logo-in-windows-2003/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 2008 DNS Query Issues with Root Hints</title>
		<link>http://www.tinyint.com/index.php/2009/06/09/windows-2008-dns-query-issues-with-root-hints/</link>
		<comments>http://www.tinyint.com/index.php/2009/06/09/windows-2008-dns-query-issues-with-root-hints/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 03:48:10 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[root hints]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=56</guid>
		<description><![CDATA[While browsing Newegg looking for some hardware, I came across an issue where the images on their site were not loading.  I couldn’t figure out exactly what was going on since it wasn’t a browser cache issue, and it didn’t seem to be a DNS issue, at least not on my workstation anyway.  After doing [...]]]></description>
			<content:encoded><![CDATA[<p>While browsing Newegg looking for some hardware, I came across an issue where the images on their site were not loading.  I couldn’t figure out exactly what was going on since it wasn’t a browser cache issue, and it didn’t seem to be a DNS issue, at least not on my workstation anyway.  After doing a little digging, I tried clearing the DNS cache on our DNS server and everything came up and the images started loading again fine.</p>
<p>Over the course of the last three months this happened a few times, not only for Newegg but for other sites as well, mostly in the .co.uk TLD though.  This happening once was easy enough to dismiss, even happening a second time, ok, but after a third time, there had to be some other underlying issue.  Fortunately, Microsoft released a KB article that explains what is going on and how to get around the problem.  You can read all about it here: <a href="http://support.microsoft.com/kb/968372">http://support.microsoft.com/kb/968372</a></p>
<p>What is happening is basically that root hints are not updating on the DNS server and SERVFAIL is getting returned to the client requesting the DNS lookup.  This can cause pages to not load on certain domains, including but not limited to .co.uk, .cn, and .br, as well as certain .com&#8217;s that I have seen.  Fortunately the fix is easy enough; you can either configure forwarders or simply tweak the TTL of the root hints on your server.  I’m not going to get into the debate of which is better, root hints or forwarders; but for those of you using forwarders this problem will not affect you, and for those of you using root hints, below is a very easy set of commands you can run to fix the problem.</p>
<p>Launch an elevated command prompt and execute the following commands.  This will stop your DNS server, add the Microsoft recommended registry value, and start DNS back up again.</p>
<pre class="brush: plain;">
NET STOP DNS
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\DNS\Parameters /v MaxCacheTTL /t REG_DWORD /d 0x0002a300
NET START DNS
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F06%2F09%2Fwindows-2008-dns-query-issues-with-root-hints%2F&amp;linkname=Windows%202008%20DNS%20Query%20Issues%20with%20Root%20Hints"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/06/09/windows-2008-dns-query-issues-with-root-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enumerate Distribution Group Members</title>
		<link>http://www.tinyint.com/index.php/2009/05/24/enumerate-distribution-group-members/</link>
		<comments>http://www.tinyint.com/index.php/2009/05/24/enumerate-distribution-group-members/#comments</comments>
		<pubDate>Sun, 24 May 2009 21:27:30 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[distribution group]]></category>
		<category><![CDATA[enumerate members]]></category>
		<category><![CDATA[get-distributiongroupmember]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=39</guid>
		<description><![CDATA[Note: Script updated on 2009/07/17 to fix two bugs.  Read more here: http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/ In my organization, we make use of many different groups to separate departments and sub-groups of each department, and many groups build off of this. We also make use of Dynamic Distribution Groups to make things a bit easier on the admin [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;">Note: Script updated on 2009/07/17 to fix two bugs.  Read more here: <a href="http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/">http://www.tinyint.com/index.php/2009/07/17/enumerate-distribution-groups-script-updated/</a></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;"><br />
In my organization, we make use of many different groups to separate departments and sub-groups of each department, and many groups build off of this.<span style="mso-spacerun: yes;"> </span>We also make use of Dynamic Distribution Groups to make things a bit easier on the admin side of things.<span style="mso-spacerun: yes;"> </span>When tasked with cleaning up these distribution groups and making them easier to manage, it was a bit difficult determining who was supposed to receive mail for what group.<span style="mso-spacerun: yes;"> </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri; font-size: small;">This is because the Get-DistributionGroupMember cmdlet doesn’t have a parameter like –expand which will give you all of the child groups and their members as well.<span style="mso-spacerun: yes;"> </span>If you have a group called “Engineering” which then has 4 child groups for each department and then each of those groups has each individual mailbox, when you perform “Get-DistributionGroupMember -Identity Engineering”, you will only see the four child groups, not each member of those as well.<span style="mso-spacerun: yes;"> </span>This became a big issue because of how much we rely on sub-groups in our organization, and after a lot of investigation it turned out there was no way to do this built in directly to any cmdlet, so I wrote a script that would do this for me.  If you need to recursively enumerate distribution group members you are unfortunately out of luck with built in cmdlets.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri; font-size: small;">There are a number of scripts out there that serve a similar purpose as the one I have created, but most do not handle mail contacts or dynamic distribution groups, so I figured if I am going to have to add functionality, I might as well write it myself from the ground up.<span style="mso-spacerun: yes;"> </span>So now, if you are ever in need of getting child members of a distribution group you can use this script to help you out.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri; font-size: small;">One nice feature here is if you specify “-showTree” as a parameter, it will display a treeview of all the groups.<span style="mso-spacerun: yes;"> </span>Without -showtree it will just grab all child members and display them in a flat view.<span style="mso-spacerun: yes;"> </span>The script is pretty long because I included help text that displays if you run the script without any parameters, and for that reason I am just posting it as a download link.<span style="mso-spacerun: yes;"> </span>Hope this helps a few people out there who went through the same trouble I did finding out that there is no built in way to do this!</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri; font-size: small;"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;">Download Link: </span></span><a href="http://www.tinyint.com/wp-content/plugins/download-monitor/download.php?id=3">enumerate_groups.ps1</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F05%2F24%2Fenumerate-distribution-group-members%2F&amp;linkname=Enumerate%20Distribution%20Group%20Members"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/05/24/enumerate-distribution-group-members/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fix for a hanging server after shutdown in rdp session&#8230;</title>
		<link>http://www.tinyint.com/index.php/2009/03/25/shutdown-hang-from-remote-desktop-fix/</link>
		<comments>http://www.tinyint.com/index.php/2009/03/25/shutdown-hang-from-remote-desktop-fix/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 20:04:02 +0000</pubDate>
		<dc:creator>tcnolan</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[hotfix]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[windows 2003]]></category>

		<guid isPermaLink="false">http://www.tinyint.com/?p=11</guid>
		<description><![CDATA[One of my least favorite, and recurring, issues with Windows is one that pops up all the time where you try to reboot a server while you are in a remote desktop session; the RDP session will end but the server never reboots.  In my experience this only happens when you reboot within a normal RDP [...]]]></description>
			<content:encoded><![CDATA[<p>One of my least favorite, and recurring, issues with Windows is one that pops up all the time where you try to reboot a server while you are in a remote desktop session; the RDP session will end but the server never reboots.  In my experience this only happens when you reboot within a normal RDP session, but if you are logged in with the /console or /admin switch it will work fine.  This fix is relatively old, but it is one that is not talked about very frequently.  This can also happen if you are logged into a regular RDP session and are trying to run Windows Updates.</p>
<p>This problem is a result of deadlocks occurring between the NTFS shutdown process and disk resource access.  Usually, your server will remain online responding to ping when this happens, and you can even get into computer management, remote registry, and other things remotely.  Getting back into the server through RDP however does not work because terminal services is already shutting down.  You can read more about this at the link below for the KB article.</p>
<p>Without this fix your options are limited to bring the server down gracefully, in fact many people would just do a hard reset from the power button to finish the reboot.  You can however issue a remote shutdown command from the command line.  Simply run &#8220;shutdown /r /t 5 /m \\computer_name&#8221; without the quotes to reboot the machine in question.  Make sure you don&#8217;t forget the /m switch otherwise you will end up rebooting your own machine.  /t is for the time to wait before shutting down and you can use 0 if you like to shutdown immediately, but this doesn&#8217;t give you a chance to send an abort (/a) if you enter the wrong server accidentally. You can also issue &#8220;shutdown /i&#8221; without the quotes to get the interactive dialog which will let you enter a list of servers to reboot and a few other options.</p>
<p>The Microsoft patch for this can be acquired from the following page: <a href="http://support.microsoft.com/kb/930045">http://support.microsoft.com/kb/930045</a></p>
<p><em>Note:</em> This does not solve the problem every single time.  I have seen the issue occur even after applying this patch, but it seems to fix the problem for the vast majority.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.tinyint.com%2Findex.php%2F2009%2F03%2F25%2Fshutdown-hang-from-remote-desktop-fix%2F&amp;linkname=Fix%20for%20a%20hanging%20server%20after%20shutdown%20in%20rdp%20session%26%238230%3B"><img src="http://www.tinyint.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.tinyint.com/index.php/2009/03/25/shutdown-hang-from-remote-desktop-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
