<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Active Directory Powershell Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/adpowershell/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/adpowershell/feed.xml</link>
    <description>Pipelining AD – one object at a time</description>
    <lastBuildDate>Wed, 24 Feb 2016 09:17:03 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Disable loading the default drive ‘AD:’ during import-module</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/disable-loading-the-default-drive-ad-during-import-module</link>
      <pubDate>Mon, 12 Apr 2010 10:34:00 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2010/04/12/disable-loading-the-default-drive-ad-during-import-module/</guid>
      <description><![CDATA[All of you who have used the Active Directory (AD) powershell module would have noticed that every...]]></description>
      <content:encoded><![CDATA[<p>All of you who have used the Active Directory (AD) powershell module would have noticed that every time you import the AD module, a default drive &lsquo;AD:&rsquo; is also loaded. So when you type the following command:</p>
<p><span style="font-family: Courier New; font-size: x-small;">Import-module ActiveDirectory</span></p>
<p>You see a progress bar with a message like following:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image001%5B7%5D.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image001%5B7%5D.jpg"><img height="109" width="627" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image001%5B7%5D_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image001%5B7%5D_thumb.jpg" alt="clip_image001[7]" border="0" title="clip_image001[7]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>Basically, during the import-module phase, the AD provider tries to mount a new drive with the name &lsquo;AD&rsquo; targeting a Domain Controller (DC). It locates the DC by using the DsGetDcName APIs implemented by the Netlogon service. More information about DC location can be found <a href="https://support.microsoft.com/kb/247811">here</a>. </p>
<p>Upon finding a DC which satisfies certain conditions like the availability of the web service etc, the AD provider tries to mount a new drive targeting that DC. Let&rsquo;s say that the name of the DC found is <i>MyClosestDC.domain.com,</i> then mounting the drive is similar to typing the following command:</p>
<p><span style="font-size: x-small;"><span style="font-family: Courier New;">New-PSDrive &ndash;Name &ldquo;AD&rdquo; &ndash;Root &ldquo;&rdquo; &ndash;PsProvider ActiveDirectory &ndash;server &ldquo;<i>MyClosestDC.domain.com&rdquo;</i></span></span></p>
<p><b></b></p>
<p>Do note that the AD Provider targets the DC in the current machine&rsquo;s domain. If a DC is not found, as in the case of a machine which is not domain joined, then the default drive is not created and a warning is displayed.</p>
<p><b></b></p>
<p><b>Disable the loading of the default drive</b></p>
<p>If for some reason, you want to disable the loading of the default drive, then all you have to do is set the value of the environment variable &lsquo;ADPS_LoadDefaultDrive&rsquo; to &lsquo;0&rsquo;. In powershell, this can be achieved by typing the following command:</p>
<p><span style="font-family: Courier New; font-size: x-small;">PS Env:\&gt; $Env:ADPS_LoadDefaultDrive = 0</span></p>
<p>Now when you import the AD module, the default drive will not be loaded.</p>
<p>This is particularly useful when you are trying to invoke an ADPowershell cmdlet through a command line or vb/powershell script and do not want to load the drive. For example following can be run in a cmd window:</p>
<p><span style="font-family: Courier New; font-size: x-small;">C:\Windows\System32&gt; Powershell.exe &ndash;Command&nbsp;$Env:ADPS_LoadDefaultDrive=0; Import-Module ActiveDirectory; Get-ADUser muali -server MyDC;</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image003%5B4%5D.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image003%5B4%5D.jpg"><img height="227" width="1148" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image003%5B4%5D_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/DisableloadingthedefaultdriveADduringimp_104CF/clip_image003%5B4%5D_thumb.jpg" alt="clip_image003[4]" border="0" title="clip_image003[4]" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>Please note the above powershell commands only effect the <b>current user session</b>. For a permanent change in the environment variables, use SETX as following:</p>
<p><span style="font-family: Courier New; font-size: x-small;">PS C:\&gt; SETX ADPS_LoadDefaultDrive 0 /M</span></p>
<p>Cheers,</p>
<p>Ali</p>
<p>---</p>
<p>Mudassir Ali</p>
<p>Software Development Engineer in Test &ndash; Active Directory Powershell Team</p>]]></content:encoded>
    </item>
    <item>
      <title>Find out when your Password Expires</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/find-out-when-your-password-expires</link>
      <pubDate>Fri, 26 Feb 2010 15:12:00 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2010/02/26/find-out-when-your-password-expires/</guid>
      <description><![CDATA[Few weeks ago I came across this question &ldquo;How to find out an account&rsquo;s password...]]></description>
      <content:encoded><![CDATA[<p>Few weeks ago I came across this question &ldquo;How to find out an account&rsquo;s password expiration date&rdquo; in one of our internal mailing-list. This looks like a simple question, but when we tried to find the answer we realized it is not a trivial task. One of my colleagues pointed to <a href="https://msdn.microsoft.com/en-us/library/ms974598.aspx">this</a> 22-printed page detailed MSDN article that describes how to find a user account&rsquo;s password expiration date. The steps described in this article are a bit outdated. It does not take <a href="https://www.bing.com/search?q=AD+DS+fine+grained+password+policy">Fine-Grained Password policy</a> (a new feature added in Windows 2008) into account while calculating the maximum password age. With the addition of fine grained password policy, this becomes an even more daunting task to do. Using AD Powershell this task can be achieved with ~40 lines of script-code. Here is function that calculates the password expiration date of a user object given its samAccountName, security identifier or DistinguishedName.</p>
<pre class="scroll"><code class="cplusplus"><span style="color: #0000ff;">function</span> Get-XADUserPasswordExpirationDate() {
<br />    <span style="color: #0000ff;">Param</span> ([Parameter(Mandatory=$true,  Position=0,  ValueFromPipeline=$true, HelpMessage="Identity of the Account")]
<br />    [Object] $accountIdentity)
<br />    PROCESS {
<br />        $accountObj = Get-ADUser $accountIdentity -properties PasswordExpired, PasswordNeverExpires, PasswordLastSet
<br />        <span style="color: #0000ff;">if</span> ($accountObj.PasswordExpired) {
<br />            echo ("Password of account: " + $accountObj.Name + " already expired!")
<br />        } <span style="color: #0000ff;">else</span> { 
<br />            <span style="color: #0000ff;">if</span> ($accountObj.PasswordNeverExpires) {
<br />                echo ("Password of account: " + $accountObj.Name + " is set to never expires!")
<br />            } <span style="color: #0000ff;">else</span> {
<br />                $passwordSetDate = $accountObj.PasswordLastSet
<br />                <span style="color: #0000ff;">if</span> ($passwordSetDate -eq $null) {
<br />                    echo ("Password of account: " + $accountObj.Name + " has never been set!")
<br />                }  <span style="color: #0000ff;">else</span> {
<br />                    $maxPasswordAgeTimeSpan = $null
<br />                    $dfl = (get-addomain).DomainMode
<br />                    <span style="color: #0000ff;">if</span> ($dfl -ge 3) { 
<br />                        <span style="color: #008000;">## Greater than Windows2008 domain functional level</span>
<br />                        $accountFGPP = Get-ADUserResultantPasswordPolicy $accountObj
<br />                        <span style="color: #0000ff;">if </span>($accountFGPP -ne $null) {
<br />                            $maxPasswordAgeTimeSpan = $accountFGPP.MaxPasswordAge
<br />                        } <span style="color: #0000ff;">else</span> {
<br />                            $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge
<br />                        }
<br />                    } <span style="color: #0000ff;">else </span>{
<br />                        $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge
<br />                    }
<br />                    <span style="color: #0000ff;">if </span>($maxPasswordAgeTimeSpan -eq $null -or $maxPasswordAgeTimeSpan.TotalMilliseconds -eq 0) {
<br />                        echo ("MaxPasswordAge is not set for the domain or is set to zero!")
<br />                    } <span style="color: #0000ff;">else</span> {
<br />                        echo ("Password of account: " + $accountObj.Name + " expires on: " + ($passwordSetDate + $maxPasswordAgeTimeSpan))
<br />                    }
<br />                }
<br />            }
<br />        }
<br />    }
<br />}</code></pre>
<p>Here are some sample usages of this function:</p>
<pre class="csharpcode">PS AD:\&gt; Get-XADUserPasswordExpirationDate testuser1
Password of account: testuser1 already expired!

PS AD:\&gt; Get-XADUserPasswordExpirationDate JohnDoe
Password of account: John Doe expires on: 02/25/2010 13:03:20</pre>
<p>

</p>
<p>Since the MSDN article explains the algorithm using a flow diagram, I too have tried creating a flow diagram that explains the logic used to compute the password expiration date of an account:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/FindoutwhenyourPasswordExpires_D5D8/clip_image002_2.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/FindoutwhenyourPasswordExpires_D5D8/clip_image002_2.png"><img height="860" width="450" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/FindoutwhenyourPasswordExpires_D5D8/clip_image002_thumb.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/FindoutwhenyourPasswordExpires_D5D8/clip_image002_thumb.png" alt="clip_image002" border="0" title="clip_image002" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /></a></p>
<p>&nbsp;</p>
<p>Hope you find this useful. Please leave a comment if you have any feedback on this topic or would like to see any other topic discussed in our blog.</p>
<p>&nbsp;</p>
<p>Enjoy,</p>
<p>Swami</p>]]></content:encoded>
    </item>
    <item>
      <title>Adding/removing members from another forest or domain to groups in Active Directory</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/addingremoving-members-from-another-forest-or-domain-to-groups-in-active-directory</link>
      <pubDate>Wed, 20 Jan 2010 11:54:36 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2010/01/20/addingremoving-members-from-another-forest-or-domain-to-groups-in-active-directory/</guid>
      <description><![CDATA[Adding/removing members belonging to the same domain from a group is very simple using AD Powershell...]]></description>
      <content:encoded><![CDATA[<p>Adding/removing members belonging to the same domain from a group is very simple using AD Powershell cmdlets. All you have to do is pass an identifier (either samAccountName, distinguishedName, securityIdentifier or GUID) of the member and group to one of the membership cmdlets:</p>  <p>· Add-ADGroupMember</p>  <p>· Remove-ADGroupMember</p>  <p>· Add-ADPrincipalGroupMembership</p>  <p>· Remove-ADPrincipalGroupMembership</p>  <p>Example:</p>  <pre class="csharpcode">C:\PS&gt; Add-ADGroupMember SvcAccPSOGroup -Member SQL01, SQL02   <span class="rem">## Adds the user accounts with SamAccountNames SQL01,SQL02 to the group SvcAccPSOGroup.</span>

C:\PS&gt; Remove-ADPrincipalGroupMembership -Identity <span class="str">&quot;Wilson Pais&quot;</span> -MemberOf <span class="str">&quot;Administrators&quot;</span> <span class="rem">## Remove the user 'Wilson Pais' from the administrators group.</span></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>

<p>However, when it comes to adding and removing cross-forest or cross-domain members from a group, things become a little difficult. Here is an example of the error message that you would see while trying to do cross-forest/domain operations the regular way:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_2.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb.png" width="772" height="247" /></a> </p>

<p>The issue here is that Add-ADGroupMember cmdlet tries to resolve the identity supplied in its -MemberOf parameter first and then update the group membership. Since the identity supplied in –MemberOf parameter is from ForestBBB the cmdlet fails while trying to resolve the identity against ForestAAA and throws an identity not found exception (ADIdentityNotFoundException). </p>

<p>The correct way to update cross-forest/domain membership is to first fetch the cross-forest/domain object using any of the ADPowershell cmdlets and then supply the fetched object as input to –Members or –MemberOf parameter of the cmdlets. </p>

<p>Example:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_4.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb_1.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb_1.png" width="725" height="91" /></a> </p>

<p>If you want to use Add-ADPrincipalGroupMembership cmdlet then first fetch the group object and save it in a variable and then execute Add-ADPrincipalGroupMembership cmdlet targeting ForestBBB.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_6.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb_2.png" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/Addingremovingmembersfromanotherforestor_A779/image_thumb_2.png" width="725" height="190" /></a> </p>

<p>Here are the commands that are executed in the screenshots above.</p>

<pre class="csharpcode">PS ForestAAA:\&gt; $forestBBBUser = Get-ADUser swami -Server $forestBBB
PS ForestAAA:\&gt; Add-ADGroupMember Administrators -Members $forestBBBUser
PS ForestAAA:\&gt;
PS ForestAAA:\&gt; $forestAAAGroup = Get-ADGroup Administrators
PS ForestAAA:\&gt; Add-ADPrincipalGroupMembership -Server $forestBBB swami -MemberOf $forestAAAGroup
PS ForestAAA:\&gt; Remove-ADPrincipalGroupMembership -Server $forestBBB swami -MemberOf $forestAAAGroup

Remove members from group
Do you want to remove all the specified member(s) from the specified group(s)?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (<span class="kwrd">default</span> is <span class="str">&quot;Y&quot;</span>): y
PS ForestAAA:\&gt;
PS ForestAAA:\&gt;</pre>

<p>The reason why the above commands work is that ADPowershell cmdlets stores session information in the objects returned. </p>

<p><i>&#160;&#160;&#160;&#160;&#160; The variable $forestBBBUser in the above example contains “server = $forestBBB” in its session information, which is stored internally and is not visible/accessible via command line.</i></p>

<p>This session information is used by Add-ADGroupMember (and other membership cmdlets) to resolve the identity and add it to the group in $forestAAA. </p>

<p><b>NOTE:</b> In the above examples I have connected to the forest where the group resides.</p>

<p>Hope this post helps you in managing your group membership via ADPowershell.</p>

<p>&#160;</p>

<p>Cheers,</p>

<p>Swami</p>

<p>--</p>

<p>Swaminathan Pattabiraman</p>

<p>Developer – Active Directory Powershell Team</p>
<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>]]></content:encoded>
    </item>
    <item>
      <title>Redirecting Well Known Containers (CN=Users; CN=Computers etc.)</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/redirecting-well-known-containers-cnusers-cncomputers-etc</link>
      <pubDate>Wed, 25 Nov 2009 14:03:00 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/11/25/redirecting-well-known-containers-cnusers-cncomputers-etc/</guid>
      <description><![CDATA[In this post we will see the Powershell way of redirecting Users and Computers containers (i.e....]]></description>
      <content:encoded><![CDATA[<P>In this post we will see the Powershell way of redirecting Users and Computers containers (i.e. Powershell equivalent of tools: <B>redirusr.exe</B> and <B>redircmp.exe</B>).</P>
<P>By now you might know that you can use <A href="https://technet.microsoft.com/en-us/library/dd378786(WS.10).aspx" mce_href="https://technet.microsoft.com/en-us/library/dd378786(WS.10).aspx">Get-ADDomain cmdlet for viewing the well-known containers</A> of a domain, For example:</P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Get-ADDomain | select *Container


ComputersContainer                 : CN=Computers,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
DeletedObjectsContainer            : CN=Deleted Objects,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
DomainControllersContainer         : OU=Domain Controllers,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
ForeignSecurityPrincipalsContainer : CN=ForeignSecurityPrincipals,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
LostAndFoundContainer              : CN=LostAndFound,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
QuotasContainer                    : CN=NTDS Quotas,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
SystemsContainer                   : CN=System,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
UsersContainer                     : OU=SwamTempOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com</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>

<P>However, Get-ADDomain cmdlet does not show you all the well-known containers. For example some lesser known containers such as: Program Data Container, Managed Service Account Container (which is technically an Other-Well-Known container) etc. are missing. Also, one cannot change/redirect a well-known container to some other OU using Set-ADDomain cmdlets.</P>
<P>These limitations can be easily overcome using <B>Get-ADObject</B> and <B>Set-ADObject</B> cmdlets. This blog discusses how to do these tasks using ADObject cmdlets and also provides easy-to-use functions for them.</P>
<P>Fetching well-known containers is really simple. All you have to do is read the <B>wellKnownObjects</B> and <B>otherWellKnownObjects</B> properties of the domain’s default naming context.</P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Get-ADObject (Get-ADRootDSE).DefaultNamingContext -Properties otherWellKnownObjects, wellKnownObjects | fl OtherWellKnownObjects, wellKnownObjects


OtherWellKnownObjects : {B:32:1EB93889E40C45DF9F0C64D23BBB6237:OU=TestMSAOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com}
wellKnownObjects      : {B:32:A9D1CA15768811D1ADED00C04FD8D5CD:OU=SwamTempOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com, B:32:6227F0AF1FC2410D8E3BB10615BB5B0F:CN=NTDS Quotas,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com, B:32:F4BE92A4C777485E878E9421D53087DB:CN=Microsoft,CN=Program Data,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com, B:32:09460C08AE1E4A4EA0F64AEE7DAA1E5A:CN=Program Data, DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com...}</PRE>
<P>These properties contain <A href="https://msdn.microsoft.com/en-us/library/ms680918(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms680918(VS.85).aspx">a list of well-known object containers by GUID and distinguished name</A>. Of course you must know the GUID of the container that you are looking for, to find its value.</P>
<P>Also, changing/redirecting a well-known container can be done using <B>Set-ADObject</B> cmdlet by removing the old value from wellKnownObjects/otherWellKnownObjects attribute on the default naming context (i.e. DC=domainname,DC=com) and adding a new value. For example in order to redirect the Users container, one would run the following command:</P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Set-ADObject (Get-ADRootDSE).DefaultNamingContext -Remove @{wellKnownObjects = <SPAN class=str>"B:32:A9D1CA15768811D1ADED00C04FD8D5CD:CN=Users,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com"</SPAN> } -Add @{wellKnownObjects = <SPAN class=str>"B:32:A9D1CA15768811D1ADED00C04FD8D5CD:OU=SwamTempOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com"</SPAN> } -server (Get-ADDomain).PDCEmulator</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>

<P><STRONG>NOTE: </STRONG>The operation must be performed on the Primary domain controller (PDC).</P>
<P>Though it is feasible to use Get-ADObject and Set-ADObject cmdlets to read and manipulate well known containers, it is cumbersome. I have written few functions that would Get and Set the values of these containers. </P>
<P>In order to express the container name in a user-friendly way (rather than a cryptic GUID) I have created a new Enum called: <B>WellKnownGuid</B>. (I used a modified version of Add-Enum script described <A href="https://blogs.msdn.com/powershell/archive/2008/06/03/v2-custom-enums.aspx" mce_href="https://blogs.msdn.com/powershell/archive/2008/06/03/v2-custom-enums.aspx">here</A> in order to create the Enum)</P>
<P>There are two functions <B>Get-XADWellKnownContainer</B> and <B>Set-XADWellKnownContainer</B> that would get and set the value of a well-known container identified by its WellKnownGuid.</P>
<P>Example: </P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Get-XADWellKnownContainer UsersContainer
OU=SwamTempOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com


PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Get-XADWellKnownContainer ComputersContainer
CN=Computers,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com</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>

<P>For getting the values of all the Well-known containers of a domain type this:</P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; [Enum]::GetNames([WellKnownGuid]) | %{ $_.PadRight(30) + <SPAN class=str>" : "</SPAN>+(Get-XADWellKnownContainer $_)}
UsersContainer                 : OU=SwamTempOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
ComputersContainer             : CN=Computers,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
SystemsContainer               : CN=System,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
DCContainer                    : OU=Domain Controllers,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
InfrastructureContainer        : CN=Infrastructure,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
DeletedObjectsContainer        : CN=Deleted Objects,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
LostAndFoundContainer          : CN=LostAndFound,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
ForeignSecurityPrincipalContainer : CN=ForeignSecurityPrincipals,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
ProgramDataContainer           : CN=Program Data,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
MicrosoftProgramDataContainer  : CN=Microsoft,CN=Program Data,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
NtdsQuotasContainer            : CN=NTDS Quotas,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com
ManagedServiceAccountContainer : OU=LeakTestOU,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com</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>

<P>For changing/redirecting a well-known container simply pass the container name and new DN to Set-XADWellKnownContainer function.</P>
<P>Example:</P><PRE class=csharpcode>PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Set-XADWellKnownContainer  UsersContainer CN=Users,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com"


PS C:\Users\Administrator.DSWAMIPAT-W7-V1&gt; Get-XADWellKnownContainer  UsersContainer
CN=Users,DC=dswamipat-w7-vm1,DC=nttest,DC=microsoft,DC=com</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>

<P>The script that contains these functions can be found attached to this blog.</P>
<P>For more information on well-known containers, read this: <A href="https://msdn.microsoft.com/en-us/library/ms675565(VS.85).aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms675565(VS.85).aspx">Binding to Well-Known Objects using WKGUID</A>. </P>
<P>Cheers,</P>
<P>Swami</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/92/88/27/RedirectingWellKnownGuidContainer.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-92-88-27/RedirectingWellKnownGuidContainer.ps1">RedirectingWellKnownGuidContainer.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Accessing Replication Metadata using ADPowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/accessing-replication-metadata-using-adpowershell</link>
      <pubDate>Sun, 01 Nov 2009 01:50:00 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/11/01/accessing-replication-metadata-using-adpowershell/</guid>
      <description><![CDATA[Metadata associated with Active Directory Replication is exposed in AD via many constructed...]]></description>
      <content:encoded><![CDATA[<P>Metadata associated with Active Directory Replication is exposed in AD via many constructed attributes. Some of these metadata attributes come in pairs of binary blob &amp; xml representation of the metadata element.</P>
<P>
<TABLE style="WIDTH: 425.35pt; BORDER-COLLAPSE: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 0in 0in 0in" class=MsoNormalTable border=0 cellSpacing=0 cellPadding=0 width=567 class="MsoNormalTable">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4bacc6; BORDER-TOP: #78c0d4 1pt solid; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><SPAN style="COLOR: white"><FONT size=3><FONT face=Calibri>Constructed Replication XML Metadata Attribute<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4bacc6; BORDER-TOP: #78c0d4 1pt solid; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><SPAN style="COLOR: white"><FONT size=3><FONT face=Calibri>Available on Objects<o:p></o:p></FONT></FONT></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4bacc6; BORDER-TOP: #78c0d4 1pt solid; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><SPAN style="COLOR: white"><FONT size=3><FONT face=Calibri>Corresponding Binary Attribute<o:p></o:p></FONT></FONT></SPAN></B></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-ReplQueueStatistics<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Root DSE<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>-<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-ReplAllInboundNeighbors<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Root DSE<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>-<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 3">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-ReplAllOutboundNeighbors<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Root DSE<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>-<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 4">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-NCReplCursors<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>NC Head<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>replUpToDateVector<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 5">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-NCReplInboundNeighbors<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>NC Head<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>repsFrom<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 6">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-NCReplOutboundNeighbors<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>NC Head<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>repsTo<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 7">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-ReplAttributeMetaData<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>All Objects<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #d2eaf1; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>replPropertyMetaData<o:p></o:p></FONT></FONT></P></TD></TR>
<TR style="mso-yfti-irow: 8; mso-yfti-lastrow: yes">
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #78c0d4 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 188.6pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=251>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><B><FONT size=3><FONT face=Calibri>msDS-ReplValueMetaData<o:p></o:p></FONT></FONT></B></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 106.25pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0; PADDING-TOP: 0in" vAlign=top width=142>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>All Objects<o:p></o:p></FONT></FONT></P></TD>
<TD style="BORDER-BOTTOM: #78c0d4 1pt solid; BORDER-LEFT: #f0f0f0; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 130.5pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #78c0d4 1pt solid; PADDING-TOP: 0in" vAlign=top width=174>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>-<o:p></o:p></FONT></FONT></P></TD></TR></TBODY></TABLE></P>
<P>For the <A href="https://blogs.msdn.com/adpowershell/archive/2009/06/01/inspecting-deleted-objects-before-restore.aspx" mce_href="https://blogs.msdn.com/adpowershell/archive/2009/06/01/inspecting-deleted-objects-before-restore.aspx">Inspecting Deleted Objects before Restore</A> blog post script, I had parsed the msDS-ReplAttributeMetaData attribute of the deleted objects to determine the actual deleted time of the objects. I had found the parsing so simple to do using ADPowerShell, that I decided to write about it in this separate post. </P>
<P>This post is focused on the msDS-ReplAttributeMetaData attribute … but the technique shown here can be used to parse all of the above listed XML format attributes …</P>
<P>Let’s start by a simple Get-ADObject call and requesting the msDS-ReplAttributeMetaData attribute.</P>
<P><FONT face=Consolas>Get-ADObject "DC=DUGILL,DC=DEMO" -Properties "msDS-ReplAttributeMetaData"</FONT></P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Simple Get-ADObject with msDS-ReplAttributeMetaData" border=0 alt="Simple Get-ADObject with msDS-ReplAttributeMetaData" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_thumb.jpg" width=841 height=826 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Simple%20Get-ADObject%20with%20msDS-ReplAttributeMetaData_thumb.jpg"></A> </P>
<P>Let’s store the xml string value in a local variable so that we can play with it without cluttering the commandline. Now, the attribute name has a hyphen (‘-’) in it so we will need to help the powershell parser and put quotes around the attribute name. </P>
<P><FONT face=Consolas>$xmlAttribute = (Get-ADObject "DC=DUGILL,DC=DEMO" -Properties "msDS-ReplAttributeMetaData")."msDS-ReplAttributeMetaData"</FONT></P>
<P>Above we see that the xml text from the attribute is not a valid xml string, as it does not have a root tag. So let’s add a root tag to it.</P>
<P><FONT face=Consolas>$xmlAttribute = “&lt;root&gt;” + $xmlAttribute + “&lt;/root&gt;”</FONT></P>
<P>Now that we’ve made our msDS-ReplAttributeMetaData attribute value a valid xml string, comes the turn of some PowerShell magic. PowerShell makes it really simple to convert XML string to an XML Document Object (a form which can be worked on programmatically in a simpler way …)</P>
<P>SO, let’s go ahead and cast the string into an XML Document object.</P>
<P><FONT face=Consolas>$xmlAttributeDocObject = [xml] $xmlAttribute # wow … it’s that simple</FONT></P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Null Charecter Error" border=0 alt="Null Charecter Error" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_thumb.jpg" width=841 height=211 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Null%20Charecter%20Error_thumb.jpg"></A> </P>
<P>Ok not that simple … we hit a pretty nasty looking parsing error. The error is because the XML string contains some ASCII null characters (a bug in AD). So how do we get rid of these null charecters?</P>
<P>The hint is in the error which says the char has a hex value of 0x00 which is basically decimal 0. Can I use String.Replace function to get rid of these characters? As it turns out – I can …</P>
<P>String.Replace takes two arguments: first, the char or string to replace and second, the char or string to replace with. Note I’m using PowerShell casting again, to convert the hex value 0x00 to a char value. Replacing all occurrences of ascii nulls in the string with a space char (“ ”) …</P>
<P><FONT face=Consolas>$xmlAttribute = $xmlAttribute.Replace([char]0,” ”)</FONT></P>
<P>Now let’s try converting it into the XML Doc Object again … this time it works!!</P>
<P><FONT face=Consolas>$xmlAttributeDocObject = [XML]$xmlAttribute</FONT></P>
<P>Let’s inspect the xml doc object and admire the wonderful XML experience provided by PowerShell :)</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Inspecting XML Doc Object" border=0 alt="Inspecting XML Doc Object" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_thumb.jpg" width=841 height=222 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object_thumb.jpg"></A> </P>
<P>And finally <FONT face=Consolas>$xmlAttributeDocObject.root.DS_REPL_ATTR_META_DATA | ft</FONT> #… viola!</P>
<P>BTW, this output had got me wondering if I had just typed repadmin /showmeta …</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Inspecting XML Doc Object - Repadmin Like Output" border=0 alt="Inspecting XML Doc Object - Repadmin Like Output" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_thumb.jpg" width=841 height=594 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Repadmin%20Like%20Output_thumb.jpg"></A> </P>
<P>Focusing on selected interesting XML elements …</P>
<P><FONT face=Consolas>$xmlAttributeDocObject.root.DS_REPL_ATTR_META_DATA | ft pszAttributeName,ftimeLastOriginatingChange,pszLastOriginatingDsaDN</FONT></P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Inspecting XML Doc Object - FT Selected Attributes" border=0 alt="Inspecting XML Doc Object - FT Selected Attributes" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_thumb.jpg" width=841 height=580 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20FT%20Selected%20Attributes_thumb.jpg"></A> </P>
<P>We see that the originating change time is in the Zulu time format and the originating dc’ NTDS Settings object DN is what is available … with some format transforms we can get to a better looking output </P>
<P><FONT face=Consolas>$ObjectMetadataTableFormatter = @()</FONT></P>
<P><FONT face=Consolas>$ObjectMetadataTableFormatter += @{Label="Attribute LDAP Name"; Expression={$_.pszAttributeName}}</FONT></P>
<P><FONT face=Consolas>$ObjectMetadataTableFormatter += @{Label="Originating DC"; Expression={(Get-ADObject $_.pszLastOriginatingDsaDN.Substring(17,$_.pszLastOriginatingDsaDN.length-17) -properties dnshostname).DNSHostName}}</FONT></P>
<P><FONT face=Consolas>$ObjectMetadataTableFormatter += @{Label="Originating Change Time"; Expression={[datetime]::parse($_.ftimeLastOriginatingChange)}}</FONT></P>
<P><FONT face=Consolas>$xmlAttributeDocObject.root.DS_REPL_ATTR_META_DATA | ft $ObjectMetadataTableFormatter</FONT></P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_4.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_4.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_4.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Inspecting XML Doc Object - Using Table Formatter " border=0 alt="Inspecting XML Doc Object - Using Table Formatter " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_thumb_1.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_thumb_1.jpg" width=841 height=569 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Inspecting%20XML%20Doc%20Object%20-%20Using%20Table%20Formatter%20_thumb_1.jpg"></A> </P>
<P>You may also use the attached script function (or add it into your function profile script). The function allows pipelining objects from other Get-AD cmdlets to fetch the object replication metadata …</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="Using the function" border=0 alt="Using the function" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_thumb.jpg" width=841 height=553 mce_src="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/AccessingReplicationMetadatausingADPower_18F9/Using%20the%20function_thumb.jpg"></A> </P>
<P>enjoy!</P>
<P>Dushyant Gill</P>
<P>Program Manager - Microsoft</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/91/58/14/ReplicationMetadata.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-91-58-14/ReplicationMetadata.ps1">ReplicationMetadata.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>View/Configure Protected ACL and Fixing Broken Inheritance</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/viewconfigure-protected-acl-and-fixing-broken-inheritance</link>
      <pubDate>Thu, 22 Oct 2009 12:33:19 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/10/22/viewconfigure-protected-acl-and-fixing-broken-inheritance/</guid>
      <description><![CDATA[ACL inheritance is one of key concept in Active Directory delegation of control. It allows ACEs set...]]></description>
      <content:encoded><![CDATA[<p>ACL inheritance is one of key concept in Active Directory delegation of control. It allows ACEs set on a parent container gets inherited by its child objects. It simplifies access management significantly as it allows the management to be done on the container level rather than on individual leaf objects. However, sometimes we may want to block such inheritance on some special objects. With a protected ACL set on the object, any inheritable ACEs set on its parent will not be able to propagate down to the object and as a result only the ACEs explicitly set on it take effect. The following examples show how to find out a protected ACL and set/unset such an ACL:</p>  <pre class="csharpcode"><span class="rem">## Get the object’s DACL</span>

PS AD:\&gt; $acl = get-acl <span class="str">&quot;OU=myou,DC=fabrikam,DC=com”

## Finding out if an ACL is protected is very simple.

PS AD:\&gt; $acl.AreAccessRulesProtected

## When setting ACL to be protected with SetAccessRuleProtection with the first parameter set to $true, we also 

## have two options for the ACEs already inherited, we may choose either to remove them or convert them to 

## explicit ACEs. In the example below, we choose to convert the inherited ACEs by setting the second parameter 

## to $true.  

PS AD:\&gt; $acl.SetAccessRuleProtection($true, $true);

## Make sure set the ACL on the object after the change has been made to the ACL.

PS AD:\&gt; set-acl -aclobject $acl &quot;</span>OU=myou,DC=fabrikam,DC=com”

<span class="rem">## Once the ACL is protected the inheritance chain is broken</span>

<span class="rem">## To unprotect the ACL (i.e. to fix the broken inheritance), set the first parameter to $false. The second parameter is ignored in the case.</span>

PS AD:\&gt; $acl.SetAccessRuleProtection($false, $false);

<span class="rem">## Always make sure set the ACL on the object after any change has been made to the ACL</span>

PS AD:\&gt; set-acl -aclobject $acl &quot;OU=myou,DC=fabrikam,DC=com”</pre>

<p><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>

<p>Thanks,</p>

<p>David</p>]]></content:encoded>
    </item>
    <item>
      <title>Add Object Specific ACEs using Active Directory Powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/add-object-specific-aces-using-active-directory-powershell</link>
      <pubDate>Tue, 13 Oct 2009 15:37:12 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/10/13/add-object-specific-aces-using-active-directory-powershell/</guid>
      <description><![CDATA[Active Directory Powershell implements two Powershell Provider cmdlets specifically for access...]]></description>
      <content:encoded><![CDATA[<p>Active Directory Powershell implements two Powershell Provider cmdlets specifically for access control management in Active Directory: Get-ACL and Set-ACL. This blog series is to give a few examples on how to use them. Note that it is not intended for a detailed explanation of access control and delegation in Active Directory and with an assumption that the readers have had basic knowledge. Additional information on Active Directory access control and delegation can be found in the <a href="https://www.microsoft.com/downloads/details.aspx?familyid=631747a3-79e1-48fa-9730-dae7c0a1d6d3&amp;displaylang=en">Best Practices for Delegating ActiveDirectory Administration</a> and related topics in MSDN.</p>  <p>One of the unique aspects in access control management in Active Directory is the introduction of <a href="https://msdn.microsoft.com/en-us/library/aa379293(VS.85).aspx">object specific ACEs</a> which allow an administrator to delegate Active Directory specific rights (i.e. extended rights) or read/write access to a property set (i.e. a named collection of attributes) by setting ObjectType field in an object specific ACE to the rightsGuid of the extended right or property set. The delegation can also be created to target child objects of a specific class by setting the InheritedObjectType field to the schemaIDGuid of the class. For more information on how to retrieve the rightsGuid or schemaIDGuid using Active Directory Powershell, please refer to Swami’s blog <a href="https://blogs.msdn.com/adpowershell/archive/2009/09/22/how-to-find-extended-rights-that-apply-to-a-schema-class-object.aspx">How to find extended rights that apply to a schema class</a>. In the example below, we are going to create two object specific ACEs with one granting the group “myGroup” the extended right “Reset Password” for all users and the other giving it permission to delete computer objects, all under the organizationUnit “myOU”.</p>  <pre class="csharpcode"><span class="rem">## Load Active Directory Powershell Module</span>

PS C:\&gt; cd ad:

PS AD:\&gt; 

<span class="rem">## Create myOU</span>

PS AD:\&gt; $ou = new-adorganizationalunit -name myOU -passthru

<span class="rem">## Create myGroup and obtain its SID </span>

PS AD:\&gt; $group = new-adgroup myGroup -groupscope <span class="kwrd">global</span> -passthru

PS AD:\&gt; $sid = new-object System.Security.Principal.SecurityIdentifier $group.SID

<span class="rem">## Get the DACL of myOU</span>

PS AD:\&gt; $acl = get-acl $ou

<span class="rem">## The following object specific ACE is to grant myGroup permission to create computer objects under myOU.</span>

<span class="rem">## Note that bf967a86-0de6-11d0-a285-00aa003049e2 is the schemaIDGuid for the computer class.</span>

PS AD:\&gt; $objectguid = new-object Guid bf967a86-0de6-11d0-a285-00aa003049e2                          

PS AD:\&gt; $ace1 = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid,<span class="str">&quot;CreateChild&quot;</span>,<span class="str">&quot;Allow&quot;</span>,$objectguid

<span class="rem">## The following object specific ACE is to grant myGroup permission to change user password on all user objects </span>

<span class="rem">## under myOU. 00299570-246d-11d0-a768-00aa006e0529 is the rightsGuid for the extended right </span>

<span class="rem">## User-Force-Change-Password (“Reset Password”). bf967aba-0de6-11d0-a285-00aa003049e2 is the schemaIDGuid </span>

<span class="rem">## for the user class. </span>

PS AD:\&gt; $objectguid = new-object Guid  00299570-246d-11d0-a768-00aa006e0529

PS AD:\&gt; $inheritedobjectguid = new-object Guid  bf967aba-0de6-11d0-a285-00aa003049e2

$ace2 = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid,<span class="str">&quot;ExtendedRight&quot;</span>,$objectGuid,<span class="str">&quot;Descendents&quot;</span>,$inheritedobjectguid

<span class="rem">## Add the ACE in the ACL and set the ACL on the object </span>

PS AD:\&gt; $acl.AddAccessRule($ace1)

PS AD:\&gt; $acl.AddAccessRule($ace2)

PS AD:\&gt; set-acl -aclobject $acl $ou</pre>

<p><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>

<p>Thanks,</p>

<p>David</p>]]></content:encoded>
    </item>
    <item>
      <title>How to view SOAP XML messages to and from AD Webservices and Powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/how-to-view-soap-xml-messages-to-and-from-ad-webservices-and-powershell</link>
      <pubDate>Mon, 05 Oct 2009 18:12:48 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/10/05/how-to-view-soap-xml-messages-to-and-from-ad-webservices-and-powershell/</guid>
      <description><![CDATA[I am sure many of us are curious to see the XML messages communicated between the AD Powershell...]]></description>
      <content:encoded><![CDATA[<p>I am sure many of us are curious to see the XML messages communicated between the AD Powershell webservices client and a Windows server hosting AD Webservices whenever a powershell cmdlet gets executed. In this blog, I am providing information to view those messages by enabling Windows Communication Foundation (WCF) logging through ADWS configuration. For more in general on WCF configuring message logging, please see: <a href="https://msdn.microsoft.com/en-us/library/ms730064.aspx">https://msdn.microsoft.com/en-us/library/ms730064.aspx</a></p>  <p>1) Stop Active Directory Web services by typing “net stop adws” on a command prompt.</p>  <p>2) Save a copy of the original %systemroot%\windows\adws\Microsoft.ActiveDirectory.WebServices.exe.config file. </p>  <p>3) Now open the file %systemroot%\windows\adws\Microsoft.ActiveDirectory.WebServices.exe.config for editing.</p>  <p>4) Copy and paste the following lines after &lt;/appSettings&gt; tag in the file above:</p>  <p>&#160;</p>  <pre class="csharpcode">   <span class="kwrd">&lt;</span><span class="html">system.diagnostics</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">sources</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">source</span> <span class="attr">name</span><span class="kwrd">=&quot;System.ServiceModel.MessageLogging&quot;</span><span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span><span class="html">listeners</span><span class="kwrd">&gt;</span>
                   <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">=&quot;messages&quot;</span>
                   <span class="attr">type</span><span class="kwrd">=&quot;System.Diagnostics.XmlWriterTraceListener&quot;</span>
                   <span class="attr">initializeData</span><span class="kwrd">=&quot;c:\messages.svclog&quot;</span> <span class="kwrd">/&gt;</span>   <span class="rem">&lt;!-- Provide your desired path for log file here --&gt;</span>   
          <span class="kwrd">&lt;/</span><span class="html">listeners</span><span class="kwrd">&gt;</span>
       <span class="kwrd">&lt;/</span><span class="html">source</span><span class="kwrd">&gt;</span>
     <span class="kwrd">&lt;/</span><span class="html">sources</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">system.diagnostics</span><span class="kwrd">&gt;</span> </pre>

<p><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>

<p>And the following lines just under &lt;system.serviceModel&gt; tag:</p>

<p>&#160;</p>

<pre class="csharpcode">   <span class="kwrd">&lt;</span><span class="html">diagnostics</span><span class="kwrd">&gt;</span>
     <span class="kwrd">&lt;</span><span class="html">messageLogging</span> 
          <span class="attr">logEntireMessage</span><span class="kwrd">=&quot;true&quot;</span> 
          <span class="attr">logMalformedMessages</span><span class="kwrd">=&quot;true&quot;</span>
          <span class="attr">logMessagesAtServiceLevel</span><span class="kwrd">=&quot;true&quot;</span> 
          <span class="attr">logMessagesAtTransportLevel</span><span class="kwrd">=&quot;true&quot;</span><span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">diagnostics</span><span class="kwrd">&gt;</span></pre>

<p><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>

<p>5)&#160; Save and close the config file.</p>

<p>6)&#160; Start the service using “net start adws” and make sure configuration file got loaded successfully by checking the ADWS event log ID 1100&#160; “The configuration file for Active Directory Web Services has been loaded without errors.”</p>

<p>7) Open Active Directory Module for Windows Powershell and run any AD cmdlet.</p>

<p>8) Note that a file called c:\message.svclog got created which contains all the XML messages!</p>

<p>Message.svclog contains a sequence of XML fragments and is not a valid XML file. It is recommended that you use the <a href="https://msdn.microsoft.com/en-us/library/ms732023.aspx">Service Trace Viewer Tool (SvcTraceViewer.exe)</a> to view the message log files in a more formatted manner. For more information on how to use this tool, see <a href="https://msdn.microsoft.com/en-us/library/aa751795.aspx">Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting</a>. </p>

<p>For e.g. below is a Get-Transfer root dse request from AD powershell to ADWS:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002_2.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002_thumb.jpg" width="761" height="376" /></a></p>

<p>And the Get-transfer response to the above request from ADWS:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002%5B4%5D.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002%5B4%5D.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002%5B4%5D_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/HowtoviewSOAPXMLmessagestoandfromADWebse_D5E9/clip_image002%5B4%5D_thumb.jpg" width="763" height="547" /></a></p>

<p>This mechanism of logging messages comes very handy while debugging errors and exceptions. It is also useful to see the exact message sent to/from the ADWS in raw form, for ex: by looking at the request XML sent by Get-ADObject one can find out how Advanced Filters are converted to ldap filters. By setting appropriate message logging options it is possible to view malformed messages and faults. One can also view XML messages communication between Active Directory Administrative Center and ADWS through such logging.&#160; </p>

<p>Enjoy!</p>

<p>Swasti Mishra</p>

<p>Developer – Active Directory Web Services team</p>]]></content:encoded>
    </item>
    <item>
      <title>How to find extended rights that apply to a schema class object</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/how-to-find-extended-rights-that-apply-to-a-schema-class-object</link>
      <pubDate>Tue, 22 Sep 2009 18:44:31 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/09/22/how-to-find-extended-rights-that-apply-to-a-schema-class-object/</guid>
      <description><![CDATA[Recently, I came across this question (how to find extended rights that apply to a schema class) in...]]></description>
      <content:encoded><![CDATA[<p>Recently, I came across this question (how to find extended rights that apply to a schema class) in our internal mailing lists. Extended rights are special permissions that denote a special task or function. These rights apply to one or more object classes and can be found stamped in the security descriptor of an object. </p>  <p>There are KB articles that describe how to find extended rights that apply to a given objectClass using VBScript or C++. </p>  <p><a href="https://support.microsoft.com/kb/302514">https://support.microsoft.com/kb/302514</a></p>  <p>I was curious to find out how easy or difficult it is to do this in AD Powershell. It turned out to be pretty straightforward, just a few lines of code. Compare this with the ~81 lines of VB Script code in the above KB article. </p>  <p>Here is the script in AD Powershell: </p>  <pre class="csharpcode">$inputObjectClass = <span class="str">&quot;group&quot;</span>

$rootDSE = Get-ADRootDSE
$configNCDN = $rootDSE.ConfigurationNamingContext
$schemaNCDN = $rootDSE.SchemaNamingContext
$extendedRightsDN = <span class="str">&quot;CN=Extended-Rights,&quot;</span> + $configNCDN
$classObject = get-adobject -SearchBase $schemaNCDN -Filter { name <span class="preproc">-eq</span> $inputObjectClass -and objectClass <span class="preproc">-eq</span> <span class="str">&quot;classSchema&quot;</span>} -Properties SchemaIDGUID
<span class="kwrd">if</span> ($classObject <span class="preproc">-ne</span> $null) {

    $schemaIDGuid = [System.Guid] $classObject.SchemaIDGUID
    Get-ADObject -SearchBase $extendedRightsDN -Filter { appliesTo <span class="preproc">-eq</span> $schemaIDGuid  } -Properties RightsGuid,cn,displayname | Select RightsGuid,cn,displayname

} <span class="kwrd">else</span> {

    Write-Error (<span class="str">&quot;Specified class object not found! : &quot;</span> + $inputObjectClass)

}</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>

<p>Although SchemaIDGuid is stored as a Octet String (i.e. Byte[]), look how easy it is to convert that into a System.Guid object. Just a simple type-cast in Powershell does that. </p>

<pre class="csharpcode">    $schemaIDGuid = [System.Guid] $classObject.SchemaIDGUID</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>

<p>Cheers,</p>

<p>Swami</p>]]></content:encoded>
    </item>
    <item>
      <title>Active Directory Management Gateway Service released to web - manage YOUR Windows 2003/2008 DCs USING AD POWERSHELL !</title>
      <link>https://docs.microsoft.com/archive/blogs/adpowershell/active-directory-management-gateway-service-released-to-web-manage-your-windows-20032008-dcs-using-ad-powershell</link>
      <pubDate>Thu, 17 Sep 2009 20:15:19 GMT</pubDate>
      <dc:creator><![CDATA[M. Ali]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/adpowershell/2009/09/17/active-directory-management-gateway-service-released-to-web-manage-your-windows-20032008-dcs-using-ad-powershell/</guid>
      <description><![CDATA[RTW version of Active Directory Management Gateway Service (ADMGS), an Active Directory Web Services...]]></description>
      <content:encoded><![CDATA[<p>RTW version of Active Directory Management Gateway Service (ADMGS), an Active Directory Web Services (ADWS <a href="https://blogs.msdn.com/adpowershell/archive/2009/04/06/active-directory-web-services-overview.aspx">overview here</a>) out of band release for down level servers is now available to download from <a href="https://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=008940c6-0296-4597-be3e-1d24c1cf0dda">Microsoft Download Center Page</a>. ADMGS is a down level release of in-box version of Windows Server 2008 R2&#160; ADWS and provides the same functionality. One can download and install ADMGS on servers and domain controllers running the following operating systems:</p>  <ul>   <li>Windows Server® 2003 R2 with Service Pack 2 (SP2) </li>    <li>Windows Server 2003 SP2 </li>    <li>Windows Server 2008 </li>    <li>Windows Server 2008 SP2 </li> </ul>  <p>ADMGS enables administrators to use Windows Server 2008 R2 or Windows 7 client applications such as the Active Directory module for Windows PowerShell and the Active Directory Administrative Center (ADAC) to access or manage their existing Active Directory Domain Services (ADDS) and Active Directory Lightweight Directory Services (AD LDS) instances that are running on Windows Server 2008-based (both writable and read-only) or Windows Server 2003-based servers.</p>  <p>The only difference between the functionality that ADWS provides for domain controllers that are running Windows Server 2008 R2 operating system and the functionality that ADMGS provides to domain controllers that are running Windows Server 2008 and Windows Server 2008 SP2 operating systems is that ADMGS does not support instances of the Active Directory Database Mounting Tool running on Windows Server 2008-based servers.</p>  <p>Downloadable install guide at the same location provides information on ADMGS installation, uninstallation and upgrade scenarios. </p>  <p>Enjoy!</p>  <p>Swasti Mishra</p>  <p>Developer -&#160; Active Directory Web Services team</p>]]></content:encoded>
    </item>
  </channel>
</rss>