<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Notes of Windows Admin</title>
	<atom:link href="http://winadminnotes.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://winadminnotes.wordpress.com</link>
	<description>Solutions, scripts and tips from a real life</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:58:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='winadminnotes.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Notes of Windows Admin</title>
		<link>http://winadminnotes.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://winadminnotes.wordpress.com/osd.xml" title="Notes of Windows Admin" />
	<atom:link rel='hub' href='http://winadminnotes.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Synchronization problems between Exchange Server and Outlook</title>
		<link>http://winadminnotes.wordpress.com/2011/12/20/synchronization-problems-between-exchange-server-and-outlook/</link>
		<comments>http://winadminnotes.wordpress.com/2011/12/20/synchronization-problems-between-exchange-server-and-outlook/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 18:15:21 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[Microsoft Office]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Public Folders]]></category>
		<category><![CDATA[Silly Solutions]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=403</guid>
		<description><![CDATA[There is a good Microsoft article, explaining how to fix synchronization issues between Exchange and Outlook, when some Exchange objects do not appear in Outlook. However, a small part should be added to the article. When a user cannot see the content of a particular public folder, even if he/she is an owner of it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=403&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is <a href="http://support.microsoft.com/kb/842284" target="_blank">a good Microsoft article</a>, explaining how to fix synchronization issues between Exchange and Outlook, when some Exchange objects do not appear in Outlook. However, a small part should be added to the article.</p>
<p>When a user cannot see the content of a particular public folder, even if he/she is an owner of it and none of the steps from the article above helps, try this</p>
<p>1. Make only one user an owner of a public folder with synchronization issues<br />
2. Turn all other Owners into Publishing Editors<br />
3. Run the user’s Outlook as follows</p>
<p><span style="color:#0000ff;">Outlook /cleanviews</span></p>
<p>4. Be aware that the user will lose all the views created in Outlook</p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/exchange-server/'>Exchange Server</a>, <a href='http://winadminnotes.wordpress.com/category/microsoft-office/'>Microsoft Office</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=403&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/12/20/synchronization-problems-between-exchange-server-and-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows is unable to log you on when you try to access a shared folder</title>
		<link>http://winadminnotes.wordpress.com/2011/11/04/windows-is-unable-to-log-you-on-when-you-try-to-access-a-shared-folder/</link>
		<comments>http://winadminnotes.wordpress.com/2011/11/04/windows-is-unable-to-log-you-on-when-you-try-to-access-a-shared-folder/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 14:33:09 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Silly Solutions]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=399</guid>
		<description><![CDATA[You can get the following error message when you try to access an administrative share on a Windows Vista or Windows 7 computer from another Windows computer: &#8220;Logon unsuccessful: Windows is unable to log you on&#8221; KB947232 can help to resolve the issue. The fix taken from the article is below  Click Start, type regedit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=399&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can get the following error message when you try to access an administrative share on a Windows Vista or Windows 7 computer from another Windows computer:</p>
<p><span style="color:#ff0000;">&#8220;Logon unsuccessful: Windows is unable to log you on&#8221;</span></p>
<p><a href="http://support.microsoft.com/kb/947232" target="_blank">KB947232</a> can help to resolve the issue. The fix taken from the article is below</p>
<p><span id="more-399"></span></p>
<ol>
<li> Click <strong>Start</strong>, type <strong>regedit</strong> in the <strong>Start Search</strong> box, and then press ENTER.</li>
<li> <strong></strong>Locate and then click the following registry subkey:  <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System</strong></li>
<li>On the <strong>Edit</strong> menu, point to <strong>New</strong>, and then click <strong>DWORD (32-bit)</strong> Value.</li>
<li>Type <strong>LocalAccountTokenFilterPolicy</strong> to name the new entry, and then press ENTER.</li>
<li>Right-click <strong>LocalAccountTokenFilterPolicy</strong>, and then click <strong>Modify</strong>.</li>
<li>In the <strong>Value</strong> data box, type <strong>1</strong>, and then click OK.</li>
<li>Exit Registry Editor.</li>
</ol>
<p>The LocalAccountTokenFilterPolicy entry in the registry can have a value of 0 or 1. These values set the behavior of the entry as follows:</p>
<p><strong>0 = build a filtered token</strong><br />
This is the default value. The administrator credentials are removed. These credentials are required for remote administration of the print drivers.</p>
<p><strong>1 = build an elevated token</strong><br />
This value enables the remote administration of the print drivers on a server within a workgroup.</p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/399/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=399&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/11/04/windows-is-unable-to-log-you-on-when-you-try-to-access-a-shared-folder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>Not enough storage is available to complete this operation</title>
		<link>http://winadminnotes.wordpress.com/2011/10/28/not-enough-storage-is-available-to-complete-this-operation/</link>
		<comments>http://winadminnotes.wordpress.com/2011/10/28/not-enough-storage-is-available-to-complete-this-operation/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 18:41:59 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=395</guid>
		<description><![CDATA[Running dcpromo to remove a domain controller from domain, I received the following error message As Microsoft says in KB Article: &#8220;This problem occurs because the Kerberos token that is generated during authentication is more than the fixed maximum size&#8221; In order to fix that, just create a DWORD registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters MaxTokenSize=dword:65536 and restart [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=395&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Running <strong>dcpromo</strong> to remove a domain controller from domain, I received the following error message</p>
<p><a href="http://winadminnotes.files.wordpress.com/2011/10/notenoughstorage.jpg"><img class="alignnone size-full wp-image-396" title="notenoughstorage" src="http://winadminnotes.files.wordpress.com/2011/10/notenoughstorage.jpg?w=450&#038;h=107" alt="" width="450" height="107" /></a></p>
<p><span id="more-395"></span>As Microsoft says in <a href="http://support.microsoft.com/kb/935744" target="_blank">KB Article</a>:</p>
<p>&#8220;This problem occurs because the Kerberos token that is generated during authentication is more than the fixed maximum size&#8221;</p>
<p>In order to fix that, just create a DWORD registry value</p>
<p><span style="color:#0000ff;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters</span><br />
<span style="color:#0000ff;"> MaxTokenSize=dword:65536</span></p>
<p>and restart the computer</p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/active-directory/'>Active Directory</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=395&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/10/28/not-enough-storage-is-available-to-complete-this-operation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>

		<media:content url="http://winadminnotes.files.wordpress.com/2011/10/notenoughstorage.jpg" medium="image">
			<media:title type="html">notenoughstorage</media:title>
		</media:content>
	</item>
		<item>
		<title>SMB Tuning for Terminal and File Servers</title>
		<link>http://winadminnotes.wordpress.com/2011/10/28/smb-tuning-for-terminal-and-file-servers/</link>
		<comments>http://winadminnotes.wordpress.com/2011/10/28/smb-tuning-for-terminal-and-file-servers/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 18:20:39 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Terminal Services]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Terminal Servers]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=389</guid>
		<description><![CDATA[Dan Allen published very interesting article , related to XenApp and file server communications. Actually, this article explains the SMB default settings limitations and gives an advice how to improve performance of any Windows file server. I have copied the first part of this article and added an example of .reg file, which you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=389&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dan Allen published <a href="http://blogs.citrix.com/2010/10/21/smb-tuning-for-xenapp-and-file-servers-on-windows-server-2008/" target="_blank">very interesting article</a> , related to XenApp and file server communications. Actually, this article explains the SMB default settings limitations and gives an advice how to improve performance of any Windows file server. I have copied the first part of this article and added an example of .reg file, which you can use to tune-up your file server.</p>
<p><span id="more-389"></span></p>
<h2><strong>SMB Tuning for XenApp and File Servers on Windows Server 2008</strong></h2>
<p><a href="http://blogs.citrix.com/2010/10/21/smb-tuning-for-xenapp-and-file-servers-on-windows-server-2008/">http://blogs.citrix.com/2010/10/21/smb-tuning-for-xenapp-and-file-servers-on-windows-server-2008/</a><br />
<strong><em>By Dan Allen · Published October 21, 2010</em></strong></p>
<p>I have received a lot of questions from customers lately on whether there is a need to tune Windows Server 2008 file servers, especially if the client machines connecting to them are capable of using SMB 2.0, which includes Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2. Unfortunately, there is not much information out there on this topic, so I decided to do a little research and testing for myself.</p>
<h3><strong>The SMB 1.0 Problem</strong></h3>
<p>To begin, it is important to understand the SMB 1.0 limitation that has been present since we first started implementing Terminal Server deployments back in the good old days of NT and MetaFrame. There have already been a lot of good SMB tuning articles out there that discuss this in detail, so I will not go into too much of an extensive discussion here, but I will summarize.</p>
<p>When a client computer using SMB 1.0 (NT 4.0, 2000, XP, 2003, etc…) attempts to connect to a Windows file server, it will query the file server and ask how many concurrent network (SMB) commands it can have submitted and open simultaneously. The file server will respond with a number and the network redirector on the client computer will limit itself to the number provided by the file server. The number that the file server provides is controlled by the SMB value for Max Mpx Count, which is set by the following registry entry on Windows file servers:</p>
<p><span style="color:#0000ff;">“HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\MaxMpxCt”</span></p>
<p>By default, this value does not exist on a Windows Server. If it does not exist, the Operating System uses a default value of 50.</p>
<p>This means that an individual client computer will not be able to have more than 50 simultaneous SMB commands to the file server. An SMB command can be anything from a directory listing, file creation, deletion, ACL manipulation, etc… basically, any kind of file or directory access.</p>
<p>The 50 command limitation quickly becomes a problem on a Terminal Server because there is only one redirector that is shared by all users on the server. In a typical Terminal Server environment, often users will all connect to the same file server for home directories, roaming profiles and redirected folders. This means that each user could easily be generating multiple SMB commands to a single file server. Once you start loading 50+ users on the server, you can easily have more than 50 outstanding SMB commands that need to be serviced, especially if folder redirection is being used. Since only 50 get serviced at one time, the rest of the commands begin to queue up and wait for servicing. This can cause poor performance or even application failures as applications make file requests that time out waiting to be serviced.</p>
<p>A workstation or SMB Client may make a request to have more than 50 SMB commands simultaneously open to a file server; however, if the file server has not been tuned, the client will not use more than the Max Mpx Count returned by the file server. The maximum number of simultaneous requests that a workstation will attempt to use is controlled by the Maximum Commands SMB setting defined by the following registry entry on the client:</p>
<p><span style="color:#0000ff;">“HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\MaxCmds”</span></p>
<p>By default this value is also 50 if it is not defined. So to properly tune an environment for maximum density of Terminal Server/XenApp users, you must add the MaxCmds key to all Terminal Serves and the MaxMpxCt key to all file servers. We have typically recommended increasing these entries to a decimal value of 2048.</p>
<p>Microsoft has a good article (324446) that has been around since Windows 2000 that discusses this issue and recommends the follow registry keys that should be implemented on file servers being accessed by Terminal Servers:</p>
<p><span style="color:#0000ff;">HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters</span></p>
<p><span style="color:#0000ff;">“MaxWorkItems”=dword:00002000 (decimal 8192)</span><br />
<span style="color:#0000ff;"> “MaxMpxCt”=dword:00000800 (decimal 2048)</span><br />
<span style="color:#0000ff;"> “MaxRawWorkItems”=dword:00000200 (decimal 512)</span><br />
<span style="color:#0000ff;"> “MaxFreeConnections”=dword:00000064 (decimal 100)</span><br />
<span style="color:#0000ff;"> “MinFreeConnections”=dword:00000020 (decimal 32)</span></p>
<p>It is also important to note that this issue and these registry keys are fully applicable to Terminal Servers and File Servers running the x64 edition of Window Server 2003. This is not a 32-bit problem, but rather an SMB problem.</p>
<p>In addition to the above registry tuning, there was another SMB client fix which reduces the SMB chatter and SMB commands that are opened from a client to a file server. This registry setting is one that we recommend be implemented on all XenApp Servers:</p>
<p><span style="color:#0000ff;"> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer</span></p>
<p><span style="color:#0000ff;">“NoRemoteRecursiveEvents”=dword:00000001</span><br />
You can verify whether or not your system has excessive SMB commands being queued by reviewing the following performance monitor counter on your XenApp servers: Redirector/Current Commands. If this counter gets close to 50 and you have not tuned your file servers, then you definitely have a problem.</p>
<p>Here are some Microsoft articles for reference:</p>
<p><a href="http://support.microsoft.com/kb/324446">http://support.microsoft.com/kb/324446</a><br />
<a href="http://support.microsoft.com/kb/232476">http://support.microsoft.com/kb/232476</a><br />
<a href="http://support.microsoft.com/kb/810886">http://support.microsoft.com/kb/810886</a><br />
<a href="http://support.microsoft.com/kb/831129">http://support.microsoft.com/kb/831129</a></p>
<h2></h2>
<h3><strong>.Reg file</strong></h3>
<p>I have just compiled the settings that Dan mentioned in his article into one, ready-to-use .reg file</p>
<p><span style="color:#0000ff;">Windows Registry Editor Version 5.00</span><br />
<br />
<span style="color:#0000ff;"> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]</span><br />
<span style="color:#0000ff;">&#8220;MaxCmds&#8221;=dword:00000800</span><br />
<br />
<span style="color:#0000ff;"> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]</span><br />
<span style="color:#0000ff;">&#8220;MaxWorkItems&#8221;=dword:00002000</span><br />
<span style="color:#0000ff;"> &#8220;MaxMpxCt&#8221;=dword:00000800</span><br />
<span style="color:#0000ff;"> &#8220;MaxRawWorkItems&#8221;=dword:00000200</span><br />
<span style="color:#0000ff;"> &#8220;MaxFreeConnections&#8221;=dword:00000064</span><br />
<span style="color:#0000ff;"> &#8220;MinFreeConnections&#8221;=dword:00000020</span></p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/terminal-services/'>Terminal Services</a>, <a href='http://winadminnotes.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=389&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/10/28/smb-tuning-for-terminal-and-file-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>Error 0&#215;80004015: The class is configured to run as a security ID different from the caller</title>
		<link>http://winadminnotes.wordpress.com/2011/10/04/error-0x80004015-the-class-is-configured-to-run-as-a-security-id-different-from-the-caller/</link>
		<comments>http://winadminnotes.wordpress.com/2011/10/04/error-0x80004015-the-class-is-configured-to-run-as-a-security-id-different-from-the-caller/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 14:55:18 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Silly Solutions]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=385</guid>
		<description><![CDATA[Sometimes you can get the following message when you are trying to start or stop Windows Firewall service The solution is described in details in this Microsoft article: Certain Administrative Templates from the Windows XP Security Guide may prevent you from starting the Windows Firewall service in Windows XP Service Pack 2 (http://support.microsoft.com/kb/892199) Microsoft offers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=385&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you can get the following message when you are trying to start or stop Windows Firewall service</p>
<p><a href="http://winadminnotes.files.wordpress.com/2011/10/8004015.jpg"><img class="alignnone size-full wp-image-386" title="8004015" src="http://winadminnotes.files.wordpress.com/2011/10/8004015.jpg?w=450&#038;h=108" alt="" width="450" height="108" /></a></p>
<p>The solution is described in details in this Microsoft article: <strong>Certain Administrative Templates from the Windows XP Security Guide may prevent you from starting the Windows Firewall service in Windows XP Service Pack 2</strong> (<a href="http://support.microsoft.com/kb/892199">http://support.microsoft.com/kb/892199</a>)</p>
<p>Microsoft offers two solutions for this issue, I have successfully implemented the one below<br />
<span id="more-385"></span></p>
<ul>
<li>Click <strong>Start</strong>, click <strong>Run</strong>, in the <strong>Open</strong> box, type <strong>regedit</strong>, and then click <strong>OK</strong>.</li>
<li>Locate and then click the following registry subkey:</li>
</ul>
<p><span style="color:#0000ff;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Security</span></p>
<ul>
<li>Delete the <strong>Security</strong> registry subkey, if it exists.</li>
<li>Locate and then click the following registry subkey:</li>
</ul>
<p>&nbsp;</p>
<p><span style="color:#0000ff;">HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{ce166e40-1e72-45b9-94c9-3b2050e8f180}</span></p>
<ul>
<li>On the <strong>File</strong> menu, click <strong>Export</strong>.</li>
<li>In the <strong>File name</strong> box, type <strong>C:\reg_AppID_CLSID.reg</strong>, and then click <strong>Save</strong> to save the registry file.</li>
<li>Delete the <strong>{ce166e40-1e72-45b9-94c9-3b2050e8f180}</strong> registry subkey.</li>
<li><strong>Exit</strong> Registry Editor</li>
<li><strong>Restart</strong> the computer.</li>
</ul>
<p><strong>Note:</strong> It is important to delete the Security registry subkey if this subkey exists. This guarantees that the default security descriptor is used for starting Windows Firewall when the computer is restarted.</p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/385/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=385&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/10/04/error-0x80004015-the-class-is-configured-to-run-as-a-security-id-different-from-the-caller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>

		<media:content url="http://winadminnotes.files.wordpress.com/2011/10/8004015.jpg" medium="image">
			<media:title type="html">8004015</media:title>
		</media:content>
	</item>
		<item>
		<title>/3GB Option in Windows Vista and Windows 7</title>
		<link>http://winadminnotes.wordpress.com/2011/09/18/3gb-optinon-in-windows-vista-and-windows-7/</link>
		<comments>http://winadminnotes.wordpress.com/2011/09/18/3gb-optinon-in-windows-vista-and-windows-7/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 17:01:02 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=381</guid>
		<description><![CDATA[/3GB option in boot.ini file in Windows XP allows to give any application up to 3 GB of RAM. However, there is no such option in Windows Vista or Windows 7, the boot.ini file was replaced with a utility called BCDEdit In order to set it up, just run this command: bcdedit /set IncreaseUserVa 3072 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=381&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>/3GB option in boot.ini file in Windows XP allows to give any application up to 3 GB of RAM. However, there is no such option in Windows Vista or Windows 7, the boot.ini file was replaced with a utility called BCDEdit</p>
<p>In order to set it up, just run this command:</p>
<p><span style="color:#0000ff;">bcdedit /set IncreaseUserVa 3072</span></p>
<p>and restart the computer.</p>
<p>This command removes the option</p>
<p><span style="color:#0000ff;">bcdedit /deletevalue IncreaseUserVa</span></p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/381/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=381&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/09/18/3gb-optinon-in-windows-vista-and-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Install SNMP on ESX Host v4.x</title>
		<link>http://winadminnotes.wordpress.com/2011/08/22/how-to-install-snmp-on-esx-host-v4-x/</link>
		<comments>http://winadminnotes.wordpress.com/2011/08/22/how-to-install-snmp-on-esx-host-v4-x/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 01:02:52 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[SNMP]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=379</guid>
		<description><![CDATA[VMware ESX v4.x includes an SNMP agent that is embedded in hostd service. This VMware SNMP agent supports VMware Management Information Base (MIB) files and extends SNMP functionality. Before version 4, VMware ESX used Net-SNMP as SNMP agent. Now it has its own agent which can be used with or without Net-SNMP. Usually, Net-SNMP is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=379&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>VMware ESX v4.x includes an SNMP agent that is embedded in hostd service. This VMware SNMP agent supports VMware Management Information Base (MIB) files and extends SNMP functionality.</p>
<p>Before version 4, VMware ESX used Net-SNMP as SNMP agent. Now it has its own agent which can be used with or without Net-SNMP. Usually, Net-SNMP is required by monitoring software. In this case it can be set up to pass any incoming requests, related to VMware, to VMware SNMP agent to get access to VMware MIBs.</p>
<p>This article describes how to configure both agents. If you do not need to use VMware SNMP agent, configure Net‐SNMP as you would do on a typical Linux host. If you do not need to use Net-SNMP agent, configure VMware SNMP agent to use UDP port 161 instead of 171, shown in this document</p>
<p>Some information can be also found here: <a href="http://www.vmware.com/pdf/vsp_4_snmp_config.pdf">http://www.vmware.com/pdf/vsp_4_snmp_config.pdf</a></p>
<p><span id="more-379"></span></p>
<h2><span style="color:#993300;">Net-SNMP Configuration</span></h2>
<p>Log on to the service console on the ESX host</p>
<p>Stop the <strong>snmpd</strong> service</p>
<p><span style="color:#0000ff;">service snmpd stop</span></p>
<p>Go to <strong>/etc/snmp</strong> and make a copy of the original configuration file to create a backup</p>
<p><span style="color:#0000ff;">cd /etc/snmp</span><br />
<span style="color:#0000ff;"> cp -p snmpd.conf orig-snmpd.conf</span></p>
<p>Modify the <strong>snmpd.conf</strong> file and add the following:</p>
<p><span style="color:#0000ff;">rocommunity &lt;community name&gt; &lt;ip address of trap destination 1&gt;</span><br />
<span style="color:#0000ff;"> rocommunity &lt;community name&gt; &lt;ip address of trap destination 2&gt;</span></p>
<p>Remove these lines:</p>
<p><span style="color:#0000ff;">#       sec.name  source          community</span><br />
<span style="color:#0000ff;"> com2sec notConfigUser  default       public</span><br />
<span style="color:#0000ff;"> &#8230;</span><br />
<span style="color:#0000ff;"> ####</span><br />
<span style="color:#0000ff;"> # Second, map the security name into a group name:</span><br />
<span style="color:#0000ff;"> #       groupName      securityModel securityName</span><br />
<span style="color:#0000ff;"> group   notConfigGroup v1           notConfigUser</span><br />
<span style="color:#0000ff;"> group   notConfigGroup v2c           notConfigUser</span></p>
<p>Locate the system contact information section. Update the <strong>syslocation</strong> and <strong>syscontact</strong> fields:</p>
<p><span style="color:#0000ff;">syslocation Toronto, ON, CA</span><br />
<span style="color:#0000ff;"> syscontact  esxgroup@esx.ca</span></p>
<p>Add the following line at the end of the file.</p>
<p><span style="color:#0000ff;">proxy -v 1 -c &lt;community name&gt; udp:127.0.0.1:171 .1.3.6.1.4.1.6876</span></p>
<p>Here <strong>-v 1</strong> reports the <strong>Net-SNMP</strong> version, <strong>-c</strong> specifies the community string for <strong>Net-SNMP</strong>, <strong>udp:127.0.0.1:171</strong> specifies the local host IP address and the UDP port number for the VMware SNMP agent.  This port number can be any unused UDP port. The port number must be the same as the one for the VMware SNMP agent. <strong>1.3.6.1.4.1.6876</strong> is the object identifier of the VMware MIBs. Net-SNMP will pass all the requests under this OID to the agent listening on the specified port and on the specified host. In our case it is a local host on UDP port 171.</p>
<p>Add another line</p>
<p><span style="color:#0000ff;">trapsink &lt; ip address of trap destination&gt; &lt;community name&gt;</span></p>
<p>The <strong>trapsink</strong> specification is required to send traps defined in the proprietary MIBs (such as VMware)</p>
<p>Save the file and exit</p>
<p>To start the Net-SNMP service when the ESX host boots, use these commands</p>
<p><span style="color:#0000ff;">chkconfig snmpd on</span><br />
<span style="color:#0000ff;"> chkconfig &#8211;list snmpd</span><br />
<span style="color:#0000ff;"> snmpd           0:on   1:on    2:on    3:on    4:on   5:on    6:on</span></p>
<p>Start the <strong>Net-SNMP</strong> service</p>
<p><span style="color:#0000ff;">service snmpd start</span></p>
<p><strong>Note</strong>: If any Net-SNMP has any dependant services (such as the DELL Server Administrator (OMSA)), they should be also restarted</p>
<p>Check the status of the <strong>snmpd</strong> service</p>
<p><span style="color:#0000ff;">service snmpd status</span></p>
<p><span style="color:#0000ff;">snmpd (pid  13728) is running&#8230;</span></p>
<p>Now you should be able to use <strong>snmpwalk</strong> off of any machine to check out the SNMP communication</p>
<h2></h2>
<h2>VMware SNMP Agent Configuration</h2>
<p>VMware SNMP agent can be configured with three ways: by using VMware Perl scripts (vicfg-snmp.pl), by using VMware PowerCLI (PowerShell extension for VMware) or by editing manually the agent configuration file via the service console. We will do all three, using UDP 171 that we configured for Net-SNMP proxy</p>
<p><strong>Note</strong>: VMware recommends using the <strong>vicfg-snmp.pl</strong> or <strong>PowerCLI </strong>commands to change the configuration instead of editing the file itself</p>
<h3>Perl Script</h3>
<p>If you have installed VMware vSphere CLI, you can find the scripts in this location:</p>
<p>C:\Program Files\VMware\VMware vSphere CLI\bin</p>
<p>Run</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;help</span></p>
<p>&#8230;to see all the parameters</p>
<p>Running this Perl script you will be asked to enter user name and password to connect to the service console, unless you use <strong>&#8211;username</strong> and <strong>&#8211;password</strong> parameters</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;show</strong></span><br />
<span style="color:#0000ff;">Current SNMP agent settings:</span><br />
<span style="color:#0000ff;">Enabled  : 0</span><br />
<span style="color:#0000ff;">UDP port : 161</span><br />
<span style="color:#0000ff;">Communities :</span><br />
<span style="color:#0000ff;">Notification targets :</span></p>
<p>Add community</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;communities &lt;community string&gt;</strong></span><br />
<span style="color:#0000ff;">Changing community list to: &#8230;</span><br />
<span style="color:#0000ff;">Complete.</span></p>
<p>Change port number</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;port 171</strong></span><br />
<span style="color:#0000ff;">Changing port to: 171&#8230;</span><br />
<span style="color:#0000ff;">Complete.</span></p>
<p>Add trap destinations</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;targets &lt;ip address of trap destination&gt;@162/&lt;community string&gt;</strong></span><br />
<span style="color:#0000ff;">Changing notification(trap) targets list to:&#8230;</span><br />
<span style="color:#0000ff;">Complete.</span></p>
<p>Enable agent and check the configuration</p>
<p><span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;enable</strong></span><br />
<span style="color:#0000ff;">Enabling agent&#8230;</span><br />
<span style="color:#0000ff;">Complete.</span><br />
<span style="color:#0000ff;">vicfg-snmp.pl &#8211;server &lt;ESX host ip address&gt; &#8211;username root &#8211;password &lt;password&gt; <strong>&#8211;show</strong></span><br />
<span style="color:#0000ff;">Current SNMP agent settings:</span><br />
<span style="color:#0000ff;">Enabled  : 1</span><br />
<span style="color:#0000ff;">UDP port : 171</span><br />
<span style="color:#0000ff;">Communities :</span><br />
<span style="color:#0000ff;">&lt;community string&gt;</span><br />
<span style="color:#0000ff;">Notification targets :</span><br />
<span style="color:#0000ff;">&lt;ip address of trap destination&gt;@162/&lt;community string&gt;</span></p>
<h3>VMware PowerCLI</h3>
<p>It is very similar to the VMware vSphere CLI Perl script</p>
<p>Connect to ESX host</p>
<p><span style="color:#0000ff;">Connect-VIServer &lt;host ip address&gt;</span><br />
<span style="color:#0000ff;"> WARNING: There were one or more problems with the server certificate:</span><br />
<span style="color:#0000ff;"> * The X509 chain could not be built up to the root certificate.</span><br />
<span style="color:#0000ff;"> * The certificate&#8217;s CN name does not match the passed value.</span></p>
<p><span style="color:#0000ff;">Name                           Port  User</span><br />
<span style="color:#0000ff;"> &#8212;-                           &#8212;-  &#8212;-</span><br />
<span style="color:#0000ff;"> &lt;host ip address&gt;                  443   root</span></p>
<p>Check configuration and get it to the <strong>$SNMPConf</strong> variable</p>
<p><span style="color:#0000ff;">Get-VMHostSNMP</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> False      161 {}</span></p>
<p><span style="color:#0000ff;">$SNMPConf = Get-VMHostSNMP</span></p>
<p>Clear communities if you have any</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf -ReadOnlyCommunity @()</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> False      161 {}</span></p>
<p>If you try to enable it now, you will get an error message, because UDP 161 is already in use by Net-SNMP</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf -Enabled:$True</span><br />
<span style="color:#ff0000;">Set-VMHostSnmp : 17/08/2011 2:32:56 PM    Set-VMHostSnmp        A general system error occurred: Bind socket(af=2) failed, reason: 98, Address already in use</span></p>
<p>Add community</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf -ReadOnlyCommunity &lt;community name&gt;</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> False      161 {&lt;community name&gt;}</span></p>
<p>Change port number</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf –Port 171</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> False      171 {&lt;community name&gt;}</span></p>
<p>Add trap destinations</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf -AddTarget -TargetCommunity &lt;community name&gt; -TargetHost &lt;ip address of trap destination&gt;</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> False      171 {&lt;community name&gt;}</span></p>
<p>Enable agent</p>
<p><span style="color:#0000ff;">Set-VMHostSnmp -HostSnmp $SNMPConf -Enabled:$True</span><br />
<span style="color:#0000ff;"> Enabled   Port ReadOnly Communities</span><br />
<span style="color:#0000ff;"> &#8212;&#8212;-   &#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</span><br />
<span style="color:#0000ff;"> True       171 {&lt;community name&gt;}</span></p>
<p>Test the configuration</p>
<p><span style="color:#0000ff;">Test-VMHostSnmp -HostSnmp $SNMPConf</span><br />
<span style="color:#ff0000;">Test-VMHostSnmp : 19/08/2011 4:22:29 PM    Test-VMHostSnmp        A general system error occurred: Connection refused</span><br />
<span style="color:#ff0000;"> At line:1 char:16</span><br />
<span style="color:#ff0000;"> + Test-VMHostSnmp &lt;&lt;&lt;&lt;  -HostSnmp $SNMPConf</span><br />
<span style="color:#ff0000;"> + CategoryInfo          : NotSpecified: (:) [Test-VMHostSnmp], SystemError</span><br />
<span style="color:#ff0000;"> + FullyQualifiedErrorId : Client20_SystemManagementServiceImpl_TestVmHostSnmp_ViError,</span><br />
<span style="color:#ff0000;"> VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.TestVmHostSnmp</span></p>
<p>Connection refused? It happened because the current machine has not been added as a trap destination</p>
<p>Add it and test again</p>
<h3>Service Console</h3>
<p>VMware SNMP agent configuration is stored in the <strong>snmp.xml</strong> file.</p>
<p>Log on to the service console on the ESX host</p>
<p>Stop the <strong>snmpd</strong> service</p>
<p><span style="color:#0000ff;">service snmpd stop</span></p>
<p>Go to <strong>/etc/vmware</strong> and make a copy of the original configuration file to create a backup</p>
<p><span style="color:#0000ff;">cd /etc/vmware</span><br />
<span style="color:#0000ff;"> cp -p snmp.xml orig-snmp.xml</span></p>
<p>Modify the <strong>snmp.xml</strong> file:</p>
<p><span style="color:#0000ff;">&lt;config&gt;</span><br />
<span style="color:#0000ff;"> &lt;snmpSettings&gt;</span><br />
<span style="color:#0000ff;"> &lt;enable&gt;<strong>true</strong>&lt;/enable&gt;</span><br />
<span style="color:#0000ff;"> &lt;communities&gt;<strong>public</strong>&lt;/communities&gt;</span><br />
<span style="color:#0000ff;"> &lt;targets&gt;<strong>127.0.0.1@162/public</strong>&lt;/targets&gt;</span><br />
<span style="color:#0000ff;"> &lt;port&gt;<strong>171</strong>&lt;/port&gt;</span><br />
<span style="color:#0000ff;"> &lt;/snmpSettings&gt;</span><br />
<span style="color:#0000ff;"> &lt;/config&gt;</span></p>
<p>As you can see the file contains the parameters accessible via PowerCLI or vSphere CLI.</p>
<p>Restart <strong>mgmt-vmware</strong> service</p>
<p><span style="color:#0000ff;">service mgmt-vmware restart</span></p>
<p>Start the <strong>Net-SNMP</strong> service</p>
<p><span style="color:#0000ff;">service snmpd start</span></p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/monitoring/'>Monitoring</a>, <a href='http://winadminnotes.wordpress.com/category/vmware/'>VMware</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=379&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/08/22/how-to-install-snmp-on-esx-host-v4-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Elevate Privileges from Command Line</title>
		<link>http://winadminnotes.wordpress.com/2011/08/21/how-to-elevate-privileges-from-command-line/</link>
		<comments>http://winadminnotes.wordpress.com/2011/08/21/how-to-elevate-privileges-from-command-line/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 20:23:40 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Scheduled Tasks]]></category>
		<category><![CDATA[Silly Solutions]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=375</guid>
		<description><![CDATA[My task has been pretty simple: I have needed to run a batch file with a lot of Robocopy commands. The issue I have faced is usual for Windows Vista, Windows 7 or Windows Server 2008: ERROR: You do not have the Backup and Restore Files user rights. Yes, if I right click on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=375&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My task has been pretty simple: I have needed to run a batch file with a lot of Robocopy commands. The issue I have faced is usual for Windows Vista, Windows 7 or Windows Server 2008:</p>
<p><span style="color:#ff0000;">ERROR: You do not have the Backup and Restore Files user rights.</span></p>
<p>Yes, if I right click on the batch file and select <strong>Run As Administrator</strong>, everything works fine. My goal has been to run this batch file from the command line without user interaction at all. At the same time I have needed not to compromise security</p>
<p><span id="more-375"></span></p>
<p>RunAs does not help at all. In order to get the privileges elevated the Administrator user has to be used, but this user is disabled by default and I do not want to enable it.</p>
<p>I have tried to change batch file properties and set up <strong>Run This Program As an Administrator</strong>, but this checkbox has been disabled. I have done this for Robocopy.exe, but it makes situation even worse: UAC asks its question every time the batch file runs robocopy.</p>
<p><strong>Finally, I have found the solution</strong></p>
<p>I have created a scheduled task called <strong>RunBatch</strong> to run my batch file. I have not set up any schedule for it; I have checked the<strong> Run on highest privileges</strong> box on<strong> General</strong> tab and saved the task.</p>
<p>The command</p>
<p><span style="color:#0000ff;">SCHTASKS /run /tn RunBatch</span></p>
<p>runs the job with elevated privileges and without asking any question</p>
<h2></h2>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/scripts/'>Scripts</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=375&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/08/21/how-to-elevate-privileges-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Add a Group to the &#8220;Send On Behalf Of&#8221; Attribute</title>
		<link>http://winadminnotes.wordpress.com/2011/07/31/how-to-add-a-group-to-the-send-on-behalf-of-attribute/</link>
		<comments>http://winadminnotes.wordpress.com/2011/07/31/how-to-add-a-group-to-the-send-on-behalf-of-attribute/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 20:44:02 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Silly Solutions]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=366</guid>
		<description><![CDATA[Only Users and Other objects are available for the Send on Behalf of list. Groups cannot be added to the list. Almost.  A group can be added via ADSI Editor; the attribute name is publicDelegates Filed under: Active Directory<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=366&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Only Users and Other objects are available for the Send on Behalf of list. Groups cannot be added to the list. Almost.  A group can be added via ADSI Editor; the attribute name is <strong>publicDelegates</strong></p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/active-directory/'>Active Directory</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=366&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/07/31/how-to-add-a-group-to-the-send-on-behalf-of-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Set Up ManagedBy AD Attribute</title>
		<link>http://winadminnotes.wordpress.com/2011/07/31/how-to-set-up-managedby-ad-attribute/</link>
		<comments>http://winadminnotes.wordpress.com/2011/07/31/how-to-set-up-managedby-ad-attribute/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 19:29:32 +0000</pubDate>
		<dc:creator>Andrew Karmadanov</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://winadminnotes.wordpress.com/?p=361</guid>
		<description><![CDATA[It is not a big deal to set up ManagedBy property for an Active Directory group. It becomes a big deal, if there are plenty of such groups. ManagedBy is just one of the attributes of a group object, so it is pretty easy to change it. The Manager can update membership list checkbox, however, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=361&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is not a big deal to set up <strong>ManagedBy</strong> property for an Active Directory group. It becomes a big deal, if there are plenty of such groups.</p>
<p><strong>ManagedBy</strong> is just one of the attributes of a group object, so it is pretty easy to change it. The <strong>Manager can update membership list</strong> checkbox, however, is not a property. It represents the security permission on the group object, called <strong>WriteMembers</strong>. The checkbox is in fact a logical statement</p>
<p><span style="color:#0000ff;">Checkbox = (ManagedBy_Object_Permissions = WriteMembers)</span></p>
<p><span id="more-361"></span></p>
<p>Even if the <strong>ManagedBy</strong> object has full access to the group and can do whatever it wants to, the checkbox appears only if only <strong>WriteMembers</strong> permission is set up to “Allow”</p>
<p>Of course, PowerShell can help us to set up everything. The script is short, but has two interesting parts:</p>
<ol>
<li>The <strong>ManagedBy</strong> attribute requires a distinguished name, but the ACL uses SAM account name. So, the script converts one name to another one.</li>
<li>System.DirectoryServices.ActiveDirectoryAccessRule constructor (<a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectoryaccessrule.aspx">http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectoryaccessrule.aspx</a>) can be overloaded</li>
</ol>
<p>One of six variants is</p>
<p><span style="color:#0000ff;">ActiveDirectoryAccessRule(IdentityReference, ActiveDirectoryRights, AccessControlType, ActiveDirectorySecurityInheritance)</span></p>
<p>And another one is</p>
<p><span style="color:#0000ff;">ActiveDirectoryAccessRule(IdentityReference, ActiveDirectoryRights, AccessControlType, Guid)</span></p>
<p>If we use WriteMemberGUID as a type of string, the constractor assumes that this is the first variant and will raise an error.</p>
<p><span style="color:#0000ff;"> $NewAccessRule = New-Object System.DirectoryServices.ActiveDirectoryAccessRule ($ManagedByAccountObject,$WritePropertiesObject,$AllowObject,&#8217;BF9679C0-0DE6-11D0-A285-00AA003049E2&#8242;)</span></p>
<p><span style="color:#ff0000;"> New-Object : Cannot convert argument &#8220;3&#8243;, with value: &#8220;BF9679C0-0DE6-11D0-A285-00AA003049E2&#8243;, for &#8220;ActiveDirectoryAccessRule&#8221; to type &#8220;System.DirectoryServices.ActiveDirectorySecurityInheritance&#8221;: &#8220;Cannot convert value &#8220;BF9679C0-0DE6-11D0-A285-00AA003049E2&#8243; to type &#8220;System.DirectoryServices.ActiveDirectorySecurityInheritance&#8221; due to invalid enumeration values. Specify one of the following enumeration values and try again. <strong>The possible enumeration values are &#8220;None, All,Descendents, SelfAndChildren, Children&#8221;.&#8221;</strong></span></p>
<p>It suggests using values for inheritance and if we do so, it will set up entire <strong>Write</strong> permission as <strong>Allow</strong>, not just <strong>WriteMembers</strong>. The managedBy object will have permissions to change the group members, but as it has been noticed above, the checkbox will not be checked. To avoid this situation, just define GUID as the [GUID] type.</p>
<p>So, the script looks like this. The key statements are bold</p>
<p><span style="color:#0000ff;">#### Our variables</span><br />
<span style="color:#0000ff;">$ManagedByName = &#8220;CN=Karmadanov\, Andrew,OU=Users,OU=IT,DC=Domain,DC=com&#8221;</span><br />
<span style="color:#0000ff;">$Group = &#8220;CN=test-AK,OU=Groups,OU=IT,DC=Domain,DC=com&#8221;</span><br />
<span style="color:#0000ff;">#### AD Searcher. We will use it a several times</span><br />
<span style="color:#0000ff;"><strong>$ADRoot = [ADSI]&#8220;&#8221;</strong></span><br />
<span style="color:#0000ff;"><strong>$Searcher = New-Object System.Directoryservices.DirectorySearcher($ADRoot)</strong></span><br />
<span style="color:#0000ff;"><strong>$Searcher.SearchRoot = $ADRoot</strong></span><br />
<span style="color:#0000ff;"><strong>$Searcher.SearchScope = &#8220;subtree&#8221;</strong></span></p>
<p><span style="color:#0000ff;">#### Check if ManagedByName exists and get NT Authority name from it</span><br />
<span style="color:#0000ff;">$Filter = &#8220;(&amp;(objectCategory=*)(distinguishedName=$ManagedByName)&#8221;</span><br />
<span style="color:#0000ff;">$Searcher.Filter = $Filter</span><br />
<span style="color:#0000ff;">$ADObjects = $Searcher.FindAll()</span><br />
<span style="color:#0000ff;">if ($ADObjects.Count -eq 0)</span><br />
<span style="color:#0000ff;">{</span><br />
<span style="color:#0000ff;">      Write-Host ($ManagedByName + &#8221; has not been found&#8221;)</span><br />
<span style="color:#0000ff;">      return</span><br />
<span style="color:#0000ff;">}</span><br />
<span style="color:#0000ff;">$ManagedByObject = $ADObjects[0].GetDirectoryEntry()</span></p>
<p><span style="color:#0000ff;">#### Convert DN to Domain/username</span><br />
<span style="color:#0000ff;"><strong>if ($ManagedByName -match &#8220;(dc)+\s?(=).*&#8221;)</strong></span><br />
<span style="color:#0000ff;"><strong>      {$DomainDN = $matches[0]}</strong></span><br />
<span style="color:#0000ff;">else</span><br />
<span style="color:#0000ff;">{</span><br />
<span style="color:#0000ff;">      Write-Host &#8220;Error occurred while resolving the domain name&#8221;</span><br />
<span style="color:#0000ff;">      return</span><br />
<span style="color:#0000ff;">}</span><br />
<span style="color:#0000ff;">$Filter = &#8220;(&amp;(objectCategory=*)(distinguishedName=$DomainDN))&#8221;</span><br />
<span style="color:#0000ff;">$Searcher.Filter = $Filter</span><br />
<span style="color:#0000ff;">$DomainObjects = $Searcher.FindAll()</span><br />
<span style="color:#0000ff;">if ($DomainObjects.Count -eq 0)</span><br />
<span style="color:#0000ff;">{</span><br />
<span style="color:#0000ff;">      Write-Host ($DomainDN + &#8221; has not been found&#8221;)</span><br />
<span style="color:#0000ff;">      return</span><br />
<span style="color:#0000ff;">}</span><br />
<span style="color:#0000ff;">$DomainObject = $DomainObjects[0].GetDirectoryEntry()</span><br />
<span style="color:#0000ff;">$DomainName = ($DomainObject.Properties.Name[0]).ToUpper()</span></p>
<p><span style="color:#0000ff;">#### Parameters for new ACE</span><br />
<span style="color:#0000ff;"><strong>$ManagedByAccountObject</strong> = new-object System.Security.Principal.NTAccount($DomainName, $ManagedByObject.SAMAccountName)</span></p>
<p><span style="color:#0000ff;"><strong>$WritePropertiesObject</strong> = [System.DirectoryServices.ActiveDirectoryRights]::&#8221;WriteProperty&#8221;</span></p>
<p><span style="color:#0000ff;"><strong>$AllowObject</strong> = [System.Security.AccessControl.AccessControlType]::&#8221;Allow&#8221;</span></p>
<p><span style="color:#0000ff;"><strong>$WriteMembersGUID</strong> = <strong>[GUID]</strong>&#8216;BF9679C0-0DE6-11D0-A285-00AA003049E2&#8242;</span></p>
<p><span style="color:#0000ff;">#### Group object</span><br />
<span style="color:#0000ff;">$Filter = &#8220;(&amp;(objectCategory=*)(distinguishedName=$Group))&#8221;</span><br />
<span style="color:#0000ff;">$Searcher.Filter = $Filter</span><br />
<span style="color:#0000ff;">$ADObjects = $Searcher.FindAll()</span><br />
<span style="color:#0000ff;">if ($ADObjects.Count -eq 0)</span><br />
<span style="color:#0000ff;">{</span><br />
<span style="color:#0000ff;">Write-Host ($Group + &#8221; has not been found&#8221;)</span><br />
<span style="color:#0000ff;">Return</span><br />
<span style="color:#0000ff;">}</span></p>
<p><span style="color:#0000ff;">$ADEntry = $ADObjects[0].GetDirectoryEntry()</span><br />
<span style="color:#0000ff;">$LDAPLine = &#8220;LDAP://&#8221; + $Group</span><br />
<span style="color:#0000ff;">$GroupObject = [ADSI]$LDAPLine</span><br />
<span style="color:#0000ff;">$GroupObjectSecurity = $GroupObject.PSBase.get_ObjectSecurity()</span><br />
<span style="color:#0000ff;">$GroupAccessRules = $GroupObjectSecurity.GetAccessRules($True,$True,[System.Security.Principal.NTAccount])</span></p>
<p><span style="color:#0000ff;"><strong>$NewAccessRule = New-Object System.DirectoryServices.ActiveDirectoryAccessRule ($ManagedByAccountObject,$WritePropertiesObject,$AllowObject,$WriteMembersGUID)</strong></span></p>
<p><span style="color:#0000ff;">$GroupObjectSecurity.AddAccessRule($NewAccessRule)</span><br />
<span style="color:#0000ff;">$GroupObject.Put(&#8220;managedBy&#8221;,$ManagedByName)</span><br />
<span style="color:#0000ff;">$GroupObject.PSBase.CommitChanges()</span></p>
<p>As easy as that.</p>
<br />Filed under: <a href='http://winadminnotes.wordpress.com/category/active-directory/'>Active Directory</a>, <a href='http://winadminnotes.wordpress.com/category/scripts/'>Scripts</a>, <a href='http://winadminnotes.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/winadminnotes.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/winadminnotes.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/winadminnotes.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=winadminnotes.wordpress.com&amp;blog=12010127&amp;post=361&amp;subd=winadminnotes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://winadminnotes.wordpress.com/2011/07/31/how-to-set-up-managedby-ad-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1af237d7822130812bdb89942ec45aac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akarmadanov</media:title>
		</media:content>
	</item>
	</channel>
</rss>
