<?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>Shariq Sheikh &#124; Port 389 &#187; PowerShell</title>
	<atom:link href="http://www.shariqsheikh.com/blog/index.php/base/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shariqsheikh.com/blog</link>
	<description>- activity of Active Directory and the rest</description>
	<lastBuildDate>Thu, 22 Jul 2010 17:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Reviewing few very useful adds in Quest AD Cmdlets v1.4</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201007/reviewing-few-very-useful-adds-in-quest-ad-cmdlets-v1-4/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201007/reviewing-few-very-useful-adds-in-quest-ad-cmdlets-v1-4/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 16:08:09 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201007/reviewing-few-very-useful-adds-in-quest-ad-cmdlets-v1-4/</guid>
		<description><![CDATA[Whereas most of newly added cmdlets focus on&#160; PKI and Email Address Management in v1.4, there are a few cmdlets and handful of new parameters that ought to come in very handy with your AD tasks. Below I review a few that I think are some great adds : When you are enumerating a large [...]]]></description>
			<content:encoded><![CDATA[<p>Whereas most of newly added cmdlets focus on&nbsp; PKI and Email Address Management in <a href="http://www.shariqsheikh.com/blog/index.php/201007/quest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released/">v1.4</a>, there are a few cmdlets and handful of new parameters that ought to come in very handy with your AD tasks. Below I review a few that I think are some great adds :</p>
<p>When you are enumerating a large number of objects in shell (without outputting results into a file), you might just want to have a quick idea of the ‘total’ number of objects meeting the criteria of you query.</p>
<p><strong>Get-QADProgressPolicy</strong></p>
<p>“displays a progress bar for long-running commands”</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/progress_bar.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="progress_bar" border="0" alt="progress_bar" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/progress_bar_thumb.png" width="904" height="80"/></a></p>
<p>This progress bar overlays (highlights in and out) as your query is running. It also appears when you are performing a count using the measure-object cmdlet or the “.count” switch</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/progress_bar2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="progress_bar2" border="0" alt="progress_bar2" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/progress_bar2_thumb.png" width="904" height="104"/></a></p>
<p>You can set the progress bar setting and its threshold with</p>
<blockquote><p>Set-QADProgressPolicy -ShowProgress $true -ProgressThreshold 2</p>
</blockquote>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } -->The –activity parameter when relying on the progress bar allows you tag each line of progress with a number so that lengthy process is a bit more obvious with respect to the process to one or more cmdlet’s retrieved results.</p>
<p><span style="text-decoration: underline"><span style="color: #cccccc"><font color="#808040">Some new parameters :</font></span></span></p>
<p>Five new parameters for Get-QADUser</p>
<p><em>ExpiredFor </em></p>
<p><em>Inactive</em></p>
<p><em>InactiveFor</em></p>
<p><em>NotLoggedOnFor</em></p>
<p><em>PasswordNotChangedFor</em></p>
<p>Four new parameters for Get-QADComputer</p>
<p><em>Inactive </em></p>
<p><em>InactiveFor</em></p>
<p><em>NotLoggedOnFor</em></p>
<p><em>PasswordNotChangedFor</em></p>
<p>But what mechanism decides the “inactivity” benchmark to ask cmdlet to retrieve that information ?</p>
<p><em>You do.</em></p>
<p><strong>Get-QADInactiveAccountsPolicy</strong></p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/inactivepolicy1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="inactivepolicy1" border="0" alt="inactivepolicy1" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/inactivepolicy1_thumb.png" width="904" height="73"/></a></p>
<p>You can change these settings,</p>
<blockquote><div class="csharpcode">Set-QADInactiveAccountsPolicy -AccountExpiredPeriod 0 -AccountNotLoggedOnPeriod 30 –PasswordNotChangedPeriod 120</div>
</blockquote>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>Note : These settings are profile specific so ones you define these thresholds they will stay there until you change those settings again.</p>
<p>The<strong> NotLoggedOnPeriod</strong> is probably based on the LastLogonTimeStamp, but I will check and edit this post if its any different. If it is, remember it may not be accurate and should only be used for estimation. The LastLogonTimeStamp gets updated from the LastLogon (DC specific attribute) based on a 9-14 day swing period.</p>
<p>Also :</p>
<blockquote><p>“This parameter overrides the logon-related inactivity condition of the Inactive or InactiveFor parameter. Thus, if the NotLoggedOnFor value of 60 is supplied in conjunction with the InactiveFor value of 30, the cmdlet searches for accounts that are expired for 30 or more days, or have the password age of 30 or more days, or have not been used to log on for 60 or more days.”</p>
</blockquote>
<p>Previously if you had to use the Get-QADGroupMember cmdlet to retrieve the enabled accounts only, you had to pass the LDAPFilter, now you can use the same –enabled and –disabled parameter as you could with Get-QADUser cmdlet since v1.3.</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/groupmemberdisabled.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="groupmemberdisabled" border="0" alt="groupmemberdisabled" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/07/groupmemberdisabled_thumb.png" width="904" height="104"/></a></p>
<p>This and much more. All details can be found <a href="http://wiki.powergui.org/index.php/QAD_cmdlets_reference">here</a>.</p>
<p>The folks who develop these cmdlets and work on adding new parameters do take the feedback very seriously. I have myself asked and gotten couple of requests met. You can do the <a href="http://powergui.org/thread.jspa?threadID=11225&amp;tstart=0">same</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201007%2Freviewing-few-very-useful-adds-in-quest-ad-cmdlets-v1-4%2F&amp;linkname=Reviewing%20few%20very%20useful%20adds%20in%20Quest%20AD%20Cmdlets%20v1.4">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201007/reviewing-few-very-useful-adds-in-quest-ad-cmdlets-v1-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quest AD Cmdlets a.k.a Active Roles Management Shell version 1.4 gets released</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201007/quest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201007/quest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 21:55:12 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201007/quest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released/</guid>
		<description><![CDATA[From version 1.2 with 49 cmdlets, to version 1.3 with 63 cmdlets and now on to version 1.4 that has 32 new cmdlets making it total of 95. Here are the new cmdlets in v1.4 : • Get-QADLocalCertificateStore • New-QADLocalCertificateStore • Remove-QADLocalCertificateStore • Get-QADCertificate • Where-QADCertificate • Add-QADCertificate • Import-QADCertificate • Show-QADCertificate • Edit-QADCertificate • [...]]]></description>
			<content:encoded><![CDATA[<p>From version 1.2 with 49 cmdlets, to version 1.3 with 63 cmdlets and now on to version 1.4 that has 32 new cmdlets making it total of 95.</p>
<p>Here are the new cmdlets in v1.4 :</p>
<p>• Get-QADLocalCertificateStore<br />
• New-QADLocalCertificateStore<br />
• Remove-QADLocalCertificateStore<br />
• Get-QADCertificate<br />
• Where-QADCertificate<br />
• Add-QADCertificate<br />
• Import-QADCertificate<br />
• Show-QADCertificate<br />
• Edit-QADCertificate<br />
• Export-QADCertificate<br />
• Remove-QADCertificate<br />
• Remove-QADPrivateKey<br />
• Get-QADCertificateRevocationList<br />
• Add-QADCertificateRevocationList<br />
• Import-QADCertificateRevocationList<br />
• Export-QADCertificateRevocationList<br />
• Remove-QADCertificateRevocationList<br />
• Get-QADPKIObject<br />
• Publish-QADCertificate<br />
• Unpublish-QADCertificate<br />
• Publish-QADCertificateRevocationList<br />
• Unpublish-QADCertificateRevocationList<br />
• Add-QADProxyAddress<br />
• Set-QADProxyAddress<br />
• Remove-QADProxyAddress<br />
• Clear-QADProxyAddress<br />
• Enable-QADEmailAddressPolicy<br />
• Disable-QADEmailAddressPolicy<br />
• Set-QADProgressPolicy<br />
• Get-QADProgressPolicy<br />
• Set-QADInactiveAccountsPolicy<br />
• Get-QADInactiveAccountsPolicy</p>
<p>With tons of new parameters and bug fixes. All details can be found under ‘ARMS Build History’ text file under the zip file.</p>
<p><a title="http://www.quest.com/powershell/activeroles-server.aspx" href="http://www.quest.com/powershell/activeroles-server.aspx">http://www.quest.com/powershell/activeroles-server.aspx</a></p>
<p>Also Dmitry Sotnikov tweeted regarding the updated cmdlet references wiki :</p>
<p><a title="http://wiki.powergui.org/index.php/QAD_cmdlets_reference" href="http://wiki.powergui.org/index.php/QAD_cmdlets_reference">http://wiki.powergui.org/index.php/QAD_cmdlets_reference</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201007%2Fquest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released%2F&amp;linkname=Quest%20AD%20Cmdlets%20a.k.a%20Active%20Roles%20Management%20Shell%20version%201.4%20gets%20released">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201007/quest-ad-cmdlets-a-k-a-active-roles-management-shell-version-1-4-gets-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Active Directory Delegations Report with PowerGUI</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201006/create-active-directory-delegations-report-with-powergui/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201006/create-active-directory-delegations-report-with-powergui/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 16:30:24 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201006/creating-active-directory-delegations-report-with-powergui/</guid>
		<description><![CDATA[Often times you need to analyze your existing permissions (delegations) on your AD Objects within your domain/forest, perhaps you have just taken over an administrative role over AD and would like to quickly surface information regarding what group and user accounts have certain rights across the board in a pertinent domain. With PowerGUI and Kirk [...]]]></description>
			<content:encoded><![CDATA[<p>Often times you need to analyze your existing permissions (delegations) on your AD Objects within your domain/forest, perhaps you have just taken over an administrative role over AD and would like to quickly surface information regarding what group and user accounts have certain rights across the board in a pertinent domain. With PowerGUI and Kirk Munro’s “Reporting” PowerPack, you can generate nicely formatted HTML files (that expand and collapse) for each object that has delegated permissions within AD.</p>
<p>1. <a href="http://powergui.org/downloads.jspa">Download PowerGUI 2.1 from here</a></p>
<p>2. <a href="http://powergui.org/entry.jspa?externalID=2423&amp;categoryID=52">Get the Advanced Reporting PowerPack from here</a></p>
<p>3. Launch PowerGUI and import Advanced Reporting PowerPack</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/ImportPowerPack.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ImportPowerPack" border="0" alt="ImportPowerPack" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/ImportPowerPack_thumb.png" width="644" height="337"/></a></p>
<p>4. Click on the root node, go to New and click on the ‘Script Node’ sub-menu option</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/CreateScriptNode.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="CreateScriptNode" border="0" alt="CreateScriptNode" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/CreateScriptNode_thumb.png" width="644" height="285"/></a></p>
<p>5. Name your script in the Title bar and type the following cmdlet in the body of the script</p>
<div class="csharpcode">
<pre class="alt">Get-QADObject -Type organizationalUnit -SecurityMask dacl | Get-QADPermission</pre>
</div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/TypeCmd.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="TypeCmd" border="0" alt="TypeCmd" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/TypeCmd_thumb.png" width="644" height="180"/></a> 6. By hitting OK the report will run. From the Action Pane (right) click on the ‘Create Report’ link, name the report and add the desired attribute you would like to export on the report</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/Report.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Report" border="0" alt="Report" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/Report_thumb.png" width="644" height="252"/></a></p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/IncludeReport.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="IncludeReport" border="0" alt="IncludeReport" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/IncludeReport_thumb.png" width="644" height="271"/></a> 7.&nbsp; Hit OK and and your HTML based report will be saved by default in your Documents\PowerGUI Exports folder.</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/ReportHTML.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ReportHTML" border="0" alt="ReportHTML" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/06/ReportHTML_thumb.png" width="537" height="484"/></a>You can create all sorts of reports from your AD, do any modifications to your scripts, the format how the Report Pack creates the HTML report and how it generates the data. Download PowerGUI and the Reporting PowerPack and start playing with it.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201006%2Fcreate-active-directory-delegations-report-with-powergui%2F&amp;linkname=Create%20Active%20Directory%20Delegations%20Report%20with%20PowerGUI">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201006/create-active-directory-delegations-report-with-powergui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How to rename Groups in bulk ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201005/powershell-how-to-rename-groups-in-bulk/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201005/powershell-how-to-rename-groups-in-bulk/#comments</comments>
		<pubDate>Tue, 04 May 2010 15:23:17 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201005/powershell-how-to-rename-groups-in-bulk/</guid>
		<description><![CDATA[Often times there is a need to standardized Groups’ naming convention such as with migrations, when you don’t have a rich migration tool that can conform the names or when you don’t have a AD proxy management tool such as ARS in your normal provisioning process. Using Quest Cmdlets with PowerShell to rename groups is [...]]]></description>
			<content:encoded><![CDATA[<p>Often times there is a need to standardized Groups’ naming convention such as with migrations, when you don’t have a rich migration tool that can conform the names or when you don’t have a AD proxy management tool such as ARS in your normal provisioning process. Using Quest Cmdlets with PowerShell to rename groups is a snap. There are numerous ways you can fit the Cmdlets and different parameters to meet your need. In this post, I show you a few ways I have used to rename groups in bulk.</p>
<p>Following is an example where all (or most of your groups have a company name as prefix and now that the migration has occurred you would like to strip the company name out.</p>
<p>First, lets take a quick inventory to define your scope;</p>
<blockquote><p>Get-QADGroup -Name companyname* -sizelimit 0 | ft name, SamAccountName</p>
</blockquote>
<p>You can also define a specific OU to target a specific location;</p>
<blockquote><p>Get-QADGroup -name companyname* -searchscope <span class="str">&#8220;onelevel&#8221;</span> -searchroot <span class="str">&#8220;ou=Groups,ou=,dc=mydomain,dc=int&#8221;</span> -sizelimit 0</p>
</blockquote>
<p>Note that the ‘companyname’ string is the number of characters i.e 11 is what we are manipulating and stripping out here;</p>
<blockquote><p>Get-QADGroup -name companyname* -searchscope <span class="str">&#8220;onelevel&#8221;</span> -searchroot <span class="str">&#8220;ou=Groups,ou=,dc=mydomain,dc=int&#8221;</span> -sizelimit 0 | Rename-QADObject -newName {$_.name.substring(11)} -whatif | Set-QADGroup -samAccountName {$_.samAccountName.substring(11)} -whatif</p>
</blockquote>
<p></p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } -->Always use the –whatif parameter to confirm what changes you are about to make before you process the change. If needed, export the results out to a CSV by adding the export-csv cmdlet at the end.&nbsp; Note, in above the piping “|” can be written on the same line, ignore the wrapping due the site layout.</p>
<p>Similarly, you can chose to rename to rename by adding a new name or after you have stripped out the name completely, you can add a new prefix to your groups</p>
<blockquote><p>Get-QADGroup -searchscope <span class="str">&#8220;onelevel&#8221;</span> -searchroot <span class="str">&#8220;ou=Groups,ou=,dc=mydomain,dc=int&#8221;</span> -sizelimit 0 | FOREACH {Rename-QADObject $_ -newName (<span class="str">&#8220;IT-&#8221;</span> + $_.name)} </p>
</blockquote>
<p></p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } -->Above query will grab all the Groups from the defined path and will add “IT-“ as the prefix to all groups. Make sure to append the –samAccountName command to ensure that rename happens properly.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201005%2Fpowershell-how-to-rename-groups-in-bulk%2F&amp;linkname=PowerShell%20%3A%20How%20to%20rename%20Groups%20in%20bulk%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201005/powershell-how-to-rename-groups-in-bulk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell : What’s my PowerShell version ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201003/powershell-whats-my-powershell-version/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201003/powershell-whats-my-powershell-version/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 16:26:02 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201003/powershell-whats-my-powershell-version/</guid>
		<description><![CDATA[There are two types of PowerShell versions out there. PowerShell v1 that dates back to 2006 and the PowerShell v2 that is bundled with Windows 7 and Windows Server 2008 R2, and also mysteriously released for down level clients such as Windows Vista and XP (under vaguely named Windows Management Framework (Windows PowerShell 2.0, WinRM [...]]]></description>
			<content:encoded><![CDATA[<p>There are two types of PowerShell versions out there. PowerShell v1 that dates back to 2006 and the PowerShell v2 that is bundled with Windows 7 and Windows Server 2008 R2, and also mysteriously released for down level clients such as Windows Vista and XP (under vaguely named <a href="http://support.microsoft.com/kb/968929">Windows Management Framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0</a>). </p>
<p>An easy of distinguishing both versions is to look for a PowerShell variable called <strong>$psversiontable</strong>. If it is not defined, then you are running v1. If it is there, you have v2. You can also look at a registry key to differentiate between v1 and v2: <em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine\PowerShellVersion</em>. </p>
<p>Note that if PowerShell was installed as an update package you may not find it under installed software. You may have to look at the update packages. Also note that PowerShell v2 can be installed over v1 without having to uninstall v1 first. If you were running any CTP versions than the install may make you find and manually uninstall v1 first.  </p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/03/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/03/image_thumb.png" width="796" height="241"/></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201003%2Fpowershell-whats-my-powershell-version%2F&amp;linkname=PowerShell%20%3A%20What%E2%80%99s%20my%20PowerShell%20version%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201003/powershell-whats-my-powershell-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How do I fix displayName attribute for all users in Active Directory ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-fix-displayname-attribute-for-all-users-in-active-directory/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-fix-displayname-attribute-for-all-users-in-active-directory/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 22:16:25 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[One-liner]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-fix-displayname-attribute-for-all-users-in-active-directory/</guid>
		<description><![CDATA[For small shops that do not leverage automated provisioning tools, they face challenge in keeping the attributes for Users and other objects in AD standardized. For similar situation, recently I was asked from Access Control team if there is an easy way to fix the displayName attribute for all users or to fill in the [...]]]></description>
			<content:encoded><![CDATA[<p>For small shops that do not leverage automated provisioning tools, they face challenge in keeping the attributes for Users and other objects in AD standardized. For similar situation, recently I was asked from Access Control team if there is an easy way to fix the displayName attribute for all users or to fill in the display name where its missing based on the Users’ first and last name. The answer is a simple PowerShell one-liner using Quest Cmdlets.</p>
<p>Using <strong><em>Get-QADUser</em></strong> cmdlet, you can define the location of all your users using the –searchlevel parameter or you can sweep the whole directory for all user accounts. And then pipe the results to the <em>foreach</em> and use <em><strong>Set-QADuser</strong></em> to fix the display names (in this example) based on the users’ first and last name</p>
<div id="codeSnippetWrapper">
<pre class="csharpcode">Get-QADUser mydomain.int/users -sl 0 | <span class="kwrd">foreach</span> {Set-QADUser $_ -DisplayName (<span class="str">"{0} {1}"</span> -f $_.firstname,$_.lastname)}</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
</div>
<p>The –sl 0 parameter defines the limit of users to 0.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201002%2Fpowershell-how-do-i-fix-displayname-attribute-for-all-users-in-active-directory%2F&amp;linkname=PowerShell%20%3A%20How%20do%20I%20fix%20displayName%20attribute%20for%20all%20users%20in%20Active%20Directory%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-fix-displayname-attribute-for-all-users-in-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How do I check Active Directory Tombstone Lifetime ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-check-active-directory-tombstone-lifetime/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-check-active-directory-tombstone-lifetime/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 03:45:38 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-check-active-directory-tombstone-lifetime/</guid>
		<description><![CDATA[What is Active Directory Tombstone Lifetime (TSL) ? The tombstone lifetime in an Active Directory forest determines how long a deleted object (called a “tombstone”) is retained in Active Directory Domain Services (AD DS). The tombstone lifetime is determined by the value of the tombstoneLifetime attribute on the Directory Service object in the configuration directory [...]]]></description>
			<content:encoded><![CDATA[<p>What is Active Directory Tombstone Lifetime (TSL) ?</p>
<blockquote><p>The tombstone lifetime in an Active Directory forest determines how long a deleted object (called a “tombstone”) is retained in Active Directory Domain Services (AD DS). The tombstone lifetime is determined by the value of the <strong>tombstoneLifetime</strong> attribute on the Directory Service object in the configuration directory partition.</p></blockquote>
<p>Directory Services veteran and MVP Joe Richards has <a href="http://blog.joeware.net/2010/02/05/1896/">published a short blog entry</a> demystifying the confusion a <a href="http://technet.microsoft.com/en-us/library/cc784932%28WS.10%29.aspx">technet article</a> has caused in regards to how to go about figuring a TSL on a particular domain. Note that new forests that are installed with Windows Server 2003 with SP1 and up have a default tombstone lifetime of 180 days.</p>
<p>Joe shares his ADFIND tool to lookup the current value of the TSL attribute (irrespective of what OS was used to build the forest). Note that as Joe pointed out if this attribute is not set (i.e empty value) then the TSL is 60 days. Here I show you how to lookup the TSL with PowerShell.</p>
<p>Using Quest cmdlets :</p>
<blockquote><p>Get-QADbject “CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=yourdomain,DC=int” includeallproperties | Select TombstoneLifetime</p></blockquote>
<p>And with using native AD cmdlets (of ADWS) in Windows Server 2008 R2 :</p>
<blockquote><p>Get-ADObject -Identity “CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=R2,DC=lab” -properties tombstonelifetime</p></blockquote>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/02/TSL.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="TSL" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2010/02/TSL_thumb.png" border="0" alt="TSL" width="900" height="145" /></a></p>
<p>Also within PowerShell, you can also use ADSI to lookup the TSL value.</p>
<blockquote><p>[ADSI]$config=LDAP://cn=Directory Service,cn=Windows NT,cn=Services,cn=Configuration,DC=R2,dc=lab</p></blockquote>
<blockquote><p>$config.TombstoneLifetime</p></blockquote>
<p>Also, here is how you can use DSQUERY from the Windows Support Tools to lookup the TSL.</p>
<blockquote><p>dsquery * “CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=R2,DC=lab” -scope base –attr</p>
<p>tombstonelifetime</p></blockquote>
<p>Note that I have used my test forest’s DN of R2.lab in above examples, be sure to replace the values with your forest’s DN. Above query should be typed in one line.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F201002%2Fpowershell-how-do-i-check-active-directory-tombstone-lifetime%2F&amp;linkname=PowerShell%20%3A%20How%20do%20I%20check%20Active%20Directory%20Tombstone%20Lifetime%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/201002/powershell-how-do-i-check-active-directory-tombstone-lifetime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How many users were created in an office since x number of days ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/200912/powershell-how-many-users-were-created-in-an-office-since-x-number-of-days/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/200912/powershell-how-many-users-were-created-in-an-office-since-x-number-of-days/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 00:12:02 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/200912/powershell-how-many-users-were-created-in-an-office-since-x-number-of-days/</guid>
		<description><![CDATA[A request came in from the Access Control team requesting that they be provided with the users that have been created in a particular office since last 90 days. As usual, PowerShell (with QAD cmdlets) has very simple one liners you can retrieve this information with. You may also use this to export this data [...]]]></description>
			<content:encoded><![CDATA[<p>A request came in from the Access Control team requesting that they be provided with the users that have been created in a particular office since last 90 days. As usual, PowerShell (with QAD cmdlets) has very simple one liners you can retrieve this information with.</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/12/GeUsersCreatedinlast90days.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Ge-UsersCreatedinlast90days" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/12/GeUsersCreatedinlast90days_thumb.png" border="0" alt="Ge-UsersCreatedinlast90days" width="982" height="67" /></a></p>
<p>You may also use this to export this data to a CSV file. Notice that when using the export-csv cmdlet you must choose the ‘select’ and define the attributes that should be exported. Format-Table (aliased above as FT) is used to display the information on the console.</p>
<blockquote><p>GetQADUser-sizelimit 0 | where{$_.whencreated -gt (get-date).adddays(-90)}| select Name,WhenCreated,DN | Export-csv c:\Users90days.csv</p></blockquote>
<p>There is always a couple of ways to accomplish the same task with further fine tuning your query. As you can see that above query would grab all the users in the domain, going by their whenCreated attribute and present you the pertinent users.</p>
<p>You can define the OU to search with the –searchroot parameter.</p>
<blockquote><p>Get-QADUser –Searchroot ‘test.mydomain.int/Users/Chicago/’ | where{$_.whencreated -gt (get-date).adddays(-90)}</p></blockquote>
<p>Alternatively, if you would to like find users account that have been modified since x number of days, you can try something like this.</p>
<blockquote><p>$OU = &lt;OU PATH&gt;<br />
Get-QADUser -LastChangedAfter (get-date).adddays(-7) -search $OU -sl 0 | ft name,whenchanged</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F200912%2Fpowershell-how-many-users-were-created-in-an-office-since-x-number-of-days%2F&amp;linkname=PowerShell%20%3A%20How%20many%20users%20were%20created%20in%20an%20office%20since%20x%20number%20of%20days%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/200912/powershell-how-many-users-were-created-in-an-office-since-x-number-of-days/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerShell : Add-Computer cmdlet works in Windows 7 RTM but Rename-Computer is gone</title>
		<link>http://www.shariqsheikh.com/blog/index.php/200909/add-computer-cmdlet-works-in-windows-7-rtm/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/200909/add-computer-cmdlet-works-in-windows-7-rtm/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 00:48:59 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/index.php/200909/add-computer-cmdlet-works-in-windows-7-rtm/</guid>
		<description><![CDATA[I had earlier posted about the Add-Computer cmdlet bug in Windows 7 RC builds which didn’t allow the computer to be added to the domain via PowerShell. With Windows 7 RTM, it is fixed and turns out to be pretty handy should you need to script the domain joins for your new builds. The command [...]]]></description>
			<content:encoded><![CDATA[<p>I had earlier posted about the <a href="http://www.shariqsheikh.com/blog/index.php/200904/add-computer-cmdlet-bug-in-powershell-v2-in-windows-7/" target="_blank">Add-Computer cmdlet bug</a> in Windows 7 RC builds which didn’t allow the computer to be added to the domain via PowerShell. With Windows 7 RTM, it is fixed and turns out to be pretty handy should you need to script the domain joins for your new builds. The command to add the machine is pretty simple.</p>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/09/windows720090924220559.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Windows7-2009-09-24-22-05-59" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/09/windows720090924220559-thumb.png" border="0" alt="Windows7-2009-09-24-22-05-59" width="644" height="137" /></a></p>
<p>The –passthru switch as chosen in the example shows the results.</p>
<p>Check out help for what you can do with this cmdlet such as when you need to add the computer account to a specific OU. Remember that adding machine via PowerShell to the domain does not require you to create the computer name before hand, but it pre-exists than its not an issue.</p>
<p>Few examples :</p>
<p>Add-Computer -domainname Domain02 -OUPath OU=testOU,DC=domain,DC=Domain,DC=com</p>
<p>Add-computer -workgroupname WORKGROUP-A</p>
<p>Add-computer -domainname Domain01; restart-computer   (this adds the restart option)</p>
<p>For more info. see <a title="http://technet.microsoft.com/en-us/library/dd347556.aspx" href="http://technet.microsoft.com/en-us/library/dd347556.aspx">http://technet.microsoft.com/en-us/library/dd347556.aspx</a></p>
<p>For reasons unknown to me the useful Rename-Computer cmdlet (shown in my earlier example) seems to have been removed past CTP3 builds and the RTM. Even though the <a href="http://technet.microsoft.com/en-us/library/dd367858(WS.10).aspx">technet reference for all Windows 7 PowerShell cmdlets</a> still has it listed.</p>
<p>Here is a discussion I found.</p>
<p><a href="http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/8cdf0302-a41d-4973-9bff-2923e7ad0178">http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/8cdf0302-a41d-4973-9bff-2923e7ad0178<br />
</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F200909%2Fadd-computer-cmdlet-works-in-windows-7-rtm%2F&amp;linkname=PowerShell%20%3A%20Add-Computer%20cmdlet%20works%20in%20Windows%207%20RTM%20but%20Rename-Computer%20is%20gone">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/200909/add-computer-cmdlet-works-in-windows-7-rtm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How do I look up AdminCount for AdminSDHolder and SDPROP ?</title>
		<link>http://www.shariqsheikh.com/blog/index.php/200908/use-powershell-to-look-up-admincount-from-adminsdholder-and-sdprop/</link>
		<comments>http://www.shariqsheikh.com/blog/index.php/200908/use-powershell-to-look-up-admincount-from-adminsdholder-and-sdprop/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 21:24:11 +0000</pubDate>
		<dc:creator>Rick</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.shariqsheikh.com/blog/?p=613</guid>
		<description><![CDATA[What is the AdminSDHolder and SDPROP ? Ever wonder what controls the native permissions on the security principal such as Domain Admins and Administrators in Active Directory ? What if an owner changes the permission these entities have ? The permissions do come back. They must. John Policelli had a great article on the subject [...]]]></description>
			<content:encoded><![CDATA[<p>What is the AdminSDHolder and SDPROP ?</p>
<p>Ever wonder what controls the native permissions on the security principal such as Domain Admins and Administrators in Active Directory ? What if an owner changes the permission these entities have ? The permissions do come back. They must. John Policelli had a <a href="http://technet.microsoft.com/en-us/magazine/2009.09.sdadminholder.aspx">great article</a> on the subject of AdminSDHolder and SDPROP in this month&#8217;s technet article. The magic is driven by the AdminSDHolder which is an object that resides under the System container of Domain NC. This object has a unique ACL which is used to control the permissions of security principals that are members of built-in AD groups, also known as &#8220;protected groups&#8221;. The SDPROP (Security Descriptor Propagator) is the process that runs in the background and complies all the permissions according to the AdminSDHolder.</p>
<blockquote><p>Every hour, a background process called SDPROP runs on the domain controller that holds the PDC Emulator operations master role. It compares the ACL on all security principals (users, groups and computer accounts) that belong to protected groups against the ACL on the AdminSDHolder object. If the ACL lists aren&#8217;t the same, the ACL on the security principal is overwritten with the ACL from the Admin–SDHolder object. In addition, inheritance is disabled on the security principal.</p>
</blockquote>
<p>John has done an excellent job on explaining the process and how it can affect you. I would like to show you the one-liners with which you can look-up who is part of that &#8220;elite&#8221; bunch in your AD with PowerShell <a href="http://www.shariqsheikh.com/blog/index.php/200907/what-is-active-directory-management-gateway-service-admgs/">(ADWS)</a> on Windows Server 2008 R2 and as well with PowerShell (and Quest) in Windows Server 2003 domain.</p>
<p>For every recipient of this process i.e security principal such as user, group or computer, there is an attribute named &#8220;admincount&#8221; that gets marked as &#8220;1&#8243; indicating that this principal via nesting or explicitly is part of a protected group in AD.</p>
<p>On Windows Server 2008 R2 where can you use <a href="http://www.shariqsheikh.com/blog/index.php/200907/what-is-active-directory-management-gateway-service-admgs/">(ADWS)</a>, the simple command to retrieve the user and group objects with admincount set as 1 is this.</p>
<blockquote><p>Get-ADgroup -LDAPFilter &#8220;(admincount=1)&#8221; | select name</p>
</blockquote>
<blockquote><p>Get-ADuser -LDAPFilter &#8220;(admincount=1)&#8221; | select name</p>
</blockquote>
<p><a href="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/08/08admincount11.png"><img class="alignleft size-full wp-image-619" title="08admincount11" alt="08admincount11" src="http://www.shariqsheikh.com/blog/wp-content/uploads/2009/08/08admincount11.png" width="800" height="371"/></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>In domains that are pre-Windows Server 2008 R2, you can use similar <a href="http://www.shariqsheikh.com/blog/index.php/200812/put-powershell-and-qad-cmdlets-together-to-become-a-lazyier-yet-smarter-system-admin/">QAD cmdlets</a>.</p>
<blockquote><p>Get-QADGroup -LDAPFilter &#8220;(admincount=1)&#8221;</p>
</blockquote>
<blockquote><p>Get-QADuser -LDAPFilter &#8220;(admincount=1)&#8221;</p>
</blockquote>
<p>If you would just like to get the total number of users, you may count it like this.</p>
<blockquote><p>(Get-QADuser -Ldap &#8220;(admincount=1)&#8221;).count</p>
</blockquote>
<p>Another great read on AdminCount, AdminSDHolder, and SDPROP is <a href="http://theessentialexchange.com/blogs/michael/archive/2008/10/22/admincount-adminsdholder-sdprop-and-you.aspx">right here</a> from Mike B. Smith.</p>
<p>Some discrepencies pointed out by Joe in the technet article. He explains in great detail. <a href="http://blog.joeware.net/2009/09/08/1693/">http://blog.joeware.net/2009/09/08/1693/</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.shariqsheikh.com%2Fblog%2Findex.php%2F200908%2Fuse-powershell-to-look-up-admincount-from-adminsdholder-and-sdprop%2F&amp;linkname=PowerShell%20%3A%20How%20do%20I%20look%20up%20AdminCount%20for%20AdminSDHolder%20and%20SDPROP%20%3F">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.shariqsheikh.com/blog/index.php/200908/use-powershell-to-look-up-admincount-from-adminsdholder-and-sdprop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
