<?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>SysAdmin Talk &#187; Active Directory</title>
	<atom:link href="http://sysadmin-talk.org/category/active-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysadmin-talk.org</link>
	<description>Practical advice from front-line SysAdmins</description>
	<lastBuildDate>Tue, 08 May 2012 18:01:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to provision an “All in one” Domain Controller and Remote Desktop Services server</title>
		<link>http://sysadmin-talk.org/2010/09/how-to-provision-an-%e2%80%9call-in-one%e2%80%9d-domain-controller-and-remote-desktop-services-server/</link>
		<comments>http://sysadmin-talk.org/2010/09/how-to-provision-an-%e2%80%9call-in-one%e2%80%9d-domain-controller-and-remote-desktop-services-server/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 15:50:39 +0000</pubDate>
		<dc:creator>Sean Duffy</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Domain Controller]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=627</guid>
		<description><![CDATA[Sometimes having a server that “does it all” is quite handy to have around. It may be for testing or development purposes, or perhaps it would be used as a small “all in one” company server. Microsoft do have a Small Business Edition version of Windows Server 2008 (SBS 2008) that can be used for [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes having a server that “does it all” is quite handy to have around. It may be for testing or development purposes, or perhaps it would be used as a small “all in one” company server. Microsoft do have a Small Business Edition version of Windows Server 2008 (SBS 2008) that can be used for this kind of purpose, but in some cases this solution may be a little overkill. That being said, here is a brief overview of how I configure a single Windows Server 2008 R2 Standard server to provide both a Domain Controller and RDS (formerly Terminal Services) role.<span id="more-627"></span></p>
<h2>Overview</h2>
<p>Start by setting up a clean install of Windows Server 2008 R2. I use the Standard edition for this purpose as I don’t expect its resource requirements to be very high. Once you have your clean install finished and are logged in as the local Administrator, launch the Active Directory installation wizard and configure the server as a Domain Controller.</p>
<p><strong>Start -&gt; Run -&gt; dcpromo -&gt; OK</strong></p>
<p>Go through the Active Directory Installation wizard as briefly detailed below:</p>
<ul>
<li>Give your internal domain a name of your choice. Example: &#8220;yournamechoice.local&#8221;</li>
<li>Choose a Directory Services restore mode password and note it down.</li>
<li>When you arrive at the &#8220;Set Domain Functional Level&#8221; page, select &#8220;Windows Server 2008 R2&#8243; from the dropdown list. Among other things, this will allow the &#8220;Active Directory Recycle Bin&#8221; feature should you wish. If you plan on joining other servers running older versions of Windows to this domain, then choose the correct level to support these older OSes.</li>
<li>When you are asked about creating a DNS delegation to an existing DNS server, choose to continue the install by selecting &#8220;No action is required&#8221;. This will be the first DNS server on the domain as it is in theory, a &#8220;single&#8221; server.</li>
<li>Finish the wizard off and choose to restart the server once complete.</li>
</ul>
<p>Next up, we will install the RDS (Remote Desktop Services) role. This is formerly known as the Terminal Services role in previous versions of Windows Server.</p>
<p><strong>Server Manager -&gt; Roles -&gt; Add Roles -&gt; Remote Desktop Services</strong></p>
<ul>
<li>Select the “Remote Desktop Session Host” feature.</li>
<li>The wizard will warn that this is a Domain Controller and that this role is not recommended. We know that Microsoft don’t recommend this configuration, so as long as you are happy with this, select to “Install Remote Desktop Session Host anyway” when prompted.</li>
<li>Select the “Remote Desktop Licensing” feature.</li>
<li>Choose “Do not require network level authentication” – this option depends on how you want your security set up.</li>
<li>Depending on your license model, choose the appropriate option. I almost always use “Per user license model”.</li>
<li>Choose which Client Experience Features to install. i.e. Audio/Video playback, audio recording redirection and desktop composition.</li>
<li>Leave the RD Licensing Configuration page on the defaults and continue.</li>
<li>Complete the installation of this role, and then restart when prompted.</li>
</ul>
<p>Now we need to activation the RDS Licensing server and install some CALs (Client Access Licenses) so that users can login to this server remotely.</p>
<p><strong>Administrative Tools -&gt; Remote Desktop Services -&gt; Remote Desktop Licensing Manager</strong></p>
<ul>
<li>If you don&#8217;t see this, you probably don&#8217;t have the Licensing role installed. Open Server Manager, Expand Roles, Right-click Remote Desktop Servers, and choose &#8220;Add Role Services&#8221;. Add the &#8220;Remote Desktop Licensing&#8221; role service. Go back and open the Remote Desktop Licensing Manager once this role service has been added.</li>
<li>Right-click the server name, and select &#8220;Activate Server&#8221;.</li>
<li>Complete the activation wizard using &#8220;Automatic connection&#8221; and by entering your details.</li>
<li>Finish the wizard and leave the selection on to &#8220;Start Install Licenses Wizard now&#8221;.</li>
<li>Choose the licensing agreement type that you are using or registered for.</li>
<li>Product version should be: Windows Server 2008 / Windows Server 2008 R2</li>
<li>License type should be: Per User CAL (TS or RDS) (That is if you use the per user licensing model)</li>
<li>Finish the wizard and the RDS User CALs should now be installed and activated.</li>
</ul>
<p>The next step is to specify your license server.</p>
<ul>
<li>Administrative Tools -&gt; Remote Desktop Services -&gt; &#8220;Remote Desktop Session Host Configuration&#8221;</li>
<li>Right-click &#8220;Remote Desktop License Servers (Not specified)&#8221; and select &#8220;Properties&#8221;</li>
<li>Ensure that &#8220;Per User&#8221; is still selected (or the license model you chose), then click the &#8220;Add&#8221; button and select the server name.</li>
<li>Click Add, then OK, then OK again to close the window.</li>
<li>The licensing server should now specified and be able to issue RDS CALs to connecting clients.</li>
</ul>
<p>Next we need to allow users to login locally (This is required for the RDS role on a Domain Controller). We’ll be modifying group policy now, so open up Group Policy Management (<strong>GPMC.msc</strong>)</p>
<ul>
<li>Edit the &#8220;Default Domain Policy&#8221;</li>
<li>Go to: Computer Configuration -&gt; Policies -&gt; Windows Settings -&gt; Security Settings -&gt; Local Policies -&gt; User Rights Assignment</li>
<li>The following two entries will be shown as &#8220;Not Defined&#8221; -&gt; &#8220;Allow logon locally&#8221; &amp; &#8220;Allow logon through Remote Desktop Services&#8221;</li>
<li>Right click and enable these, specifying the following security groups in each:</li>
<li>Account Operators; Administrators; Backup Operators; Print Operators; Server Operators; Remote Desktop Users.</li>
<li>Exit the GP Editor then open a CMD prompt and run &#8220;gpupdate /force&#8221; You may also wish to restart the server at this point to ensure the policies are applied correctly.</li>
</ul>
<h2>Conclusion</h2>
<p>At this point you should now have a server that provides the roles of a Domain Controller and a Remote Desktop Session Host. Active Directory users should be able to use the Remote Desktop Connection client to connect and you will be able to provision software for them to use by installing it via RD-Install mode (found in the Control Panel). The rest of the customization is up to you now, so go wild! If you have any other suggestions or ideas, please leave your comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/09/how-to-provision-an-%e2%80%9call-in-one%e2%80%9d-domain-controller-and-remote-desktop-services-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Transferring FSMO roles in Windows Server 2003</title>
		<link>http://sysadmin-talk.org/2010/06/transferring-fsmo-roles-in-windows-server-2003/</link>
		<comments>http://sysadmin-talk.org/2010/06/transferring-fsmo-roles-in-windows-server-2003/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 18:10:54 +0000</pubDate>
		<dc:creator>Sean Duffy</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[fsmo]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=430</guid>
		<description><![CDATA[When you configure the first Domain Controller for your organization using the Active Directory Installation Wizard (or dcpromo for short), it is configured with all five FSMO roles by default. Here I will cover how you can view and transfer the specific FSMO roles of various Domain Controllers in your domain. As this is a [...]]]></description>
			<content:encoded><![CDATA[<p>When you configure the first Domain Controller for your organization using the Active Directory Installation Wizard (or dcpromo for short), it is configured with all five FSMO roles by default. Here I will cover how you can view and transfer the specific FSMO roles of various Domain Controllers in your domain. As this is a short how-to article, I won&#8217;t go into the specific details of when you would need to transfer roles, but in short you may want to take a certain domain controller down for maintenance one day and may find it necessary to transfer some, or all of these roles.</p>
<p>To start with you will obviously require more than one Domain Controller in your Windows domain. In my case I have a &#8220;Primary&#8221; and &#8220;Secondary&#8221; domain controller called &#8220;NOOBS-DC1&#8243; and &#8220;NOOBS-DC2&#8243;.</p>
<p><span id="more-430"></span></p>
<h3><strong>Transferring roles</strong></h3>
<p><strong><br />
</strong></p>
<p><span style="text-decoration: underline">RID, PDC or Infrastructure roles:</span></p>
<p>Start by opening Active Directory Users and Computers on the DC you want to change the role to. Right-click your domain name and select &#8220;Operation Masters&#8221; from the context menu.</p>
<p><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo1.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-431" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo1-300x153.jpg" alt="" width="300" height="153" /></a></p>
<p>Select the tab corresponding to the role you would like to transfer. Below this you should be able to see the name of the DC you are currently on, or connected to. Click the &#8220;Change&#8221; button to change the role over to the DC listed.</p>
<p><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo2.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-432" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo2-269x300.jpg" alt="" width="269" height="300" /></a></p>
<p>Confirm the change when asked, at which point you should receive a message stating that the procedure was successful.</p>
<p><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo3.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-433" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo3-300x95.jpg" alt="" width="300" height="95" /></a></p>
<p>Remember that this method can be used to transfer any of the RID (Relative ID), PDC (PDC Emulator) or Infrastructure roles. Just select the role you want to transfer by using the relevant tab.</p>
<p class="MsoNormal"><span style="text-decoration: underline">Domain Naming Master role</span></p>
<p><span>Again, start on the DC that you would like to transfer this role to. Open Active Directory Domains and Trusts, then right-click the top level that reads &#8220;Active Directory Domains and Trusts&#8221; then select &#8220;Operations Master&#8221; from the context menu.</span></p>
<p><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo4.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-434" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo4-300x153.jpg" alt="" width="300" height="153" /></a></span></p>
<p><span><span>Check that the DC listed is the machine you would like to change the role to, then click &#8220;Change&#8221;.</span></span></p>
<p><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo5.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-435" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo5-300x210.jpg" alt="" width="300" height="210" /></a></span></span></p>
<p><span><span><span>Confirm the change &#8211; If all went well you should now receive a message stating the transfer was a success.</span></span></span></p>
<p><span><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo6.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-436" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo6-300x109.jpg" alt="" width="300" height="109" /></a></span></span></span></p>
<p><span><span><span><span>Note that you can also use the &#8220;Connect to Domain Controller&#8221; option in the context menu to connect to the DC you would like to transfer the role to. Access this by right-clicking &#8220;Active Directory Domains and Trusts&#8221; and then selecting the &#8220;Connect to Domain Controller&#8221; option. Here is what the Connect to Domain Controller window should look like:</span></span></span></span></p>
<p><span><span><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo7.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-437" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo7-230x300.jpg" alt="" width="230" height="300" /></a></span></span></span></span></p>
<p><span><span><span><span> </span></span></span></span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="text-decoration: underline">Schema Master role</span></p>
<p class="MsoNormal">The Schema master role needs a little bit of extra work to change as the MMC snap-in you use is usually hidden. We will first need to register a .dll file before we are able to access this.</p>
<p><span>Again, start on the DC you would like the change the role to. Open a command prompt window and type in &#8220;regsvr32 schmmgmt.dll&#8221; then press Enter. You should receive a message stating the .dll was registered.</span></p>
<p><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo8.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-438" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo8-300x111.jpg" alt="" width="300" height="111" /></a></span></p>
<p><span><span>Now open a brand new MMC console. (Start -&gt; Run -&gt; type in &#8220;mmc&#8221; then press Enter). Select &#8220;File&#8221; then &#8220;Add/remove Snap-in&#8221; and click the &#8220;Add&#8221; button. You should see our newly added snap-in called &#8220;Active Directory Schema&#8221;. Select this option, then click &#8220;Add&#8221; and then &#8220;Close&#8221;. Click the &#8220;OK&#8221; button to go to back to your MMC.</span></span></p>
<p><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo9.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-439" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo9-300x196.jpg" alt="" width="300" height="196" /></a></span></span></p>
<p><span><span><span>Right-click &#8220;Active Directory Schema [your DC name]&#8221; and select &#8220;Change Domain Controller&#8221; if you are not already connected to the DC that you would like to inherit the role. Specify the DC&#8217;s name and confirm. In the screenshots below, I was defaulted to being connected to the DC1 server when loading the snap-in, but wanted to change to DC2 as this was the server that was going to be receiving the &#8220;Schema Master&#8221; role.</span></span></span></p>
<p><span><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo10.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-440" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo10-300x194.jpg" alt="" width="300" height="194" /></a></span></span></span></p>
<p><span><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo11.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-441" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo11-300x194.jpg" alt="" width="300" height="194" /></a></span></span></span></p>
<p><span><span><span><span>Right-click &#8220;Active Directory Schema [your DC name]&#8221; and select &#8220;Operations Master&#8221;. Finally, click the &#8220;Change&#8221; button to initiate the change. Confirm by click &#8220;Yes&#8221;, and you should receive a success message.</span></span></span></span></p>
<p><span><span><span><span><a href="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo12.jpg" rel="lightbox[430]"><img class="aligncenter size-medium wp-image-442" src="http://sysadmin-talk.org/wp-content/uploads/2010/06/fsmo12-300x159.jpg" alt="" width="300" height="159" /></a></span></span></span></span></p>
<p><span><span><span><span><span>That should cover the basics of transferring your five FSMO roles between Domain Controllers. In the next part we&#8217;ll take a practical look at how to seize roles using the ntdsutil.exe command.</span></span></span></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/06/transferring-fsmo-roles-in-windows-server-2003/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>5 Steps to Heaven &#8211; Creating a Custom RBAC Role in Exchange 2010</title>
		<link>http://sysadmin-talk.org/2010/04/5-steps-to-heaven-creating-a-custom-rbac-role-in-exchange-2010/</link>
		<comments>http://sysadmin-talk.org/2010/04/5-steps-to-heaven-creating-a-custom-rbac-role-in-exchange-2010/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 10:15:48 +0000</pubDate>
		<dc:creator>Mike Pfeiffer</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=278</guid>
		<description><![CDATA[By now you&#8217;ve probably heard about Role Based Access Control (RBAC) in Exchange 2010, which introduces a completely different permission model than was used previously in Exchange 2007. Instead of assigning permissions using access control lists, RBAC uses management roles to delegate what you can do and where you can do it. Exchange provides several [...]]]></description>
			<content:encoded><![CDATA[<p>By now you&#8217;ve probably heard about Role Based Access Control (RBAC) in Exchange 2010, which introduces a completely different permission model than was used previously in Exchange 2007. Instead of assigning permissions using access control lists, RBAC uses management roles to delegate what you can do and where you can do it. Exchange provides several built-in roles used for typical management tasks, but in this post we&#8217;ll look at a real world example where a custom management role will be required.<span id="more-278"></span></p>
<h3>RBAC Components</h3>
<p>To get a basic understanding of how this is going to work, a quick description of the RBAC components used in the upcoming example will be helpful:</p>
<ul>
<li><strong>Management Role</strong> – this is just a container for a group of Exchange Management Shell cmdlets. For example, the Mail Recipient Creation role contains only the cmdlets required to view, create and delete recipients.</li>
<li><strong>Management Role Entry</strong> – this is an Exchange Management Shell cmdlet or custom script. Management roles are made up of management role entries.</li>
<li><strong>Management Role Group</strong> – this is an Active Directory universal security group that contains the user accounts that can be assigned to a role.</li>
<li><strong>Management Role Scope</strong> – this can be used to filter the type of objects that can be managed, and where they can be managed in Active Directory.</li>
<li><strong>Management Role Assignment</strong> – this links a management scope to a management role.</li>
</ul>
<h3>Scenario</h3>
<p>Let&#8217;s say that your company has decided that a group of support personnel should be responsible for the creation of all new Exchange recipients. You want to be very specific about what type of access this group will be granted, and you plan on implementing a custom management role based on the following requirements:</p>
<ul>
<li>Support personnel should be able to create Exchange recipients in the Employee OU in Active Directory.</li>
<li>Support personnel should not be able to create Exchange recipients in any other OU in Active Directory.</li>
<li>Support personnel should not be able to remove recipients in the Employees OU, or any other OU in Active Directory.</li>
</ul>
<p>Now that the requirements are clearly defined, we are ready to implement our custom management role.</p>
<h3>Step 1: Create the Management Role</h3>
<p>The built-in roles cannot be changed, so we need to create a new management role using one of the built-in roles as a parent. We know that the Mail Recipient Creation role provides the cmdlets that our support group will need, so we&#8217;ll create a new role as a child of the Mail Recipient Creation role using the following command:</p>
<p><code>New-ManagementRole -Name "Employee Recipient Creation" -Parent "Mail Recipient Creation"</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom1.png" alt="" /></p>
<h3>Step 2: Modify the Management Role</h3>
<p>One of the requirements in our scenario was that support personnel should not be able to remove recipients, so we need to edit our custom role and get rid of any cmdlets that can be used to remove recipients:</p>
<p><code>Get-ManagementRoleEntry "Employee Recipient Creation\*" | ?{$_.name -like "remove-*"} | Remove-ManagementRoleEntry -Confirm:$false</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom2.png" alt="" /></p>
<p>The above command will delete all of the Remove-* cmdlets from our custom role, and therefore will prevent users assigned to this role from removing recipient objects.</p>
<h3>Step 3: Create the Management Scope</h3>
<p>The next step is to create a management scope that defines where and what the support group has access to. We&#8217;ll use the following command to create our Employee management scope:</p>
<p><code>New-ManagementScope -Name Employees -RecipientRoot contoso.com/Employees -RecipientRestrictionFilter {(RecipientType -eq "UserMailbox") -or (RecipientType -eq "MailUser") -or (RecipientType -eq "MailContact")}</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom3.png" alt="" /></p>
<p>As you can see, we are specifying the recipient root as the Employees OU, per the requirements in our scenario. When specifying a RecipientRoot, we are also required to specify a RecipientRestrictionFilter which will be limited to the UserMailbox, MailUser and MailContact recipient types.</p>
<h3>Step 4: Create the Management Role Group</h3>
<p>Now we are ready to create our management role group. We&#8217;ll use the New-RoleGroup cmdlet to create the role group based on our custom role and management scope using the following command:</p>
<p><code>New-RoleGroup -Name Support -Roles "Employee Recipient Creation" -CustomRecipientWriteScope Employees -Members bjacobs,dgreen,jgordon</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom4.png" alt="" /></p>
<p>The above command creates a role group named support, which will create a universal security group in Active Directory in the Microsoft Exchange Security Groups OU. We configure the role to use the Employees scope that was created in the previous step, limiting access to the Employees OU. Also, notice that we added three users to this group using the Members parameter.</p>
<p>Doing it this way automatically creates the management role assignment for us. You can view management role assignments using the Get-ManagementRoleAssignment cmdlet.</p>
<h3>Step 5: Verifying the Configuration</h3>
<p>At this point our work is done and we can test the configuration to make sure it is working properly. There are several steps in creating a custom role, so the first couple of times you do this it will be useful to test the configuration to make sure everything works as expected.</p>
<p>Logged in as a member of the Support group, launch the Exchange Management Shell. We&#8217;ll execute the following commands to create a test mailbox in the Employees OU:</p>
<p><code>$password = ConvertTo-SecureString "P@ssw0rd01" -AsPlainText -Force</code></p>
<p><code>New-Mailbox -Name TestUser001 -UserPrincipalName TestUser001@contoso.com -Password $password -OrganizationalUnit contoso.com/Employees</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom5.png" alt="" /></p>
<p>As we can see, the above command completed successfully. Now let&#8217;s try to create a mail contact. We&#8217;ll use the New-MailContact cmdlet, omitting the OrganizationalUnit parameter:</p>
<p><code>New-MailContact -Name TestUser002 -ExternalEmailAddress TestUser002@corp.contoso.com</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom6.png" alt="" /></p>
<p>Without specifying an OrganizationalUnit, the command attempts to create the object in the default users container in Active Directory. We can tell from looking at the error output that our management scope is working since we are unable to create objects outside of the Employees OU.</p>
<p>Let&#8217;s verify that our role configuration is setup correctly by trying to use one of the Remove-* cmdlets. We&#8217;ll use the following command to remove the mailbox we created in the first step:</p>
<p><code>Remove-Mailbox TestUser001</code></p>
<p><img src="http://www.mikepfeiffer.net/wp-content/uploads/2010/04/rbac_custom7.png" alt="" /></p>
<p>As expected, we get an error stating that the Remove-Mailbox cmdlet cannot be found, since it is not part of the Employee Recipient Creation role.</p>
<h3>Summary</h3>
<p>Well, we created and tested a custom role in just 5 steps, and it was actually pretty easy to do. Once you understand the basics it&#8217;s not as hard as it seems at first glance. The TechNet <a href="http://technet.microsoft.com/en-us/library/dd298183.aspx">documentation</a> on RBAC is very thorough and I would highly recommend reading through it to learn more.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/04/5-steps-to-heaven-creating-a-custom-rbac-role-in-exchange-2010/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Finding Stale Accounts in AD with Windows PowerShell</title>
		<link>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/</link>
		<comments>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:29:12 +0000</pubDate>
		<dc:creator>Ben Lye</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=144</guid>
		<description><![CDATA[In an Active Directory domain running at the Windows Server 2003 or higher functional level  the lastLogonTimestamp attribute can be used to find out if a user or computer has logged on to the domain recently.  This can be useful information for finding inactive user and computer accounts so that they can be removed from [...]]]></description>
			<content:encoded><![CDATA[<p>In an Active Directory domain running at the Windows Server 2003 or higher functional level  the <strong>lastLogonTimestamp</strong><em> </em>attribute can be used to find out if a user or computer has logged on to the domain recently.  This can be useful information for finding inactive user and computer accounts so that they can be removed from AD.<span id="more-144"></span></p>
<p>The <strong>lastLogonTimestamp</strong> attribute is replicated across all DCs, and it’s important to understand that it does not contain the exact time and date at which the account last logged on.  Instead there is an algorithm which is used to determine when the attribute should be updated, which by default means that the timestamp in <strong>lastLogonTimestamp</strong> could be up to 14 days old.</p>
<p>To understand the algorithm you need to know that there is a configurable attribute in AD called <strong>msDS-LogonTimeSyncInterval</strong>, which controls the granularity of updates to <strong>lastLogonTimestamp</strong>.  By default it is not set, which means that the default value of 14 is used.  There is also some randomization involved to ensure that simultaneous updates from many accounts don’t cause large replication loads on the DCs.  The randomization factor is a random percentage of 5 days.</p>
<p>The algorithm means that when a user or computer logs on the <strong>lastLogonTimestamp</strong> is only updated if the current value of <strong>lastlogonTimestamp</strong> is older than ([current date] &#8211; [14 days] + [random percentage of 5 days]).  This means that the value of <strong>lastLogonTimestamp</strong> for an active account could be anything from 9-14 days old.</p>
<p>The last thing to know about <strong>lastLogonTimestamp</strong> is that the value is stored in UTC format as a large integer, so needs some manipulation to get into human-readable form.</p>
<p>Now that we understand how the attribute works we can use it to do something useful, like find all enabled computer accounts in the domain which have not logged on for 60 or more days.  PowerShell is particularly suited to this because it has built-in methods for doing the date conversions.</p>
<p><code># Calculate the UTC time 60 days ago, in      FileTime (Integer) format and convert it to a string</code></p>
<p><code>$LLTSlimit =      (Get-Date).AddDays(-60).ToFileTimeUTC().ToString()</code></p>
<p><code># Create the LDAP filter for the AD query</code></p>
<p><code># Searching for enabled computer accounts      which have lastLogonTimestamp older than 60 days</code></p>
<p><code>$LDAPFilter = "(&amp;(objectCategory=Computer)(lastlogontimestamp&lt;=$LLTSlimit)      (!(userAccountControl:1.2.840.113556.1.4.803:=2)))"</code></p>
<p><code># Create an ADSI Searcher to query AD</code></p>
<p><code>$Searcher = new-object      DirectoryServices.DirectorySearcher([ADSI]"")</code></p>
<p><code>$Searcher.filter = $LDAPFilter</code></p>
<p><code># Execute the query</code></p>
<p><code>$Accounts = $Searcher.FindAll()</code></p>
<p><code># Process the results</code></p>
<p><code>If ($Accounts.Count –gt 0) {</code></p>
<p><code>#      Create an array to store all the results</code></p>
<p><code>$Results      = @()</code><br />
<code><br />
#      Loop through each account</code><br />
<code><br />
ForEach      ($Account in $Accounts) {</code><br />
<code><br />
#      Create an object to store this account in</code></p>
<p><code>$Result      = "" | Select-Object Name,ADSPath,lastLogonTimestamp</code></p>
<p><code>#      Add the name to the object as a string</code></p>
<p><code>$Result.Name      = [String]$Account.Properties.name</code></p>
<p><code>#      Add the ADSPath to the object as a string</code></p>
<p><code>$Result.ADSPath      = [String]$Account.Properties.adspath</code></p>
<p><code>#      Add the lastLogonTimestamp to the object as a readable date</code></p>
<p><code>$Result.lastLogonTimestamp      = `</code><br />
<code><br />
[DateTime]::FromFileTime([Int64]::Parse($Account.Properties.lastlogontimestamp))</code><br />
<code><br />
#      Add this object to our array</code><br />
<code><br />
$Results      = $Results + $Result</code></p>
<p><code>}</code></p>
<p><code>}</code><br />
<code><br />
# Output the results</code></p>
<p><code>$Results | Format-Table -autosize</code></p>
<p>Extending this script to disable the discovered accounts is as easy as adding this code snippet to the end:</p>
<p><code># Disable each      account</code></p>
<p><code>ForEach ($Result      in $Results) {</code></p>
<p><code>$ADSIAccount = [ADSI]$Result.ADSPath</code></p>
<p><code>$ADSIAccount.PSBase.InvokeSet("AccountDisabled",      "True")</code></p>
<p><code>$ADSIAccount.SetInfo()</code></p>
<p><code>}</code></p>
<p>The <strong>lastLogonTimestamp</strong> attribute is useful for system administrators to understand, and because PowerShell can handle all the type conversions and date arithmetic, it is a great tool to use when working with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

