<?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>User Error</title>
	<atom:link href="http://daniel.streefkerkonline.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://daniel.streefkerkonline.com</link>
	<description>Ramblings of a tinkering SysAdmin</description>
	<lastBuildDate>Tue, 13 Mar 2012 05:03:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VBScript to disable all users in specified OUs</title>
		<link>http://daniel.streefkerkonline.com/vbscript-to-disable-all-users-in-specified-ous/</link>
		<comments>http://daniel.streefkerkonline.com/vbscript-to-disable-all-users-in-specified-ous/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 05:03:28 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=350</guid>
		<description><![CDATA[When staff members leave the organisation, we move their account to a sub-OU named “Leavers” under their office’s OU. This triggers their mailbox to be archived in Enterprise Vault. I thought it was about time to put together a quick &#8230; <a href="http://daniel.streefkerkonline.com/vbscript-to-disable-all-users-in-specified-ous/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When staff members leave the organisation, we move their account to a sub-OU named “Leavers” under their office’s OU. This triggers their mailbox to be archived in Enterprise Vault.</p>
<p>I thought it was about time to put together a quick scheduled task to ensure that all these “leavers” were automatically disabled and hidden from the Exchange address lists without IT manually having to do it. </p>
<p>I came across this <a href="http://vbscriptblog.com/vbscript/active-directory/active-directory-vbscript-to-disable-all-user-objects-in-an-ou/" target="_blank">handy and concise example</a>, and modified it to run through a group of OUs while doing what I needed it to do.</p>
<p>Here’s the code. As always, run at your own risk, and test it before putting it into production:</p>
<pre class="brush: vb;">On Error Resume Next

Dim arrLeaverOrgUnits, objOU
arrLeaverOrgUnits = Array("LDAP://OU=Leavers,OU=Sydney,DC=contoso,DC=com",_
                          "LDAP://OU=Leavers,OU=Melbourne,DC=contoso,DC=com")

For Each strOU in arrLeaverOrgUnits
  Set objOU = GetObject(strOU)
    ' Let's be extra-paranoid here, and make sure we're only working on the leavers OU
    '  in case someone adds the wrong OU into the array above
    If objOU.Name &lt;&gt; "OU=Leavers" Then Exit For

    ' Loop through each object in the current OU
    For Each objObject In objOU
      ' If the current object is a user
      If objObject.class="user" then
        'Disable the account
        objObject.AccountDisabled = True
        ' Hide the account from the Exchange address lists
        objObject.Put "msExchHideFromAddressLists", True
        ' Write the information back to the user object in AD
        objObject.SetInfo

        'WScript.Echo objObject.Name &amp; " disabled and hidden from Exchange address lists"
      End if
    Next
  Set objOU = Nothing
Next
</pre>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/vbscript-to-disable-all-users-in-specified-ous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Word: Multilevel lists: Removing number font styles</title>
		<link>http://daniel.streefkerkonline.com/microsoft-word-multilevel-lists-removing-number-font-styles/</link>
		<comments>http://daniel.streefkerkonline.com/microsoft-word-multilevel-lists-removing-number-font-styles/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 05:08:50 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Microsoft Word]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=348</guid>
		<description><![CDATA[I was recently working with a report template where a numbered Heading 1 had a colour and size assigned to the actual number style. This was then causing problems on the table of contents because the number’s style was showing &#8230; <a href="http://daniel.streefkerkonline.com/microsoft-word-multilevel-lists-removing-number-font-styles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently working with a report template where a numbered Heading 1 had a colour and size assigned to the actual number style. This was then causing problems on the table of contents because the number’s style was showing up there too.</p>
<p><a href="http://daniel.streefkerkonline.com/uploads/2012/03/1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="1" border="0" alt="1" src="http://daniel.streefkerkonline.com/uploads/2012/03/1_thumb.png" width="616" height="276"></a></p>
<p>The problem is though, it’s impossible to remove the formatting on that number via the UI in Word. By default, the colour is set to “No Color”, but it’s impossible to go back to that setting once a colour has been chosen.</p>
<p><a href="http://daniel.streefkerkonline.com/uploads/2012/03/2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="2" border="0" alt="2" src="http://daniel.streefkerkonline.com/uploads/2012/03/2_thumb.png" width="433" height="480"></a></p>
<p><a href="http://daniel.streefkerkonline.com/uploads/2012/03/3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="3" border="0" alt="3" src="http://daniel.streefkerkonline.com/uploads/2012/03/3_thumb.png" width="381" height="480"></a></p>
<p>I didn’t want to re-create the entire document as it had macros embedded, and also had a lot of work done already. Luckily, all of this information is stored in XML format, so it’s not too hard to find.</p>
<p>To remove this style information from the number, do the following <font style="background-color: #ffff00"><u>with a backup</u> of your file</font>.</p>
<ol>
<li>Rename the file extension to .zip (I usually just append .zip to the existing filename)</li>
<li>Copy out the <em>Word</em> folder from within the zip file to somewhere temporary<a href="http://daniel.streefkerkonline.com/uploads/2012/03/7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="7" border="0" alt="7" src="http://daniel.streefkerkonline.com/uploads/2012/03/7_thumb.png" width="640" height="301"></a></li>
<li>Open <em>numbering.xml</em> from the unzipped <em>word</em> folder with something like <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=7973" target="_blank">XML Notepad</a></li>
<li>Search for the name of your style. In my case, it was “Heading1” (note the lack of a space between “Heading” and “1”. The style is actually called “Heading 1” in Word:<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/03/4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="4" border="0" alt="4" src="http://daniel.streefkerkonline.com/uploads/2012/03/4_thumb.png" width="372" height="139"></a></li>
<li>Once you find that style, drill down to the <em>w:rPr</em> node. You can see here that a style and colour is defined for the numbering associated with Heading 1<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/03/10.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="10" border="0" alt="10" src="http://daniel.streefkerkonline.com/uploads/2012/03/10_thumb.png" width="491" height="480"></a></li>
<li>Remove everything under <em>w:rPr</em> except for <em>w:rFonts-&gt;w:hint</em> (I’m sure you could remove this too, but it was there by default for other styles)<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/03/11.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="11" border="0" alt="11" src="http://daniel.streefkerkonline.com/uploads/2012/03/11_thumb.png" width="578" height="445"></a></li>
<li>Save the XML file</li>
<li>Copy the XML file back into the <em>word</em> folder in the zip file<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/03/12.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="12" border="0" alt="12" src="http://daniel.streefkerkonline.com/uploads/2012/03/12_thumb.png" width="640" height="471"></a></li>
<li>Rename the file extension back to what it originally was. In my case, it was .docm</li>
<li>Open the file in Word, and inspect the result. Hopefully, it succeeds for you as it did for me:<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/03/13.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="13" border="0" alt="13" src="http://daniel.streefkerkonline.com/uploads/2012/03/13_thumb.png" width="615" height="273"></a></li>
</ol>
<p><strong><font style="background-color: #ffff00">Remember: Do this with a backup copy of your file in case you somehow manage to corrupt it.<br /></font></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/microsoft-word-multilevel-lists-removing-number-font-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveSync woes&#8211;&#8220;Cannot get mail&#8221; and the case of the endless re-sync</title>
		<link>http://daniel.streefkerkonline.com/activesync-woescannot-get-mail-and-the-case-of-the-endless-re-sync/</link>
		<comments>http://daniel.streefkerkonline.com/activesync-woescannot-get-mail-and-the-case-of-the-endless-re-sync/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:41:00 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[ActiveSync]]></category>
		<category><![CDATA[Exchange2010]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[TMG]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=327</guid>
		<description><![CDATA[We recently experienced a really bizarre issue with our ActiveSync infrastructure. Users started complaining that their contacts were disappearing, and that their inboxes would re-synchronise constantly. All items in the inbox would disappear, and then reappear, starting with the oldest &#8230; <a href="http://daniel.streefkerkonline.com/activesync-woescannot-get-mail-and-the-case-of-the-endless-re-sync/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniel.streefkerkonline.com/uploads/2012/02/cannotgetmail.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 15px 20px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="cannotgetmail" border="0" alt="cannotgetmail" align="left" src="http://daniel.streefkerkonline.com/uploads/2012/02/cannotgetmail_thumb.png" width="225" height="174"></a>We recently experienced a really bizarre issue with our ActiveSync infrastructure. Users started complaining that their contacts were disappearing, and that their inboxes would re-synchronise constantly. All items in the inbox would disappear, and then reappear, starting with the oldest item. Some items were even dated at the <a href="http://en.wikipedia.org/wiki/Unix_time#Encoding_time_as_a_number" target="_blank">Unix epoch</a>. Users on iOS would get an error screen “Cannot get mail”, and downloading emails would time out or take a very long time.</p>
<p>We’re set up with TMG in our DMZ, which then sends traffic to a pair of CAS servers internally. We’ve been running Exchange 2010 SP2 and 2003 in co-existence for some time now, as some of our national offices are still in the process of migrating users across.</p>
<p>Our troubleshooting covered all areas, from looking at ActiveSync logs from IIS, running the Test-ExchangeConnectivity scripts, to testing on the devices themselves &#8211; you name it, we tried it. Here’s a quick way to turn up the logging level on ActiveSync using PowerShell:</p>
<pre class="brush: ps;">Get-EventLogLevel | Where-Object {$_.Identity -like "MSExchange ActiveSync*"} | Set-EventLogLevel -Level High
</pre>
<p>The usual suggestions of <a href="http://blog.sallarp.com/exchange-2010-iphone-activesync-issue/" target="_blank">permissions on the user account in AD</a> and various other settings were not relevant. We even investigated the possibility that the problem could be caused by users still on iOS 4.0, which was <a href="http://support.apple.com/kb/TS3398" target="_blank">known</a> to cause issues and unusually high server load.</p>
<p>We then noticed that the TMG box would experience timeouts when requesting DNS resolution from our internal DNS servers. There were also errors from the TMG connectivity verifiers for AD that the LDAP servers were unreachable. This pointed to some sort of connectivity issue between TMG and and the CAS servers. Circumventing the TMG box by VPN’ing in or connecting via our corporate WiFi seemed to resolve the issue.</p>
<p>Upon inspection of our Netscreen 25 firewall, we noticed a lot of error messages about the source IP session limit being exceeded:<a href="http://daniel.streefkerkonline.com/uploads/2012/02/juniperlog.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="juniperlog" border="0" alt="juniperlog" src="http://daniel.streefkerkonline.com/uploads/2012/02/juniperlog_thumb.png" width="640" height="132"></a></p>
<p>This <a href="http://kb.juniper.net/InfoCenter/index?page=content&amp;id=KB6557" target="_blank">is by design</a>. It turned out that our DMZ had previously had IP based session limits set to a threshold of 128 sessions. This limit was being exceeded by the large number of ActiveSync users we now have. We bumped up that number to 512, and our problems are now resolved.<br /><a href="http://daniel.streefkerkonline.com/uploads/2012/02/juniper-settings.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="juniper-settings" border="0" alt="juniper-settings" src="http://daniel.streefkerkonline.com/uploads/2012/02/juniper-settings_thumb.png" width="640" height="300"></a></p>
<p>Funnily enough, while I was troubleshooting this issue, two ActiveSync troubleshooting-related articles appeared in my RSS reader of choice, Google Reader:</p>
<ol>
<li><a href="http://blogs.technet.com/b/exchange/archive/2012/01/31/a-script-to-troubleshoot-issues-with-exchange-activesync.aspx" target="_blank">The Exchange Team Blog: A script to troubleshoot issues with Exchange ActiveSync</a>
<li><a href="http://msexchangeguru.com/2012/02/01/exchange-activesync/" target="_blank">MSExchangeGuru.com: Troubleshooting Exchange ActiveSync and reading IIS logs</a></li>
</ol>
<p>They’re both certainly worth reading, and are a great starting point if you’re experiencing ActiveSync issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/activesync-woescannot-get-mail-and-the-case-of-the-endless-re-sync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send a HTML email with PowerShell</title>
		<link>http://daniel.streefkerkonline.com/send-a-html-email-with-powershell/</link>
		<comments>http://daniel.streefkerkonline.com/send-a-html-email-with-powershell/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 23:32:38 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=319</guid>
		<description><![CDATA[There’s a simple one-liner (expanded onto multiple lines for clarity) in PowerShell that allows you to send an email with HTML content derived from a HTML file: Send-MailMessage -Subject "Test email" -To "recipient@contoso.com" -From "me@contoso.com" -SmtpServer mail.contoso.com -BodyAsHtml (Get-Content "d:\templates\invite-template.htm" &#8230; <a href="http://daniel.streefkerkonline.com/send-a-html-email-with-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There’s a simple one-liner (expanded onto multiple lines for clarity) in PowerShell that allows you to send an email with HTML content derived from a HTML file:</p>
<pre class="brush: ps;">Send-MailMessage  -Subject "Test email"
                  -To "recipient@contoso.com"
                  -From "me@contoso.com"
                  -SmtpServer mail.contoso.com
                  -BodyAsHtml (Get-Content "d:\templates\invite-template.htm" | Out-String)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/send-a-html-email-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding style and Google Analytics to an Apache directory index (mod_autoindex)</title>
		<link>http://daniel.streefkerkonline.com/adding-style-and-google-analytics-to-an-apache-directory-index-mod_autoindex/</link>
		<comments>http://daniel.streefkerkonline.com/adding-style-and-google-analytics-to-an-apache-directory-index-mod_autoindex/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 22:46:44 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=315</guid>
		<description><![CDATA[I recently had to spruce up a password-protected Apache directory index site that is being used to host some files for download. In addition to making it look more presentable, I also discovered that you can inject code into the &#8230; <a href="http://daniel.streefkerkonline.com/adding-style-and-google-analytics-to-an-apache-directory-index-mod_autoindex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had to spruce up a password-protected Apache directory index site that is being used to host some files for download. </p>
<p>In addition to <a href="http://quasiobject.com/blog/3/indexstylesheet-for-modautoindex" target="_blank">making it look more presentable</a>, I also discovered that you can inject code into the &lt;head&gt; of the index page. This allowed me to achieve what I’d wanted to do for a while on that site – track visitors using Google Analytics.</p>
<p>To do so you already need to be using indexes and FancyIndexing. Then, simply add the following to your .htaccess file:</p>
<pre class="brush: bash;">IndexHeadInsert "&lt;script type=\"text/javascript\"&gt;var _gaq = _gaq || [];_gaq.push(['_setAccount', '{INSERT TRACKING CODE HERE}']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();&lt;/script&gt;"</pre>
<p>Here’s the rest of my .htaccess file, excluding the security section:</p>
<pre class="brush: bash;">Options +Indexes

IndexOptions +FancyIndexing
IndexOptions +FoldersFirst
IndexOptions +XHTML
IndexOptions +HTMLTable
IndexOptions +SuppressRules
IndexOptions +NameWidth=*
IndexOptions +SuppressDescription

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t /resources /cgi-bin

IndexStyleSheet "/resources/style.css"

IndexHeadInsert "&lt;script type=\"text/javascript\"&gt;var _gaq = _gaq || [];_gaq.push(['_setAccount', '{INSERT TRACKING CODE HERE}']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();&lt;/script&gt;"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/adding-style-and-google-analytics-to-an-apache-directory-index-mod_autoindex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Native resolution not set after deploying via MDT 2010</title>
		<link>http://daniel.streefkerkonline.com/native-resolution-not-set-after-deploying-via-mdt-2010/</link>
		<comments>http://daniel.streefkerkonline.com/native-resolution-not-set-after-deploying-via-mdt-2010/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 03:58:36 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[MDT]]></category>
		<category><![CDATA[Windows Deployment]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=313</guid>
		<description><![CDATA[If your machines aren’t automatically having their display resolution set to their monitor’s native resolution after deployment via MDT, this may be the cause of the problem. Although I’d previously deployed Vista and Windows 7 using MDT 2010, I’d never &#8230; <a href="http://daniel.streefkerkonline.com/native-resolution-not-set-after-deploying-via-mdt-2010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If your machines aren’t automatically having their display resolution set to their monitor’s native resolution after deployment via MDT, this may be the cause of the problem.</p>
<p>Although I’d previously deployed Vista and Windows 7 using MDT 2010, I’d never seen this problem. The issue occurred with a captured HP ProBook x86 Windows 7 Professional build.</p>
<p>I had to edit the unattend.xml for the task sequence in question, and delete the <strong>Display</strong> section from <strong>oobeSystem –&gt; x86_Microsoft-Windows-Shell-Setup_neutral</strong>. Once this was done, the strange default of 1024 x 768 (where did that come from?) was no longer applied, and Windows Setup detected and set the maximum resolution.</p>
<p><a href="http://daniel.streefkerkonline.com/uploads/2012/01/WSIM-res_issue.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WSIM-res_issue" border="0" alt="WSIM-res_issue" src="http://daniel.streefkerkonline.com/uploads/2012/01/WSIM-res_issue_thumb.png" width="640" height="256"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/native-resolution-not-set-after-deploying-via-mdt-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MDT/WSIM fails to catalog a captured Windows 7 image</title>
		<link>http://daniel.streefkerkonline.com/mdtwsim-fails-to-catalog-a-captured-windows-7-image/</link>
		<comments>http://daniel.streefkerkonline.com/mdtwsim-fails-to-catalog-a-captured-windows-7-image/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 03:29:30 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[MDT]]></category>
		<category><![CDATA[Windows Deployment]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/?p=309</guid>
		<description><![CDATA[Had an issue today where I was trying to catalog a captured Windows 7 WIM image, both through MDT 2010 and through WSIM directly. Doing so comes up with an error: Performing operation "generate" on Target "Catalog". The operation failed &#8230; <a href="http://daniel.streefkerkonline.com/mdtwsim-fails-to-catalog-a-captured-windows-7-image/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Had an issue today where I was trying to catalog a captured Windows 7 WIM image, both through <a href="http://technet.microsoft.com/en-us/solutionaccelerators/dd407791" target="_blank">MDT 2010</a> and through <a href="http://technet.microsoft.com/en-us/library/cc766347(v=ws.10).aspx" target="_blank">WSIM</a> directly.</p>
<p>Doing so comes up with an error:</p>
<pre class="brush: plain;">Performing operation "generate" on Target "Catalog".
The operation failed to complete.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.ArgumentNullException: String reference not set to an instance of a String.
Parameter name: source
   at System.Globalization.CompareInfo.IsPrefix(String source, String prefix, CompareOptions options)
   at ?A0xfe36268f.ConvertToNtPath(String path)
   at Microsoft.ComponentStudio.ComponentPlatformInterface.CbsSessionAdaptor..ctor(String bootDrive, String imageWinDir, String servicingPath)
   at Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImageImpl.InitializePackages()
   at Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImageImpl..ctor(OfflineImageInfo imageInfo)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct&amp; signature, IntPtr declaringType)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Microsoft.ComponentStudio.ComponentPlatformInterface.Cpi.PlatformImplementation.CreateOfflineImageInstance(OfflineImageInfo imageInfo)
</pre>
<p><a href="http://daniel.streefkerkonline.com/uploads/2012/01/2012-01-06-11-55-50_DeploymentWorkbench-Deployment-Workbench_Deployment-Shares_Sydney-MDT-Depl.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="2012-01-06 11-55-50_DeploymentWorkbench - [Deployment Workbench_Deployment Shares_Sydney MDT Deploym" border="0" alt="2012-01-06 11-55-50_DeploymentWorkbench - [Deployment Workbench_Deployment Shares_Sydney MDT Deploym" src="http://daniel.streefkerkonline.com/uploads/2012/01/2012-01-06-11-55-50_DeploymentWorkbench-Deployment-Workbench_Deployment-Shares_Sydney-MDT-Depl1.png" width="586" height="484"></a></p>
<p>The captured image I was trying to work with was of a 32-bit machine, and the WAIK tools I have installed on my desktop are the 64-bit ones.</p>
<p>The solution, as I learned <a href="http://social.technet.microsoft.com/Forums/en-US/mdt/thread/7951520e-c223-4c90-93f3-5667da63674d/" target="_blank">here</a> after a bit of searching, is to re-run the catalog operation on an x86 machine. </p>
<p>As you can’t install the 32-bit tools on a 64-bit machine, I installed the 32-bit tools on my laptop, fired up WSIM, opened the WIM image, re-ran the catalog operation, and it succeeded without errors.</p>
<p>You’d think that they could catch the exception and give you a useful message about running the catalog again on a compatible machine, but no…</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/mdtwsim-fails-to-catalog-a-captured-windows-7-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell: Cancel all print jobs</title>
		<link>http://daniel.streefkerkonline.com/powershell-cancel-all-print-jobs/</link>
		<comments>http://daniel.streefkerkonline.com/powershell-cancel-all-print-jobs/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 04:18:05 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://daniel.streefkerkonline.com/powershell-cancel-all-print-jobs/</guid>
		<description><![CDATA[Here’s a quick PowerShell script I put together to delete all print jobs from our Windows Server 2008 R2 print server. It’s run overnight as a scheduled task. We do this because sometimes our print accounting software doesn’t clear out &#8230; <a href="http://daniel.streefkerkonline.com/powershell-cancel-all-print-jobs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here’s a quick PowerShell script I put together to delete all print jobs from our Windows Server 2008 R2 print server. It’s run overnight as a scheduled task. We do this because sometimes our <a href="http://www.papercut-mf.com/" target="_blank">print accounting software</a> doesn’t clear out old jobs if users haven’t <a href="http://www.papercut-mf.com/tour/secure-print-release/" target="_blank">released</a> them at the printer.</p>
<pre class="brush: ps;">$printers = Get-WmiObject Win32_Printer

if ($printers.Count -eq 0) {
    Write-Host -ForegroundColor red "No Printers Found"
    exit
}

foreach ($printer in $printers) {

    if ($printer.Local -and $printer.Shared)
    {
        Write-Host -ForegroundColor Green "Cancelling all jobs on: $($printer.Name)"
        $printer.CancelAllJobs()

    }
}</pre>
<p>It will only clear print jobs on local printers that are shared out. There’s some more info about the <a href="http://msdn.microsoft.com/en-us/library/aa394363(v=VS.85).aspx" target="_blank">Win32_Printer class</a> and the <a href="http://msdn.microsoft.com/en-us/library/aa384838(v=VS.85).aspx" target="_blank">CancelAllJobs method</a> on MSDN.</p>
<p><em><font style="background-color: #ffff00">Note that I haven’t included any error-checking in this script at all, so run it manually first to see if it will work. As always, run at your own risk.</font></em></p>
<p>To schedule it, simply create a new scheduled task:</p>
<ol>
<ol>
<li>Run with highest privileges
<li>Run whether user is logged on or not
<li>Do not store password
<li>Action: Start a program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
<li>Arguments: -File &#8220;C:\path-to-script-file\name-of-script-file.ps1&#8243;</li>
</ol>
</ol>
<p><a href="http://daniel.streefkerkonline.com/uploads/2011/11/clearqueues-generaltab.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clearqueues-generaltab" border="0" alt="clearqueues-generaltab" src="http://daniel.streefkerkonline.com/uploads/2011/11/clearqueues-generaltab_thumb.png" width="642" height="478"></a></p>
<p><a href="http://daniel.streefkerkonline.com/uploads/2011/11/clearqueues-action.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clearqueues-action" border="0" alt="clearqueues-action" src="http://daniel.streefkerkonline.com/uploads/2011/11/clearqueues-action_thumb.png" width="596" height="484"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.streefkerkonline.com/powershell-cancel-all-print-jobs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

