<?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>Bohack &#187; Windows</title>
	<atom:link href="http://www.bohack.com/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bohack.com</link>
	<description>Check In and Tune Out!</description>
	<lastBuildDate>Sun, 08 Jan 2012 20:59:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How To Use VLC and Register RTSP (RealMedia) for Internet Explorer</title>
		<link>http://www.bohack.com/2011/11/how-to-use-vlc-and-register-rtsp-realmedia-for-internet-explorer/</link>
		<comments>http://www.bohack.com/2011/11/how-to-use-vlc-and-register-rtsp-realmedia-for-internet-explorer/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 22:16:07 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Regedit]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=587</guid>
		<description><![CDATA[To register the RTSP protocol with Internet Explorer you need to register it with the operating system. This is easily achieved thru a registry edit. So once you register the RTSP with the .reg file below just close Internet Explorer and open it back up. <div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/11/how-to-use-vlc-and-register-rtsp-realmedia-for-internet-explorer/' addthis:title='How To Use VLC and Register RTSP (RealMedia) for Internet Explorer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Let me start off by saying I hate Real Player and discourage it&#8217;s use. Having said that an alternative is using VLC Media Player or Video LAN Player (same). It was once said that VLC could play a database file if you opened it up, so it definitely supports a simple RTSP Real Time Streaming Protocol URL. However for the end user it&#8217;s a little complicated, so to make it easier we can register RTSP:// with Internet Explorer and anytime the user comes across an RTSP link; it&#8217;ll just work!</p>
<p><span id="more-587"></span>To register the RTSP protocol with Internet Explorer you need to register it with the operating system. This is easily achieved thru a registry edit, however this article explains it all <a title="http://msdn.microsoft.com/en-us/library/Aa767914.aspx" href="http://msdn.microsoft.com/en-us/library/Aa767914.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/Aa767914.aspx</a>. So once you register the RTSP with the .reg file below just close Internet Explorer and open it back up. VLC will prompt you with a warning, if at this point it doesn&#8217;t show video; open TCP port 554 in your firewall outbound. If you do not have outbound restrictions, like in the case of 99% of home users; it either a bad feed or upgrade your VLC to the latest version.</p>
<p>Firefox will also see the registry change and when a user clicks the link; Firefox will prompt them with an application dialog box then open it in VLC Player. Just check the box to always open without prompting and it&#8217;ll work every time!</p>
<p>This fix will be valid for all users of the computer. I&#8217;m pretty sure you can register it under HKEY_CURRENT_USER on XP and above; to make the change for only that users.</p>
<p>RTSP registry edit file:</p>
<pre>Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\RTSP]
@="URL:Real Time Streaming Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\RTSP\shell]

[HKEY_CLASSES_ROOT\RTSP\shell\open]

[HKEY_CLASSES_ROOT\RTSP\shell\open\command]
@="C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe -vvv %1"</pre>
<p>Copy the text above into a file of RTSP.reg and double click it to merge it into the registry.</p>
<p><strong>Note: You may have to change the path where your VLC lives.</strong></p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/11/how-to-use-vlc-and-register-rtsp-realmedia-for-internet-explorer/' addthis:title='How To Use VLC and Register RTSP (RealMedia) for Internet Explorer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2011/11/how-to-use-vlc-and-register-rtsp-realmedia-for-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change The Label For CD or DVD Drives Under My Computer</title>
		<link>http://www.bohack.com/2011/07/change-the-label-for-cd-or-dvd-drives-under-my-computer/</link>
		<comments>http://www.bohack.com/2011/07/change-the-label-for-cd-or-dvd-drives-under-my-computer/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 20:15:43 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=552</guid>
		<description><![CDATA[The problem is that you can’t right click and go to properties to change the CDROM/DVD-RW label, like you can on a local disk.To change the label of a fixed drive with removable storage (CDROM/DVDROM/DVD-RW), you need to perform a registry edit.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/07/change-the-label-for-cd-or-dvd-drives-under-my-computer/' addthis:title='Change The Label For CD or DVD Drives Under My Computer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>On most of my Windows boxes I have multiple DVD-RW or CDROM drives. Telling them apart by the letter is always an issue, because I always put the blank CD or DVD in to the wrong drive. The problem is that you can’t right click and go to properties to change the CDROM/DVD-RW label, like you can on a local disk.<br />
<span id="more-552"></span><br />
<a href="http://www.bohack.com/wp-content/uploads/2011/07/computer-cdrom-label.jpg"  rel="lightbox[552]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/computer-cdrom-label-300x300-0-img555.jpg" alt="Changing the DVD or CD Label under my computer" title="my computer cdrom label" width="300" height="287" class="alignnone size-medium wp-image-555" /></a></p>
<p>To change the label of a fixed drive with removable storage (CDROM/DVDROM/DVD-RW), you need to perform a registry edit. Follow the steps below to create custom label so when you open “My Computer” or “Computer” (depending on OS version) you see the custom label. The steps below are for Windows 7, but should also work for Windows Vista, Windows XP and Windows 2000.</p>
<ol>
<li>In the run/search box type “regedit”. Find the icon for regedit.exe above and right click on it and choose “Run as administrator”. Answer the UAC prompt and click OK.</li>
<li>Find the registry key of “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons”.</li>
<li>Right click on the “DriveIcons” key and select “New -&gt; Key” then name the key the drive letter you want to label (i.e. Drive F create the key as F).</li>
<li>Right click on the drive letter and select “New -&gt; Key” then name the key “DefaultLabel” (case sensitive).</li>
<li>To the right on the result pane of the registry editor, double click the “(Default)” REG_SZ and change the “Value data:” to the label you want to show under My Computer.</li>
<li>Logoff and/or reboot.</li>
</ol>
<a href="http://www.bohack.com/wp-content/uploads/2011/07/registry-drive-icons.jpg"  rel="lightbox[552]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/registry-drive-icons-300x300-0-img557.jpg" alt="Registry entry for drive labels" title="registry drive icons" width="300" height="176" class="alignnone size-medium wp-image-557" /></a>
<p>Note: You can also do the same last three steps to change the Icon that shows in My Computer, create a “DefaultIcon” key. Change the “(Default)” key to the path of the icon to change the icon.</p>
<p>&nbsp;</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/07/change-the-label-for-cd-or-dvd-drives-under-my-computer/' addthis:title='Change The Label For CD or DVD Drives Under My Computer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2011/07/change-the-label-for-cd-or-dvd-drives-under-my-computer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Allowing Non-Administrators To Install Fonts In Windows 7</title>
		<link>http://www.bohack.com/2011/04/allowing-non-administrators-to-install-fonts-in-windows-7/</link>
		<comments>http://www.bohack.com/2011/04/allowing-non-administrators-to-install-fonts-in-windows-7/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 22:15:08 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=537</guid>
		<description><![CDATA[I will explain how to allow normal non-administrative users access to install their own fonts without the UAC prompt.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/04/allowing-non-administrators-to-install-fonts-in-windows-7/' addthis:title='Allowing Non-Administrators To Install Fonts In Windows 7 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Window 7 is far more secure than prior Windows operating systems. The Windows directory is secured down with permissions so even an Administrator cannot circumvent security. Some security features are good other not so much, the security on fonts is a good example. I will explain how to allow normal non-privileged users access to install their own fonts without the UAC prompt.</p>
<p><span id="more-537"></span>The Fonts directory is located in the Windows directory and if a normal user wants to install Fonts; they cannot. If a normal users tries to install a font they are prompted with the UAC (User Account Control) dialog box and Administrator credentials are required. If you work for a school or a print shop and do not want to give out Administrator credentials to install fonts read on.</p>
<p>The following steps will loosen up security in your operating system, so that normal users can install fonts without administrative credentials and the UAC prompt. This modification has been tested on Windows 7; however it should also work on Windows Vista as well. Please be careful when making changes that could open security holes. As of the writing of this article there are no security holes, but be vigilant and read Microsoft Security Bulletins in the future.</p>
<p><strong>Log on as an administrator to make the following changes!</strong></p>
<p>First we need to make the folder writable and make it a non-system folder.</p>
<pre>attrib -r -s c:\Windows\Fonts</pre>
<p>Next we need to take ownership. The /f directs it to the folder of c:\Windows\Fonts the /r directs it to recurse and the /d n is default answer is no or skip.</p>
<pre>takeown /f c:\Windows\Fonts /r /d n</pre>
<p>Now let’s give the users permission.</p>
<pre>cacls c:\Windows\Fonts /e /t /g users:c</pre>
<p>There is also a font cache that allows programs to display a preview of the fonts; this needs softened up as well for the user.</p>
<pre>cacls c:\Windows\System32\FNTCACHE.DAT /e /t /g users:c

Note: you will receive an Access is denied message, this is normal; just make sure users have change security permissions.</pre>
<p>The last thing to do is give users permissions to register fonts with Windows 7 in the registry. Use regedit and give users modify permissions to the following key in the registry.</p>
<pre>HKLM\Software\Microsoft\Windows NT\Current Version\Fonts</pre>
<p>See diagram:</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/04/HKLM-Fonts-Permissions.jpg"  rel="lightbox[537]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/HKLM-Fonts-Permissions-300x300-0-img540.jpg" alt="HKLMSoftwareMicrosoftWindows NTCurrent VersionFonts" title="HKLM-Fonts-Permissions" width="300" height="275" class="alignnone size-medium wp-image-540" /></a>
<p>That&#8217;s it you done&#8230; Log out and test as a normal / non-administrator by right clicking the font and selecting &#8220;Install&#8221; from the context menu.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/04/allowing-non-administrators-to-install-fonts-in-windows-7/' addthis:title='Allowing Non-Administrators To Install Fonts In Windows 7 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2011/04/allowing-non-administrators-to-install-fonts-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Windows Server 2008 R2 Breaks WPAD</title>
		<link>http://www.bohack.com/2011/02/windows-server-2008-r2-breaks-wpad/</link>
		<comments>http://www.bohack.com/2011/02/windows-server-2008-r2-breaks-wpad/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 02:35:03 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows 2008]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=515</guid>
		<description><![CDATA[I had just completed a successful upgrade of my domain controllers at work to Windows Server 2008 R2. After the upgrade we found that anyone that used the proxy and relied in automatic settings could no longer receive the proxy address. This is in “Automatically detect settings” in the “LAN settings” of Internet Explorer options. [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/02/windows-server-2008-r2-breaks-wpad/' addthis:title='Windows Server 2008 R2 Breaks WPAD ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>I had just completed a successful upgrade of my domain controllers at work to Windows Server 2008 R2. After the upgrade we found that anyone that used the proxy and relied in automatic settings could no longer receive the proxy address. This is in “Automatically detect settings” in the “LAN settings” of Internet Explorer options.</p>
<p><span id="more-515"></span>After some research I found a TechNet Article http://technet.microsoft.com/en-us/library/cc794902%28WS.10%29.aspx that explained the motivation behind this. Basically when Internet Explorer starts up, it starts with the default of “Automatically detect settings” checked in the “Local Area Network (LAN) Settings” dialog box in Internet Explorer Options. So every time it starts it queries for wpad.FQDN and if it resolves it then grabs the wpad.dat. When your client boots up and the DHCP will configure option 15 for the domain name it appends this to the wpad. An example: if you machine boots up and retrieves option 15 as contoso.com. Then IE will try to retrieve http://wpad.contoso.com/wpad.dat.</p>
<p>Now let me explain why: Microsoft uses dynamic updates in DNS. Since most people do not use wpad entries; it introduces an attack vector. A malicious user would name their client “wpad” and serve a wpad.dat file from the host of their web server. When their client boots up it will try to register itself as “wpad.contoso.com” and now potentially all of your clients are proxy-ed thru a malicious host.</p>
<p>Microsoft closed the hole by automatically denying resolution of wpad.FQDN entries in the “Global Query Block List”. Which regardless of which zones you host on Microsoft DNS servers it will deny resolution of the wpad.</p>
<p>To fix this you will need to run the commands below against each of your DNS servers:</p>
<p>To see the “Global Query Block List”</p>
<pre>dnscmd [&lt;ServerName&gt;] /info /globalqueryblocklist

example:
dnscmd 192.168.1.1 /info /globalqueryblocklist
</pre>
<p>To fix the problem in the “Global Query Block List”</p>
<pre>dnscmd [&lt;ServerName&gt;] /config /globalqueryblocklist [&lt;name&gt; [&lt;name&gt;]...]

example:
dnscmd 192.168.1.1 /config /globalqueryblocklist isatap
</pre>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/02/windows-server-2008-r2-breaks-wpad/' addthis:title='Windows Server 2008 R2 Breaks WPAD ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2011/02/windows-server-2008-r2-breaks-wpad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Make An Unattend.xml Sysprep File</title>
		<link>http://www.bohack.com/2011/01/how-to-make-an-unattend-xml-sysprep-file/</link>
		<comments>http://www.bohack.com/2011/01/how-to-make-an-unattend-xml-sysprep-file/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 21:17:28 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Sysprep]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=485</guid>
		<description><![CDATA[When you are cloning/imaging machines in mass it is extremely handy to automate as much as possible. Using the Windows AIK (Automated Installation Kit) specifically a tool called Windows SIM (System Image Manager) you can automate the entire process. The unattend.xml file is used along with sysprep to automate the image specialization and OOBE after it is cloned and rebooted.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/01/how-to-make-an-unattend-xml-sysprep-file/' addthis:title='How To Make An Unattend.xml Sysprep File ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Sysprep is very useful in preparing an image for cloning / imaging by stripping all specialization from the installation like: drives, SID, PNP enumeration, name and more. During the next reboot PNP is initiated and the Out Of Box Experience is run; this is similar to a preloaded laptop or computer from the factory starting up for the first time.<br />
<span id="more-485"></span><br />
When you are cloning/imaging machines in mass it is extremely handy to automate as much as possible. Using the Windows AIK (Automated Installation Kit) specifically a tool called Windows SIM (System Image Manager) you can automate the entire process. The unattend.xml file is used along with sysprep to automate the image specialization and OOBE after it is cloned and rebooted.</p>
<p>The following process will automate the sysprep so next reboot it will only ask for computer name. Some assumptions during this article are: you are creating an English/US install, you are using a KMS server and your timezone is EDT.</p>
<p>Step 1. &#8211; Download and install the latest WAIK from http://downloads.microsoft.com, the WAIK should support Windows 7 and 2008 R2 (check the date).</p>
<p>Step 2. &#8211; Get your media that you have installed with and mount it in the DVD-ROM or via and ISO mounting utility; if it is only and ISO. You will need to allow Windows SIM to access the install.wim in the next step.</p>
<p>Step 3. &#8211; Start Windows SIM and right click on “Select a Windows Image or Catalog” and find the “install.wim” in the sources directory on the media. In this tutorial I used x64 (amd64) media, this also works for x86 media; using the same steps.</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/Select-Windows-Image-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/Select-Windows-Image-SIM-300x300-0-img487.jpg" alt="Select Windows Image" title="Select Windows Image - SIM" width="300" height="240" class="alignnone size-medium wp-image-487" /></a>
<p>Step 4. &#8211; Now we need an answer file, so right click on “Create or open an answer file” and select “New Answer File”</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/New-Answer-File-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/New-Answer-File-SIM-300x300-0-img488.jpg" alt="New Answer File" title="New Answer File SIM" width="300" height="240" class="alignnone size-medium wp-image-488" /></a>
<p>Step 5. &#8211; On the left hand side open the “Components” folder and find “Microsoft-Windows-International-Core”, right click and select “Add Settings to Pass 7 oobeSystem”. It will be added to the answer file in the center.</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/Microsoft-Windows-International-Core-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/Microsoft-Windows-International-Core-SIM-300x300-0-img489.jpg" alt="Microsoft-Windows-International-Core" title="Microsoft-Windows-International-Core SIM" width="300" height="240" class="alignnone size-medium wp-image-489" /></a>
<p>Step 6. &#8211; Fill in the settings for InputLocale thru UserLocale in the properties pane; I used en-US for English language and United States locale. The “en-US” is defined in the RFC4646 actually two standards put together: the ISO 639-1 code for known languages and the ISO 3166-1 code for assigned country codes. Microsoft has an article of supported RFC4646 locales called the LCID reference http://msdn.microsoft.com/en-us/library/cc233965%28v=PROT.10%29.aspx</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/RFC4646-LCID-Locale.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/RFC4646-LCID-Locale-300x300-0-img490.jpg" alt="RFC4646 LCID Locale" title="RFC4646 LCID Locale" width="300" height="240" class="alignnone size-medium wp-image-490" /></a>
<p>Step 7. &#8211; On the left hand side under the “Components” folder and find “Microsoft-Windows-Shell-Setup_6.1.xxxxx”, right click and select “Add Settings to Pass 7 oobeSystem”. It will be added to the answer file in the center. Click on the Shell-Setup in the answer file section and fill in the TimeZone under properties. A list of these time zones can be found here http://technet.microsoft.com/en-us/library/cc749073%28WS.10%29.aspx.</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/Shell-Setup-Timezone-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/Shell-Setup-Timezone-SIM-300x300-0-img498.jpg" alt="Shell Setup Timezone" title="Shell Setup Timezone SIM" width="300" height="240" class="alignnone size-medium wp-image-498" /></a>
<p>Step 8. &#8211; Open the “Microsoft-Windows-Shell-Setup” folder in the answer file and find OOBE and click on it. In the properties page set “HideEULAPage” to true and Network Location to Work, Public or Home. The “ProtectYourPC” property can be set to: 1 for recommended protection, 2 for updates only and 3 for automatic protection to be disabled. These all related to the Windows Update protection. http://technet.microsoft.com/en-us/library/cc749278%28WS.10%29.aspx</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/OOBE-Settings-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/OOBE-Settings-SIM-300x300-0-img491.jpg" alt="OOBE Settings" title="OOBE Settings SIM" width="300" height="240" class="alignnone size-medium wp-image-491" /></a>
<p>Step 9. &#8211; We need to setup the first administrator account since Windows 7’s administrator account is disabled by default. Further down under “Microsoft-Windows-Shell-Setup” click on “UserAccounts” then right click on “LocalAccounts” and select “Insert New LocalAccount”.</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/Insert-New-LocalAccount.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/Insert-New-LocalAccount-300x300-0-img492.jpg" alt="Insert New LocalAccount" title="Insert New LocalAccount" width="300" height="240" class="alignnone size-medium wp-image-492" /></a>
<p>Step 10. &#8211; In the properties of the local account on the right side; fill out Description, DisplayName and Name. The Group must be “administrators”, so that you can locally administrate the computer (i.e. login local).</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/LocalAccount-Poperties-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/LocalAccount-Poperties-SIM-300x300-0-img493.jpg" alt="LocalAccount Poperties" title="LocalAccount Poperties SIM" width="300" height="240" class="alignnone size-medium wp-image-493" /></a>
<p>Step 11. &#8211; Click on “Password” under the “LocalAccount[Name=”username”] and in the properties pane set the password for the account. The password will be saved in the XML file however it will be encrypted (the encryption used is unspecified in Microsoft’s documentation).</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/LocalAccount-Password-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/LocalAccount-Password-SIM-300x300-0-img494.jpg" alt="LocalAccount Password" title="LocalAccount Password SIM" width="300" height="240" class="alignnone size-medium wp-image-494" /></a>
<p>Step 12. &#8211; On the left hand side under the “Components” folder and find “Microsoft-Windows-Shell-Setup_6.1.xxxxx”, right click and select “Add Settings to Pass 4 specialize”. It will be added to the answer file in the center; respectively under “4 Specialize”. Click on the Shell-Setup in the answer file section and fill in the “ProductKey” with the default KMS key found here http://technet.microsoft.com/en-us/library/ff793406.aspx. These product keys will not activate via Microsoft (retail), instead they are dummy keys for a Key Management Server to activate. The product key I used was for Windows 7 Enterprise “33PXH-7Y6KF-2VJC9-XBBR8-HVTHH”. Setting this will skip the activation question during setup, but make sure you have a KMS server running. Also make sure you have met the 25 client threshold or the KMS will not activate any of the clients. http://technet.microsoft.com/en-us/library/ff793434.aspx</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/KMS-Serial-Number-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/KMS-Serial-Number-SIM-300x300-0-img495.jpg" alt="KMS Serial Number" title="KMS Serial Number SIM" width="300" height="240" class="alignnone size-medium wp-image-495" /></a>
<p>Step 13. &#8211; Right click on the answer file and choose “Close Answer File” when prompted save it as “unattend.xml”.</p>
<a href="http://www.bohack.com/wp-content/uploads/2011/01/Save-Unattend.xml-SIM.jpg"  rel="lightbox[485]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/Save-Unattend.xml-SIM-300x300-0-img496.jpg" alt="Save Unattend.xml" title="Save Unattend.xml SIM" width="300" height="240" class="alignnone size-medium wp-image-496" /></a>
<p>Step 14. &#8211; Copy the unattend.xml into “C:\windows\system32\sysprep” folder and create a startprep.cmd file containing the code below. The startprep.cmd file is not totally necessary, however I find it is best consistency; so the next time you do this you have the command at hand. You could just type the command into a CMD prompt.</p>
<pre>startprep.cmd

@echo off
cd c:\windows\system32\sysprep sysprep /oobe /generalize /unattend:c:\windows\system32\sysprep\unattend.xml
</pre>
<p>Step 15. &#8211; Run the startprep.cmd and the system will sysprep revert its specialized settings and drivers and shutdown. Create an image of the workstation using your favorite image software and distribute the image to other workstations. When they restart the unattend.xml file will be run along with sysprep and you will only be prompted for computer name.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/TkatLdaWQ7A?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/TkatLdaWQ7A?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1&amp;color1=0x006699&amp;color2=0x54abd6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<pre>
example unattend.xml

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;unattend xmlns="urn:schemas-microsoft-com:unattend"&gt;
&lt;settings pass="oobeSystem"&gt;
&lt;component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;InputLocale&gt;en-US&lt;/InputLocale&gt;
&lt;SystemLocale&gt;en-US&lt;/SystemLocale&gt;
&lt;UILanguage&gt;en-US&lt;/UILanguage&gt;
&lt;UILanguageFallback&gt;en-US&lt;/UILanguageFallback&gt;
&lt;UserLocale&gt;en-US&lt;/UserLocale&gt;
&lt;/component&gt;
&lt;component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;OOBE&gt;
&lt;HideEULAPage&gt;true&lt;/HideEULAPage&gt;
&lt;NetworkLocation&gt;Work&lt;/NetworkLocation&gt;
&lt;ProtectYourPC&gt;1&lt;/ProtectYourPC&gt;
&lt;/OOBE&gt;
&lt;UserAccounts&gt;
&lt;LocalAccounts&gt;
&lt;LocalAccount wcm:action="add"&gt;
&lt;Password&gt;
&lt;Value&gt;cABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=&lt;/Value&gt;
&lt;PlainText&gt;false&lt;/PlainText&gt;
&lt;/Password&gt;
&lt;Description&gt;First Admin User&lt;/Description&gt;
&lt;DisplayName&gt;User&lt;/DisplayName&gt;
&lt;Group&gt;administrators&lt;/Group&gt;
&lt;Name&gt;User&lt;/Name&gt;
&lt;/LocalAccount&gt;
&lt;/LocalAccounts&gt;
&lt;/UserAccounts&gt;
&lt;TimeZone&gt;Eastern Standard Time&lt;/TimeZone&gt;
&lt;/component&gt;
&lt;/settings&gt;
&lt;settings pass="specialize"&gt;
&lt;component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ProductKey&gt;33PXH-7Y6KF-2VJC9-XBBR8-HVTHH&lt;/ProductKey&gt;
&lt;/component&gt;
&lt;/settings&gt;
&lt;cpi:offlineImage cpi:source="wim:h:/sources/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /&gt;
&lt;/unattend&gt;
</pre>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2011/01/how-to-make-an-unattend-xml-sysprep-file/' addthis:title='How To Make An Unattend.xml Sysprep File ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2011/01/how-to-make-an-unattend-xml-sysprep-file/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Windows Server 2008 Replacement of ProxyCfg.exe</title>
		<link>http://www.bohack.com/2010/08/windows-server-2008-replacement-of-proxycfg-exe/</link>
		<comments>http://www.bohack.com/2010/08/windows-server-2008-replacement-of-proxycfg-exe/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 00:39:20 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=416</guid>
		<description><![CDATA[When setting up a secure server farm you always want to filter egress traffic. This means that all outbound traffic is blocked by default, including the web traffic from the servers. When surfing is required for drivers and downloads, this is usually handled by setting the proxy in the Internet Explorer options.  However if you want certain processes / services like Windows Update to automatically retrieve updates and wait for manual approval, the next time you login. You need to set a proxy server up and force the Local Machine to use it. The setting in the IE properties page is for the Current User only.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2010/08/windows-server-2008-replacement-of-proxycfg-exe/' addthis:title='Windows Server 2008 Replacement of ProxyCfg.exe ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>When setting up a secure server farm you always want to filter egress traffic. This means that all outbound traffic is blocked by default, including the web traffic from the servers. When surfing is required for drivers and downloads, this is usually handled by setting the proxy in the Internet Explorer options.  However if you want certain processes / services like Windows Update to automatically retrieve updates and wait for manual approval, the next time you login. You need to set a proxy server up and force the Local Machine to use it. The setting in the IE properties page is for the Current User only.</p>
<p><span id="more-416"></span>In Windows XP and Windows 2003 this was done via the command proxycfg.exe. You would simply set and unset the &#8220;Local Machine&#8221; proxy with the commands:</p>
<pre>The old way to set the "Local Machine" proxy:

Proxycfg –p {proxy address:port} {bypass list}

Proxycfg -p "proxy.bohack.com:8180" "&lt;local&gt;;*.bohack.com"

The old way to unset it:

Proxycfg –d
</pre>
<p>It basically sets the registry value below, to the values you specify in with the proxycfg command.</p>
<pre>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\WinHttpSettings</pre>
<p>So what happened to the &#8220;proxycfg.exe&#8221; command? Starting in Vista, Windows Server 2008 and Windows 7 you will no longer find the proxycfg command. It has now been replaced with the &#8220;netsh&#8221; command. This command can be used either interactively by tying &#8220;netsh&#8221; and navigating the tree of commands or used in a one line command sequence, like shown below.</p>
<pre>The new way to set the "Local Machine" Proxy:

netsh winhttp set proxy {proxy address:port} {bypass list}

netsh winhttp set proxy "proxy.bohack.com:8180" "&lt;local&gt;;*.bohack.com"

The new way to unset it:

netsh winhttp reset proxy

Check the settings with:

netsh winhttp show proxy
</pre>
<p>The new commands change the same registry value above, the only thing that changed it the command to set and unset the Local Machine proxy. Theoretically you could export out the registry setting and import it onto another machine.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2010/08/windows-server-2008-replacement-of-proxycfg-exe/' addthis:title='Windows Server 2008 Replacement of ProxyCfg.exe ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2010/08/windows-server-2008-replacement-of-proxycfg-exe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mastering Permissions with icacls.exe Command thru the GUI</title>
		<link>http://www.bohack.com/2009/12/mastering-permissions-with-icacls-exe-command-thru-the-gui/</link>
		<comments>http://www.bohack.com/2009/12/mastering-permissions-with-icacls-exe-command-thru-the-gui/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 15:41:37 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=350</guid>
		<description><![CDATA[The key to mastering permissions at the command line in Vista and Windows Server 2008 Server is learning the icacls.exe command. With the introduction of Windows Vista, you can no longer select multiple items like folders and files and apply permissions to a group of objects.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mastering-permissions-with-icacls-exe-command-thru-the-gui/' addthis:title='Mastering Permissions with icacls.exe Command thru the GUI ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>The key to mastering permissions at the command line in Vista and Windows Server 2008 Server is learning the icacls.exe command. With the introduction of Windows Vista, you can no longer select multiple items like folders and files and apply permissions to a group of objects. The recommended way is to use the command line and the icacls.exe command.</p>
<p><span id="more-350"></span><br />
The icacls.exe command was introduced in Windows 2003 Service Pack 2. It now comes installed by default in Windows Vista, Windows Server 2008 (R2) and Windows 7. So administrators will need to learn this command sooner or later. Recently I found the tool to be very flexible and I extensively documented the options. I mapped the different command line options to the GUI, for the network admins that need the GUI to understand how to use the command line.</p>
<p>The first point that should be made about icacls.exe is that it defaults to edit mode. The original cacls command defaults to replace mode. Next are the commands:</p>
<pre>/grant will grant user permissions or the add option in the GUI.
/remove will remove the user from the DACL and is equivalent to
 the remove option in the GUI.

Note: /remove:g will remove only grants for the user
      and /remove:d will remove only denys for the user.

/deny is equivalent to the deny column in the GUI
 and should always be used cautiously.
/setowner is a handy little command which allows you to change
 the ownership of a file or folder to another user;
 this is similar to the linux chown command.
/findsid which finds entries in a DACL for a specified SID or user.
/setintegritylevel is a bit out of the scope of this article
 and may be in a future article.</pre>
<p>The icacls command also has an /inheritance command which performs the same function as un-checking the “Include inheritable permission from this object’s parent” in the GUI. This of course presents you with the question of how to proceed; copy the permissions or remove all existing permissions. So the command line you can specify:</p>
<pre>/inheritance:e to enable same as a check box in the GUI.
/inheritance:d to disable and copy the permissions
 from the parent same as the GUI.
/inheritance:r to disable and remove the
 current permissions again same as the GUI.</pre>
<a href="http://www.bohack.com/wp-content/uploads/2009/12/icacls-gui.jpg"  rel="lightbox[350]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/icacls-gui-150x150-1-img355.jpg" alt="Windows GUI mapped to icacls commands" title="icacls-gui" width="150" height="150" class="aligncenter size-thumbnail wp-image-355" /></a>
<p>The next thing to learn is how inheritance is propagated for permissions. When using either the /grant or /deny statement you will build the permissions as <em>/grant {user}:{inheritance}{permissions}</em> everything is encapsulated by parenthesis. The default in Windows when applying permissions in the GUI is “This folder, subfolders and files”, but to achieve the default at the command line you need to use <em>/grant {user}: (OI)(CI){permissions}</em> and the permissions should be encapsulated in parenthesis. The table below is to help you formulate your inheritance for permissions:</p>
<pre>This folder only
This folder, subfolders and files (OI)(CI)
This folder and subfolders (CI)
This folder and files (OI)
Subfolders and files only (OI)(CI)(NP)(IO)
Subfolders only (CI)(IO)
Files only (OI)(IO)</pre>
<p>The last thing to learn is the permissions. You can use macro permissions, which are also called simple permissions or you can use advanced permissions. The simple permissions are the permissions found in the first properties tab under security. The advanced permissions are when you select advanced and you get the full permissions list. So building on the permissions line from above; if we wanted to grant testuser on the folder test and apply modify permissions so all subfolders and files inherited the permissions. The line would be ‘<em>icacls test /grant testuser:(OI)(CI)(M)</em>’</p>
<pre>Simple Permissions

Full Control (F)
Modify (M)
Read &amp; Execute (RX)
List Folder Contents (X,RD,RA,REA,RC)
Read (R)
Write (W)

Advanced Permissions

Full Control (F)
Traverse folder / execute file (X)
List folder / read data (RD)
Read attributes (RA)
Read extended attributes (REA)
Create file / write data (WD)
Create folders / append data (AD)
Write attributes (WA)
Write extended attributes (WEA)
Delete subfolders and files (DC)
Delete (D)
Read permissions (RC)
Change permissions (WDAC)
Take ownership (WO)</pre>
<p>When you master this command you will be able to do anything with permissions from the command line. Including understanding the SDDL or Security Descriptor Definition Language; which Microsoft uses to create group policy permissions.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mastering-permissions-with-icacls-exe-command-thru-the-gui/' addthis:title='Mastering Permissions with icacls.exe Command thru the GUI ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2009/12/mastering-permissions-with-icacls-exe-command-thru-the-gui/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Mac OS X Permissions Problems with Window Server 2003 R2</title>
		<link>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/</link>
		<comments>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 03:11:34 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=336</guid>
		<description><![CDATA[A user on a Mac OS X client with not be able to drag files into the folder or perform a copy procedure and will result in the error: "You may need to enter the name and password for an administrator on this computer to change the item name "item-name".".<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/' addthis:title='Mac OS X Permissions Problems with Window Server 2003 R2 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Recently I found a problem when using Mac OS X and Windows Server 2003 R2 as a file server. The problem exists in the permissions that are applied to user folders. When applying permissions to shares you normally start out with a very restrictive permission structure at the top. As you create the folders you add permissions for users and groups to permit and restrict access for others. This structure of permissions is very common in dealing with corporate shares. We also share the folder with ‘domain users’ only having change or modify access to the entire share. This eliminates people applying their own permissions and locking everyone out including themselves. This is a common task for a network admin in setting up permissions.<br />
<span id="more-336"></span><br />
We have a Windows Server 2003 R2 file server with a directory called ‘Drives’ this directory is shared with ‘Domain Admins’ and ‘System’ Full Control and ‘Domain Users’ Change Control. Under this directory the permissions are structures as follows at the NTFS level. Domain Users have Read permissions only to the folder and does not inherit down to other folders. This allows a Domain User to read the directory names, but not access the contents in each of the folders. Each folder at this level is names according to the user that owns the content. On these folders we add the domain user’s username with Change control and we allow the permissions to inherit to all child folders and file below.</p>
<p>The problem exists when you use a script to create the folders and apply the permissions using the cacls.exe command on a Windows 2003 R2 server. A user on a Mac OS X client with not be able to drag files into the folder on a Windows 2003 R2 server share or perform a copy procedure and will result in the error: <strong>&#8220;You may need to enter the name and password for an administrator on this computer to change the item name &#8220;item-name&#8221;</strong>.&#8221;. You may also see the exclamation error if the file has a preview fork attached of <strong>&#8220;Couldn&#8217;t open the file. It may be corrupt or a file format that Preview doesn&#8217;t recognize.&#8221;</strong>. After much reading on this problem I was almost convinced that it was an OS X bug, but I realize now it is actually a flaw in the cacls command. We use a script similar to the snippet of code below to create the directories.</p>
<pre>mkdir \\server\share\userdir
cacls \\server\share\userdir /e /t /g userdir:c

explanation:

cacls {file or folder} /e {edits} /t {changes on all sub directories} /g {grants} userdir:c {user:permission of change}</pre>
<p>The problem was solved using the command that was introduced in Vista and Server 2003 R2 called icacls.exe. The icacls tool is now included in Windows Server Service Pack 2 and is standard in Vista. This command allows you to set inheritance, which is the root cause of the problem. The inheritance properties were first introduced in NTFS 5.0 with Windows 2000, however something has changed recently in the OS X 10.5 software or Windows Server 2003 R2. The problem also exists in Windows Server 2008 and Windows Server 2008 R2 so the problem is not going away and I am guessing it is OSX at fault.</p>
<p>When setting a directory with the code above, if you use the icacls command to export the permissions structure out to a file you can see the problem. This will export the security into Microsoft’s SDDL language which is documented here http://msdn.microsoft.com/en-us/library/aa379567(VS.85).aspx.</p>
<pre>icacls.exe \\server\share\userdir /save aclfile.txt

notepad.exe aclfile.txt

D:(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) (A;OICIID;FA;;;DA)(A;OICIID;FA;;;SY)
(user:chage) (domain admin:full) (system:full)</pre>
<p>The problem is not is not evident until we set the permission properly with the icacls.exe command.</p>
<pre>icacls \\server\share\userdir /t /c /grant userdir:(OI)(CI)M

explanation:

icacls {file or folder} /t {changes on all sub directories} /grant {grants} userdir:(OI)(CI) {see below}M { change/modify }

CI CONTAINER INHERIT
OI OBJECT INHERIT
NP NO PROPAGATE INHERIT
IO INHERIT ONLY
ID INHERITED
SA SUCCESSFUL ACCESS FLAG
FA FAILED ACCESS FLAG

Complete list http://msdn.microsoft.com/en-us/library/aa374928(VS.85).aspx

D:AI(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) (A;OICIID;FA;;;DA)(A;OICIID;FA;;;SY)

Explanation:

D: - Defines the DACL
AI - is the MISSING Auto Inheritance Flag
(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) - is the user’s SID and permissions
(A;OICIID;FA;;;DA) - is the “Domain Admin” permissions identified by the trailing DA
(A;OICIID;FA;;;SY) - is the “System” permissions identified by the trailing SY</pre>
<p>The AI in the DACL or Discretionary Access Control List is missing when using the cacls command. My guess is that the client when using Windows is responsible for the completion and writing of the DACL. When a Mac OS X client copies a file they utilize SAMBA which does not carry the DACL and consequentially fails. This would explain the empty file that gets created when an OS X client drags and drops the file. The file entry gets created, but is inherited with only the original permissions that have inheritance from above. This same problem could also exist on Linux or UNIX using SAMBA since it is SAMBA that drops the ball.</p>
<p>The Fix:</p>
<p>Use ‘icacls \\server\share\userdir /t /c /grant username:(OI)(CI)M’ to grant access to NTFS folders and replace all entries in scripts using the cacls command.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/' addthis:title='Mac OS X Permissions Problems with Window Server 2003 R2 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get the URL from a hyperlink in Excel</title>
		<link>http://www.bohack.com/2009/06/get-the-url-from-a-hyperlink-in-excel/</link>
		<comments>http://www.bohack.com/2009/06/get-the-url-from-a-hyperlink-in-excel/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 17:01:59 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=324</guid>
		<description><![CDATA[Recently I needed to extract a links from a web page; normally I would use some Linux commands ported to windows and get the job done. In the end I needed to format the relative link to a full URL, so I decided to use Excel. However when I imported the web page into excel [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/06/get-the-url-from-a-hyperlink-in-excel/' addthis:title='Get the URL from a hyperlink in Excel ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to extract a links from a web page; normally I would use some Linux commands ported to windows and get the job done. In the end I needed to format the relative link to a full URL, so I decided to use Excel. However when I imported the web page into excel I found that the URL was embedded in the friendly name of the hyperlink.</p>
<p><span id="more-324"></span>The hyperlink command in excel actually does the reverse of what I needed; it creates a hyperlink out of the URL and a friendly name and I needed the URL from the friendly name. So I dug in a little deeper and treated the URL like an object. It has properties and those properties can be exposed. The hyperlinkcell object has a type of range so it is passed to the function of GETURL. The first hyperlink in the range we will want the property of the address. Then we simply pass it back to the function so that we can display it.</p>
<p>To install this all you need to do is:</p>
<ol>
<li>Hit ALT + F11 (Opens Visual Basic Editor)</li>
<li>Click on Insert -&gt; Module (adds a module to your excel file)</li>
<li>Paste the code below for the function of GETURL</li>
<li>Hit ALT + Q (Closes the Visual Basic Editor)</li>
</ol>
<p>Now use the =GETURL(cell) to get the URL</p>
<p>Example: =GETURL(A1) will return the URL for the Hyperlink displayed in cell A1</p>
<pre>Function GETURL(HyperlinkCell As Range)

 GETURL = HyperlinkCell.Hyperlinks(1).Address

End Function</pre>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/06/get-the-url-from-a-hyperlink-in-excel/' addthis:title='Get the URL from a hyperlink in Excel ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2009/06/get-the-url-from-a-hyperlink-in-excel/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>How to Default Back to Search Companion</title>
		<link>http://www.bohack.com/2009/02/how-to-default-back-to-search-companion/</link>
		<comments>http://www.bohack.com/2009/02/how-to-default-back-to-search-companion/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 14:59:26 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=272</guid>
		<description><![CDATA[Microsoft Search should not be feared, it is now an optional install from Microsoft Update Services. It is integrates into Office 2007 for email search capability. However one problem is it changes the default search of Windows Explorer to Desktop Search. So it has pissed off a lot of people and made them uninstall it. [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/02/how-to-default-back-to-search-companion/' addthis:title='How to Default Back to Search Companion ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Microsoft Search should not be feared, it is now an optional install from Microsoft Update Services. It is integrates into Office 2007 for email search capability. However one problem is it changes the default search of Windows Explorer to Desktop Search. So it has pissed off a lot of people and made them uninstall it. There is hope and a way to switch it back.</p>
<p><span id="more-272"></span>Yep, it&#8217;s replaced the standard Windows search companion (and the friendly dog â€“ Rover from MS Bob). That&#8217;s all well and good, except it&#8217;s an indexed search so doesn&#8217;t necessarily reflect what&#8217;s really on disk. And since by default my program files folder isn&#8217;t indexed, it never shows any results no matter what I search for &#8211; until I go in and change the settings then wait for it to get around to indexing the folders.</p>
<p>There&#8217;s a link at the bottom of the tab to use the trusty old search companion, but it means clicking it every time. Oh, and before you ask, no, there isn&#8217;t an option to disable this irritating integration in WDS! I hate it when software comes along and arrogantly replaces existing functionality with itself and gives no way to remove it.</p>
<p>You can in fact turn it off&#8230; Simply open RegEdit (hit Start &gt; Run then type &#8216;<strong>regedit</strong>&#8216;).<br />
Go to the following node:</p>
<p><strong>HKEY_CURRENT_USER\Software\Microsoft\Windows Desktop Search\DS</strong></p>
<p>Then double-click on &#8216;<strong>ShowStartSearchBand</strong>&#8216; and set the value to &#8216;<strong>0</strong>&#8216;. Close that and you&#8217;re done. The next time you click &#8216;Search&#8217; in explorer the old and reliable search companion will appear. This applies to operating systems before Windows Vista, since Vista has far better search that actually works!</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/02/how-to-default-back-to-search-companion/' addthis:title='How to Default Back to Search Companion ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2009/02/how-to-default-back-to-search-companion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

