<?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>..::\\ www.christiano.ch //::.. &#187; Microsoft</title>
	<atom:link href="http://www.christiano.ch/wordpress/category/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christiano.ch/wordpress</link>
	<description>christiano.ch blog - personal knowledge base, news, memoires et cetera</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:28:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>Disable &#8220;No Internet Access&#8221; notification on Windows Server 2008 (R2)</title>
		<link>http://www.christiano.ch/wordpress/2012/01/05/disable-no-internet-access-notification-on-windows-server-2008-r2/</link>
		<comments>http://www.christiano.ch/wordpress/2012/01/05/disable-no-internet-access-notification-on-windows-server-2008-r2/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 06:55:26 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows General]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>
		<category><![CDATA[GPMC]]></category>
		<category><![CDATA[GPO]]></category>
		<category><![CDATA[Notifications]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2012/01/05/disable-no-internet-access-notification-on-windows-server-2008-r2/</guid>
		<description><![CDATA[The “No Internet Access” notification on the network connection icon usually appears when you’re not connected to the Internet or you probably behind a proxy server. However, when you setting up your servers in an isolated environment without Internet access &#8230; <a href="http://www.christiano.ch/wordpress/2012/01/05/disable-no-internet-access-notification-on-windows-server-2008-r2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="2" width="675">
<tbody>
<tr>
<td valign="top" width="233"><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2012/01/w2k8r2_nointernetaccess.jpg"><img style="display: inline" title="w2k8r2_nointernetaccess" alt="w2k8r2_nointernetaccess" src="http://www.christiano.ch/wordpress/wp-content/uploads/2012/01/w2k8r2_nointernetaccess_thumb.jpg" width="203" height="104" /></a></td>
<td valign="top" width="441">The “No Internet Access” notification on the network connection icon usually appears when you’re not connected to the Internet or you probably behind a proxy server. However, when you setting up your servers in an isolated environment without Internet access and you want to disable this notification then: </td>
</tr>
</tbody>
</table>
<p><span id="more-1273"></span>
<ol>
<li>Open the <strong><em>GPMC.msc</em></strong>. </li>
<li>Create or open a GPO which will be applied to your server(s). </li>
<li>Navigate to <strong><em>Computer Configuration\Policies\Administrative Templates\Network\Network Connections</em></strong>. </li>
<li>Enable the “<strong><em>Do not show the “local access only” network icon</em></strong>” setting. </li>
<li>Close the GPO and GPMC.msc. </li>
<li>Run <strong><em>C:\&gt;gpupdate</em></strong> on the server(s) to apply the new policy. </li>
</ol>
<p>The “No Internet Access” notification should be disabled now. </p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Disable+%E2%80%9CNo+Internet+Access%E2%80%9D+notification+on+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1273" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Disable+%E2%80%9CNo+Internet+Access%E2%80%9D+notification+on+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1273" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2012/01/05/disable-no-internet-access-notification-on-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export and Import Mailbox data to a PST file on Exchange Server 2007</title>
		<link>http://www.christiano.ch/wordpress/2012/01/05/export-and-import-mailbox-data-to-a-pst-file-on-exchange-server-2007/</link>
		<comments>http://www.christiano.ch/wordpress/2012/01/05/export-and-import-mailbox-data-to-a-pst-file-on-exchange-server-2007/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 06:49:07 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PST]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2012/01/05/export-and-import-mailbox-data-to-a-pst-file-on-exchange-server-2007/</guid>
		<description><![CDATA[This procedure describes how to export all mailboxes from one Exchange Server to a PST files and how to import the PST files to another Exchange Server in a different domain. Before you begin make sure that: You have a &#8230; <a href="http://www.christiano.ch/wordpress/2012/01/05/export-and-import-mailbox-data-to-a-pst-file-on-exchange-server-2007/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This procedure describes how to export all mailboxes from one Exchange Server to a PST files and how to import the PST files to another Exchange Server in a different domain. Before you begin make sure that: </p>
<p><span id="more-1270"></span>
<ul>
<li>You have a computer that has Outlook 2003 (SP2) or 2007, Exchange 2007 Management Tools (32-bit version), PowerShell and .NET Framework installed </li>
<li>Logon with an account that has Exchange Server Administrator and Local Administrator rights </li>
<li>You have full access to the users’ mailbox on both servers. See the note below on how to do it. </li>
</ul>
<p>&#160;</p>
<ul>
<ol>
<li>Start the Exchange Management Shell and type the following:<strong><em>[PS] C:\&gt;Get-Mailbox –Database “&lt;Exchange Server FQDN&gt;\&lt;Database Name&gt;” | Export-Mailbox –PSTFolderPath C:\PSTFiles</em></strong> to export all users mailbox to a PST file. Press A for Yes to All. Depending on the size of your database, the export procedure could take a long time to complete. </li>
<li>Now the mailboxes are exported to the PST files, make sure that the PST file name matches the alias of the users’ account in the other domain. </li>
<li>Next, import the PST files to the other Exchange Server by typing the following: <strong><em>[PS] C:\&gt;Get-Mailbox –Database “&lt;Exchange Server FQDN&gt;\&lt;Database Name&gt;” | Import-Mailbox –PSTFolderPath C:\PSTFiles</em></strong> and press A for Yes for All. Wait until the import operation completes.</li>
</ol>
<p><strong><em>Note:</em></strong>      <br />To grant the Administrator Full Access rights on the database type the following command:      <br /><strong><em>[PS] C:\&gt;Get-Mailbox -Database “&lt;Exchange Server FQDN&gt;\&lt;Database Name&gt;” | Add-ADPermission -User Administrator -AccessRights GenericAll</em></strong></p>
</ul>
<ol></ol>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Export+and+Import+Mailbox+data+to+a+PST+file+on+Exchange+Server+2007+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1270" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Export+and+Import+Mailbox+data+to+a+PST+file+on+Exchange+Server+2007+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1270" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2012/01/05/export-and-import-mailbox-data-to-a-pst-file-on-exchange-server-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modify the Computer icon text to show logged on username in Windows Server 2008 (R2)</title>
		<link>http://www.christiano.ch/wordpress/2012/01/05/modify-the-computer-icon-text-to-show-logged-on-username-in-windows-server-2008-r2/</link>
		<comments>http://www.christiano.ch/wordpress/2012/01/05/modify-the-computer-icon-text-to-show-logged-on-username-in-windows-server-2008-r2/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 06:45:55 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tips n'Tricks]]></category>
		<category><![CDATA[Windows General]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2012/01/05/modify-the-computer-icon-text-to-show-logged-on-username-in-windows-server-2008-r2/</guid>
		<description><![CDATA[Changing the text on the Computer icon on your Remote Desktop Services Session Host is handy when a user calls you and you want to know which Session Host the user is logged on. The procedure to do this has &#8230; <a href="http://www.christiano.ch/wordpress/2012/01/05/modify-the-computer-icon-text-to-show-logged-on-username-in-windows-server-2008-r2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Changing the text on the Computer icon on your Remote Desktop Services Session Host is handy when a user calls you and you want to know which Session Host the user is logged on. The procedure to do this has changed since Windows Server 2003.</p>
<p><span id="more-1269"></span>
<p>Follow these steps to change the text on a Windows Server 2008 (R2) machine: </p>
<ol>
<li>Logon to your server with the Administrator account. </li>
<li>Start RegEdit and navigate to the following key: <strong><em>HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}</em></strong></li>
<li>If necessary, take the ownership of this key, grant yourself full control rights and then edit the<strong><em> LocalizedString</em></strong> value. </li>
<li>In the edit window type:<strong><em> %UserName% on %ComputerName%</em></strong>. Click OK and close RegEdit. </li>
<li>Press F5 somewhere on the desktop and the text on the Computer icon should now display the logged on user name. </li>
</ol>
<p>Tested on Windows Server 2008 R2 Build 7600.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Modify+the+Computer+icon+text+to+show+logged+on+username+in+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1269" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Modify+the+Computer+icon+text+to+show+logged+on+username+in+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1269" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2012/01/05/modify-the-computer-icon-text-to-show-logged-on-username-in-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchronize time with external NTP server on Windows Server 2008 (R2)</title>
		<link>http://www.christiano.ch/wordpress/2012/01/05/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/</link>
		<comments>http://www.christiano.ch/wordpress/2012/01/05/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 06:44:02 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>
		<category><![CDATA[external]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[w32time]]></category>
		<category><![CDATA[w32tm]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2012/01/05/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/</guid>
		<description><![CDATA[Time synchronization is an important aspect for all computers on the network. By default, the clients computers get their time from a Domain Controller and the Domain Controller gets his time from the domain’s PDC Operation Master. Therefore the PDC &#8230; <a href="http://www.christiano.ch/wordpress/2012/01/05/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Time synchronization is an important aspect for all computers on the network. By default, the clients computers get their time from a Domain Controller and the Domain Controller gets his time from the domain’s PDC Operation Master. Therefore the PDC must synchronize his time from an external source. I usually use the servers listed at the <a href="http://www.pool.ntp.org/">NTP Pool Project </a>website.</p>
<p><span id="more-1268"></span>
<p>Before you begin, don’t forget to open the default UDP 123 port (in- and outbound) on your firewall. </p>
<ol>
<li>First, locate your PDC Server. Open the command prompt and type: <strong><em>C:\&gt;netdom /query fsmo</em></strong></li>
<li>Log in to your PDC Server and open the command prompt. </li>
<li>Stop the W32Time service: <strong><em>C:\&gt;net stop w32time</em></strong></li>
<li>Configure the external time sources, type: <strong><em>C:\&gt; w32tm /config /syncfromflags:manual /manualpeerlist:”0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org”</em></strong></li>
<li>Make your PDC a reliable time source for the clients. Type:<strong><em>C:\&gt;w32tm /config /reliable:yes</em></strong></li>
<li>Start the w32time service: <strong><em>C:\&gt;net start w32time</em></strong></li>
<li>The windows time service should begin synchronizing the time. You can check the external NTP servers in the time configuration by typing: <strong><em>C:\&gt;w32tm /query /configuration</em></strong></li>
<li>Check the Event Viewer for any errors.</li>
</ol>
<p>Tested on Windows Server 2008 R2 (Build 7600).</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Synchronize+time+with+external+NTP+server+on+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1268" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Synchronize+time+with+external+NTP+server+on+Windows+Server+2008+%28R2%29+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1268" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2012/01/05/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Magnifier Shortcuts and Features</title>
		<link>http://www.christiano.ch/wordpress/2011/11/21/windows-7-magnifier-shortcuts-and-features/</link>
		<comments>http://www.christiano.ch/wordpress/2011/11/21/windows-7-magnifier-shortcuts-and-features/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 06:20:07 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tips n'Tricks]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/11/21/windows-7-magnifier-shortcuts-and-features/</guid>
		<description><![CDATA[Today I was reading thru the news and found an article about the Windows Magnifier. A brilliant Windows 7 Tool that I’d pretty much ignored in the past. Key to press Action Windows logo key + Plus Sign or Minus &#8230; <a href="http://www.christiano.ch/wordpress/2011/11/21/windows-7-magnifier-shortcuts-and-features/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="2" width="675">
<tbody>
<tr>
<td valign="top" width="465">Today I was reading thru the news and found an article about the Windows Magnifier. A brilliant Windows 7 Tool that I’d pretty much ignored in the past.</td>
<td valign="top" width="209"><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2011/11/Logo_Windows_7.png"><img style="display: inline; float: right" title="Logo_Windows_7" alt="Logo_Windows_7" align="right" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/11/Logo_Windows_7_thumb.png" width="161" height="53"></a></td>
</tr>
</tbody>
</table>
<p><span id="more-1267"></span><br />
<table border="0" cellspacing="0" cellpadding="2" width="786">
<tbody>
<tr>
<td valign="top" width="337"><strong>Key to press</strong></td>
<td valign="top" width="447"><strong>Action</strong></td>
</tr>
<tr>
<td valign="top" width="337">Windows logo key + Plus Sign or Minus Sign</td>
<td valign="top" width="447">Zooms in or out</td>
</tr>
<tr>
<td valign="top" width="337">
<p>Ctrl+Alt+Spacebar</p>
</td>
<td valign="top" width="447">Preview the desktop in full-screen mode (you have to be zoomed in first)</td>
</tr>
<tr>
<td valign="top" width="337">Ctrl+Alt+F</td>
<td valign="top" width="447">Switch to full-screen mode</td>
</tr>
<tr>
<td valign="top" width="337">Ctrl+Alt+L</td>
<td valign="top" width="447">Switch to lens mode</td>
</tr>
<tr>
<td valign="top" width="337">Ctrl+Alt+D</td>
<td valign="top" width="447">Switch to docked mode</td>
</tr>
<tr>
<td valign="top" width="337">
<p>Ctrl+Alt+I</p>
</td>
<td valign="top" width="447">
<p>Invert colors (Probably my favorite feature)</p>
</td>
</tr>
<tr>
<td valign="top" width="337">Ctrl+Alt+arrow keys</td>
<td valign="top" width="447">Pan in the direction of the arrow keys</td>
</tr>
<tr>
<td valign="top" width="337">Ctrl+Alt+R</td>
<td valign="top" width="447">Resize the lens</td>
</tr>
<tr>
<td valign="top" width="337">Windows logo key + Esc</td>
<td valign="top" width="447">Exit Magnifier</td>
</tr>
</tbody>
</table>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Windows+7+Magnifier+Shortcuts+and+Features+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1267" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Windows+7+Magnifier+Shortcuts+and+Features+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1267" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/11/21/windows-7-magnifier-shortcuts-and-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Recovery&#8211;Load Registry</title>
		<link>http://www.christiano.ch/wordpress/2011/10/15/windows-recoveryload-registry/</link>
		<comments>http://www.christiano.ch/wordpress/2011/10/15/windows-recoveryload-registry/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 10:49:34 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows Firewall]]></category>
		<category><![CDATA[RDP]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Windows Firewall with Advanced Security]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/10/15/windows-recoveryload-registry/</guid>
		<description><![CDATA[Ok, today I locked-out myself from one of my dedicated servers.. how? I changed the RDP-Port in the Registry:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp And then, I FORGOT to add the new Port to the so called ‘Windows Firewall with Advanced Security’ .. it &#8230; <a href="http://www.christiano.ch/wordpress/2011/10/15/windows-recoveryload-registry/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table style="width: 675px;" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="599">Ok, today I locked-out myself from one of my dedicated servers.. how? I changed the RDP-Port in the Registry:<strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp</strong></p>
<p><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/WindowsRegistryRDPPortKey.png"><img style="display: inline;" title="WindowsRegistryRDPPortKey" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/WindowsRegistryRDPPortKey_thumb.png" alt="WindowsRegistryRDPPortKey" width="356" height="32" /></a></p>
<p>And then, I FORGOT to add the new Port to the so called ‘Windows Firewall with Advanced Security’ .. it was like a lighting strike in my body when I clicked ‘restart Server’</td>
<td valign="top" width="75"><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/Logo_winlogo.jpg"><img style="display: inline;" title="Logo_winlogo" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/Logo_winlogo_thumb.jpg" alt="Logo_winlogo" width="120" height="106" /></a></td>
</tr>
</tbody>
</table>
<p><span id="more-1261"></span></p>
<p>So, I used putty to open an SSH connection to the server. Easy I thought, REG ADD “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp” /t REG_DWORD /v PortNumber /d d3d /f</p>
<p>noooo, Access Denied .. ok, UAC is enabled .. tried to figure out if there’s a way to elevate the prompt .. but didn’t find a route/solution .. so I decided to reboot the server in Windows Recovery Mode, started regedit.exe and used load hive to load the SYSTEM Hive (found under C:\Windows\System32\Config). entered a name for the temporary hive, changed the PortNumber (always use CurrentControlSet1 – it’s the last successful config) and unloaded the hive.. then I remembered that I read an article about editing the registry ‘offline’ using reg.exe .. just to verify if the changed values have really been written in the SYSTEM Registry I used:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a2f22ee6-0ffd-4d16-8810-ed6ab51ea41a" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre>reg load HKLM\Win_SYSTEM C:\windows\system32\config\system
reg query "HKLM\Win_SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp"
reg unload HKLM\Win_SYSTEM</pre>
</div>
<p>and see what I got:</p>
<p><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/WindowsRegistryLoad_Unload_RegQueryRDP_PortNumber.png"><img style="display: inline;" title="WindowsRegistryLoad_Unload_RegQueryRDP_PortNumber" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/10/WindowsRegistryLoad_Unload_RegQueryRDP_PortNumber_thumb.png" alt="WindowsRegistryLoad_Unload_RegQueryRDP_PortNumber" width="661" height="203" /></a></p>
<p>another option is to disable the Firewall completely using this bat/cmd file:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:1b188017-a02e-464d-92e0-f576ea46e3c9" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre>@echo off
:start
echo ****************************************************************
echo *                                                              *
echo *             1 : Disable Windows firewall on server           *
echo *                                                              *
echo *             2 : Enable Windows firewall on server            *
echo *                                                              *
echo ****************************************************************
 set /p choice= choose What to do:
 if not %choice%=='' set choice=%choice:~0,1%

 if %choice%==1 goto Menu1

 if %choice%==2 goto Menu2

 echo %choice% WRONG option, choose 1 or 2
 goto start

 :Menu1
reg load HKLM\Win_SYSTEM C:\windows\system32\config\system
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f
reg unload HKLM\Win_SYSTEM
@echo on
@echo Firewall Disabled !
@echo off
goto end

 :Menu2

reg load HKLM\Win_SYSTEM C:\windows\system32\config\system
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v "EnableFirewall" /t REG_DWORD /d "1" /f
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile" /v "EnableFirewall" /t REG_DWORD /d "1" /f
reg.exe add "HKEY_LOCAL_MACHINE\Win_SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /v "EnableFirewall" /t REG_DWORD /d "1" /f
reg unload HKLM\Win_SYSTEM
@echo on
@echo Firewall Enabled !
@echo off
goto end

:end
pause</pre>
</div>
<p>maybe this is of help for someone..</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Windows+Recovery%E2%80%93Load+Registry+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1261" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Windows+Recovery%E2%80%93Load+Registry+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1261" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/10/15/windows-recoveryload-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding process that locks a DLL</title>
		<link>http://www.christiano.ch/wordpress/2011/09/04/finding-process-that-locks-a-dll/</link>
		<comments>http://www.christiano.ch/wordpress/2011/09/04/finding-process-that-locks-a-dll/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 06:15:08 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[CMD / Batch]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Tips n'Tricks]]></category>
		<category><![CDATA[Windows General]]></category>
		<category><![CDATA[DLL]]></category>
		<category><![CDATA[Tasklist]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/09/04/finding-process-that-locks-a-dll/</guid>
		<description><![CDATA[You want to replace a dll on a system, but you get access denied, although you’re admin, have the necessary rights.. so which process is locking the particular file/library. I know, there is handles.exe from Sysinternal Suite, and plenty other &#8230; <a href="http://www.christiano.ch/wordpress/2011/09/04/finding-process-that-locks-a-dll/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="2" width="675">
<tbody>
<tr>
<td valign="top" width="557">You want to replace a dll on a system, but you get access denied, although you’re admin, have the necessary rights.. so which process is locking the particular file/library. I know, there is handles.exe from Sysinternal Suite, and plenty other tools that do the trick.But, you don’t need third-party tools to get the answer, just use tasklist.exe or PowerShell.</td>
<td valign="top" width="117">&nbsp;</td>
</tr>
</tbody>
</table>
<p><span id="more-1254"></span>
<p>Windows command line:</p>
<pre>C:\&gt; tasklist /FI "modules eq vstoee.dll"</pre>
<p>PowerShell
<pre>PS C:\&gt; Get-Process | ? { $_.Modules -like "*(vstoee.dll)*" }</pre>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Finding+process+that+locks+a+DLL+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1254" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Finding+process+that+locks+a+DLL+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1254" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/09/04/finding-process-that-locks-a-dll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting registry last write time with PowerShell</title>
		<link>http://www.christiano.ch/wordpress/2011/07/16/getting-registry-last-write-time-with-powershell/</link>
		<comments>http://www.christiano.ch/wordpress/2011/07/16/getting-registry-last-write-time-with-powershell/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 16:02:12 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/07/16/getting-registry-last-write-time-with-powershell/</guid>
		<description><![CDATA[All registry keys have a value associated with called the Last Write Time. This is analogous to the last modification time for a file. When ever the registry key or one if its values has been created, modified, or deleted &#8230; <a href="http://www.christiano.ch/wordpress/2011/07/16/getting-registry-last-write-time-with-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>All registry keys have a value associated with called the Last Write Time. This is analogous to the last modification time for a file. When ever the registry key or one if its values has been created, modified, or deleted the value is updated to the current local system time. Unfortunately, there is no Last Write Time associated with a registry value, but it can be infered from the Last Write Time of the key.</p>
<p>Here is a PowerShell script to read the Last Write Time for a registry key.</p>
<p>Usage:</p>
<pre>Get-RegKeyLastWriteTime.ps1 &lt;Key&gt; &lt;SubKey&gt;</pre>
<p><span id="more-1242"></span>
<p>Example:</p>
<pre>Get-RegKeyLastWriteTime.ps1 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion</pre>
<p>Output:</p>
<pre>Key                         LastWriteTime
—-                         ——————-
AdminDebug                  10/28/2009 7:50:51 PM
App Management              7/14/2009 4:41:12 AM
App Paths                   1/22/2010 2:07:18 PM
Applets                     7/14/2009 4:41:12 AM
Audio                       7/14/2009 4:41:12 AM
Authentication              7/14/2009 4:41:12 AM
BitLocker                   7/14/2009 4:41:12 AM
...</pre>
<p>Get-RegKeyLastWriteTime.ps1 Script:</p>
<pre>param (	[string] $Key, [string] $SubKey )

switch ($Key) {
    &quot;HKCR&quot; { $searchKey = 0x80000000} #HK Classes Root
    &quot;HKCU&quot; { $searchKey = 0x80000001} #HK Current User
    &quot;HKLM&quot; { $searchKey = 0x80000002} #HK Local Machine
    &quot;HKU&quot;  { $searchKey = 0x80000003} #HK Users
    &quot;HKCC&quot; { $searchKey = 0x80000005} #HK Current Config
    default {
        #throw &quot;Invalid Key. Use one of the following options HKCR, HKCU, HKLM, HKU, HKCC&quot;
    }
}

$KEYQUERYVALUE = 0x1
$KEYREAD = 0x19
$KEYALLACCESS = 0x3F

$sig1 = @'
[DllImport(&quot;advapi32.dll&quot;, CharSet = CharSet.Auto)]
  public static extern int RegOpenKeyEx(
    int hKey,
    string subKey,
    int ulOptions,
    int samDesired,
    out int hkResult);
'@
$type1 = Add-Type -MemberDefinition $sig1 -Name Win32Utils `
    -Namespace RegOpenKeyEx -Using System.Text -PassThru

$sig2 = @'
[DllImport(&quot;advapi32.dll&quot;, EntryPoint = &quot;RegEnumKeyEx&quot;)]
extern public static int RegEnumKeyEx(
    int hkey,
    int index,
    StringBuilder lpName,
    ref int lpcbName,
    int reserved,
    int lpClass,
    int lpcbClass,
    out long lpftLastWriteTime);
'@
$type2 = Add-Type -MemberDefinition $sig2 -Name Win32Utils `
    -Namespace RegEnumKeyEx -Using System.Text -PassThru

$sig3 = @'
[DllImport(&quot;advapi32.dll&quot;, SetLastError=true)]
public static extern int RegCloseKey(
    int hKey);
'@
$type3 = Add-Type -MemberDefinition $sig3 -Name Win32Utils `
    -Namespace RegCloseKey -Using System.Text -PassThru

$hKey = new-object int
$result = $type1::RegOpenKeyEx($searchKey, $SubKey, 0, $KEYREAD, [ref] $hKey)

#initialize variables
$builder = New-Object System.Text.StringBuilder 1024
$index = 0
$length = [int] 1024
$time = New-Object Long

#234 means more info, 0 means success. Either way, keep reading
while ( 0,234 -contains $type2::RegEnumKeyEx($hKey, $index++, `
    $builder, [ref] $length, $null, $null, $null, [ref] $time) )
{
    #create output object
    $o = &quot;&quot; | Select Key, LastWriteTime
    $o.Key = $builder.ToString()
    $o.LastWriteTime = (Get-Date $time).AddYears(1600)
    $o

    #reinitialize for next time through the loop
    $length = [int] 1024
    $builder = New-Object System.Text.StringBuilder 1024
}

$result = $type3::RegCloseKey($hKey);</pre>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Getting+registry+last+write+time+with+PowerShell+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1242" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Getting+registry+last+write+time+with+PowerShell+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1242" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/07/16/getting-registry-last-write-time-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scan IP range using ping</title>
		<link>http://www.christiano.ch/wordpress/2011/07/16/scan-ip-range-using-ping/</link>
		<comments>http://www.christiano.ch/wordpress/2011/07/16/scan-ip-range-using-ping/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 15:35:44 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[CMD / Batch]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[IPScan]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/07/16/scan-ip-range-using-ping/</guid>
		<description><![CDATA[IP scanner for the poor ones Just open up a cmd.exe and change the ip range.. C:\&#62;FOR /L %x in (1,1,255) do ping -n 1 192.168.2.%x &#124; find /I &#34;reply&#34; &#62;&#62; c:\temp\pingresult.txt The above command uses a FOR loop to &#8230; <a href="http://www.christiano.ch/wordpress/2011/07/16/scan-ip-range-using-ping/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>IP scanner for the poor ones <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Zwinkerndes Smiley" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/07/wlEmoticon-winkingsmile.png" /></p>
<p>Just open up a cmd.exe and change the ip range..</p>
<blockquote><p>C:\&gt;FOR /L %x in (1,1,255) do ping -n 1 192.168.2.%x | find /I &quot;reply&quot; &gt;&gt; c:\temp\pingresult.txt</p>
</blockquote>
<p>The above command uses a FOR loop to ping each device and looks for &quot;Reply&quot; in the output. If there is a &quot;Reply&quot; then the host is up.. Results will be written to C:\temp\pingresults.txt</p>
<p>Or the PowerShell version: </p>
<blockquote><p>C:\&gt; 1..255 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send(&quot;192.168.2.$_&quot;) } | where-object {$_.Status -eq &quot;success&quot;} | select Address</p>
</blockquote>
<p><span id="more-1240"></span>
<p>Address    <br />&#8212;&#8212;-     <br />192.168.2.1     <br />192.168.2.5     <br />192.168.2.10     <br />192.168.2.11     <br />192.168.2.12</p>
<p>At first glance the results are very similar and you would think, &quot;Why all the extra typing? The second command is 2.5 times longer!&quot; The big difference between the standard windows command line and powershell is that the latter uses objects, which gives a lot of power&#8230;in our shell. Not let&#8217;s see how it works&#8230;</p>
<p>In the above command the range operator (..) generates a list of the numbers 1 through 255. The cool thing is you don&#8217;t have to use just a single range, you can string them together like this (1..5),7,(9..10) which would give you the numbers 1-10 skipping 6 and 8.</p>
<blockquote><p>foreach-object { (new-object System.Net.Networkinformation.Ping).Send(&quot;10.10.10.$_&quot;) }</p>
</blockquote>
<p>The foreach-object takes the numbers fed into the pipeline and operates on them one at a time. First, it creates a new ping object and then calls the send method. The parameter given to the send method is a string concatenation of 10.10.10. and the number from $_, which is the &quot;current pipeline object.&quot; The $_ variable in our example will contain the numbers 1-255.</p>
<blockquote><p>where-object {$_.Status -eq &quot;success&quot;}</p>
</blockquote>
<p>The output of the send method is the PingReply object which contains a status. We can filter the results only successful pings reply objects will be sent further down the pipeline.</p>
<blockquote><p>Select Address      <br />Finally, all we care about is the address so that is the only piece we have displayed.</p>
</blockquote>
<p>Now that we know how it works, let&#8217;s pimp out our powershell version.</p>
<p>First, we don&#8217;t have to just use a contiguous set of numbers. If we wanted to scan all ip address before 10.10.10.100, after 10.10.10.200 and 10.10.10.155 we could use this:    <br />(1..99),(200..255),155 | foreach-object &#8230;.     <br />We can use the results to feed into other commands. You can ping sweep an entire subnet and have it automatically do an nslookup, attempt to list the contents of the c$ share, and tell you that you are doing a good job (a little positive reinforcement never hurts).</p>
<blockquote><p>PS C:\&gt;1..255 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send(&quot;10.10.10.$_&quot;) } | where-object {$_.Status -eq &quot;success&quot;} | foreach-object { nslookup $_; gci &quot;\\$($_.Address)\c$&quot;; echo &quot;Good Job&quot; }</p>
</blockquote>
<p>The ping sweep can be sped up by setting a timeout value (in milliseconds). In the example below we set the timeout value to 100ms.</p>
<blockquote><p>&#8230; (new-object System.Net.Networkinformation.Ping).Send(&quot;10.10.10.$_&quot;, 100) &#8230;</p>
</blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Scan+IP+range+using+ping+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1240" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=Scan+IP+range+using+ping+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1240" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/07/16/scan-ip-range-using-ping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET self-registering Windows Service</title>
		<link>http://www.christiano.ch/wordpress/2011/07/10/net-self-registering-windows-service/</link>
		<comments>http://www.christiano.ch/wordpress/2011/07/10/net-self-registering-windows-service/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 08:30:48 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://www.christiano.ch/wordpress/2011/07/10/net-self-registering-windows-service/</guid>
		<description><![CDATA[I just found an article about how to extend a windows service’s functionality so that the service can register itself in windows service control using command line switches like /register or /unregister.. &#160; using System.Configuration.Install; using System.Linq; using System.Windows.Forms; namespace &#8230; <a href="http://www.christiano.ch/wordpress/2011/07/10/net-self-registering-windows-service/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table style="width: 675px;" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="528">I just found an article about how to extend a windows service’s functionality so that the service can register itself in windows service control using command line switches like /register or /unregister..</td>
<td valign="top" width="146"><a href="http://www.christiano.ch/wordpress/wp-content/uploads/2011/07/Logo_Microsoft_VisualStudio_2010.png"><img style="display: inline;" title="Logo_Microsoft_VisualStudio_2010" src="http://www.christiano.ch/wordpress/wp-content/uploads/2011/07/Logo_Microsoft_VisualStudio_2010_thumb.png" alt="Logo_Microsoft_VisualStudio_2010" width="200" height="150" /></a></td>
</tr>
</tbody>
</table>
<p><span id="more-1218"></span></p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">&nbsp;
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Configuration.Install</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Windows.Forms</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">namespace</span> MyService
<span style="color: #008000;">&#123;</span>
    <span style="color: #6666cc; font-weight: bold;">class</span> Program
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>args<span style="color: #008000;">.</span><span style="color: #0000FF;">Any</span><span style="color: #008000;">&#40;</span>item <span style="color: #008000;">=&gt;</span> item <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;/install&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                ServiceSelfInstaller<span style="color: #008000;">.</span><span style="color: #0000FF;">Install</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span>
                <span style="color: #008000;">&#40;</span>args<span style="color: #008000;">.</span><span style="color: #0000FF;">Any</span><span style="color: #008000;">&#40;</span>item <span style="color: #008000;">=&gt;</span> item <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;/uninstall&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                ServiceSelfInstaller<span style="color: #008000;">.</span><span style="color: #0000FF;">Uninstall</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">else</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #008080; font-style: italic;">//Run Service...            </span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> ServiceSelfInstaller
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Install<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                ManagedInstallerClass<span style="color: #008000;">.</span><span style="color: #0000FF;">InstallHelper</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> Application<span style="color: #008000;">.</span><span style="color: #0000FF;">ExecutablePath</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Uninstall<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                ManagedInstallerClass<span style="color: #008000;">.</span><span style="color: #0000FF;">InstallHelper</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> <span style="color: #666666;">&quot;/u&quot;</span>, Application<span style="color: #008000;">.</span><span style="color: #0000FF;">ExecutablePath</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=.NET+self-registering+Windows+Service+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1218" title="Post to Twitter"><img class="nothumb" src="http://www.christiano.ch/wordpress/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/intent/tweet?text=.NET+self-registering+Windows+Service+http%3A%2F%2Fchristiano.ch%2Fwordpress%2F%3Fp%3D1218" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.christiano.ch/wordpress/2011/07/10/net-self-registering-windows-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

