<?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>Server 2012 &#8211; Carl Webster</title>
	<atom:link href="https://www.carlwebster.com/category/server-2012-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.carlwebster.com</link>
	<description>The Accidental Citrix Admin - The site for those who find themselves supporting Citrix involuntarily or accidentally</description>
	<lastBuildDate>Mon, 06 Sep 2021 12:13:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">42228915</site>	<item>
		<title>Inside Webster&#8217;s Lab: Creating Active Directory Organizational Units, Users, Groups and Computers</title>
		<link>https://www.carlwebster.com/inside-websters-lab-creating-active-directory-organizational-units-users-groups-computers/</link>
					<comments>https://www.carlwebster.com/inside-websters-lab-creating-active-directory-organizational-units-users-groups-computers/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Wed, 31 Dec 2014 19:53:16 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[PVS]]></category>
		<category><![CDATA[Server 2012]]></category>
		<category><![CDATA[XenDesktop 5.x]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=7943</guid>

					<description><![CDATA[With all the writing I do for my website and customers, I recreate my Windows Server 2012 R2 Active Directory (AD) environment frequently.  I thought I would show you how,&#8230;]]></description>
										<content:encoded><![CDATA[<p>With all the writing I do for my website and customers, I recreate my Windows Server 2012 R2 Active Directory (AD) environment frequently.  I thought I would show you how, in just a few seconds, I recreate my entire AD structure.</p>
<p><span id="more-7943"></span>This may come as a shock to some of you but I do not use PowerShell for this task.  Instead, I use built-in Windows utilities that I have been using since probably around 2004.  What I use works, so I see no need to redo it in PowerShell. I only use three Windows utilities:</p>
<ul>
<li>DSAdd</li>
<li>DSMod</li>
<li>DSQuery</li>
</ul>
<p>I have a batch file that does the following:</p>
<ul>
<li>Creates the OUs</li>
<li>Creates the security groups</li>
<li>Creates the user accounts</li>
<li>Adds the user accounts into the security groups</li>
<li>Creates the computer accounts</li>
</ul>
<p>I pre-create all the computer accounts so when the computers are joined to the domain, they are in the right OU and get the necessary GPOs immediately after the domain join restart.</p>
<p>The <a title="Webster's Batch File to Create the Lab's AD Structure" href="https://carlwebster.sharefile.com/d-sde599cc6aee4b1c8" target="_blank" rel="noopener">batch file</a> is very simple (to me).</p>
<p><strong>Note:</strong> The batch file contains several &#8220;-upn something@domain.com&#8221;. These seem to confuse the syntax highlighter I use for WordPress. The highlighter treated everything after the &#8220;something@domain.com&#8221; as JavaScript and really scrambled the rest of the text. Just in the text below, I changed all the &#8220;something@domain.com&#8221; to &#8220;something at domain.com&#8221; just for this article but they are still there in the <a title="Webster's Batch File to Create the Lab's AD Structure" href="https://carlwebster.sharefile.com/d-sde599cc6aee4b1c8" target="_blank" rel="noopener">batch file you can download</a>.</p>
<pre class="brush: plain; title: ; notranslate">
echo off
CLS

Echo Create OUs
Dsadd ou &quot;ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;top level OU for Lab&quot;

Dsadd ou &quot;ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;Accounts top level OU&quot;
Dsadd ou &quot;ou=Admin,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for Admin accounts&quot;
Dsadd ou &quot;ou=Service,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for service accounts&quot;
Dsadd ou &quot;ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for regular user account&quot;

Dsadd ou &quot;ou=Desktops,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;Desktops top level OU&quot;
Dsadd ou &quot;ou=Admin,ou=Desktops,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for administrator desktops&quot;
Dsadd ou &quot;ou=XD76,ou=Desktops,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for regular user desktops&quot;

Dsadd ou &quot;ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;Security Groups top level OU&quot;
Dsadd ou &quot;ou=Admin,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for admin security groups&quot;
Dsadd ou &quot;ou=Desktops,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for desktop computer security groups&quot;
Dsadd ou &quot;ou=User,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for regular user security groups&quot;

Dsadd ou &quot;ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;Servers top level OU&quot;
Dsadd ou &quot;ou=PVS,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for PVS servers&quot;
Dsadd ou &quot;ou=XD76,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;OU for all other XenDesktop servers&quot;

Echo Create security groups
Dsadd group &quot;cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -secgrp yes -desc &quot;Group for users who need local admin rights&quot;

Dsadd group &quot;cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -secgrp yes -desc &quot;Group for users who need XenDesktop desktop access&quot;

Echo Create user accounts
Dsadd user &quot;cn=svc_ctxpvs,ou=Service,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -samid svc_ctxpvs -upn svc_ctxpvs at LabADDomain.com -fn svc_ctxpvs -display &quot;svc_ctxpvs&quot; -pwd FakePwd -desc &quot;Citrix PVS Service Account&quot; -mustchpwd no -pwdneverexpires yes
Dsadd user &quot;cn=svc_ctxsqldb,ou=Service,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -samid svc_ctxsqldb -upn svc_ctxsqldb at LabADDomain.com -fn svc_ctxsqldb -display &quot;svc_ctxsqldb&quot; -pwd FakePwd -desc &quot;Citrix SQL DBA Service Account&quot; -mustchpwd no -pwdneverexpires yes

Dsadd user &quot;cn=User1,ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -samid User1 -upn User1 at LabADDomain.com -fn User1 -display &quot;User1&quot; -pwd FakePwd -desc &quot;User1 PvD&quot; -mustchpwd no -pwdneverexpires yes
Dsadd user &quot;cn=User2,ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -samid User2 -upn User2 at LabADDomain.com -fn User2 -display &quot;User2&quot; -pwd FakePwd -desc &quot;User2 PvD&quot; -mustchpwd no -pwdneverexpires yes
Dsadd user &quot;cn=User3,ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -samid User3 -upn User3 at LabADDomain.com -fn User3 -display &quot;User3&quot; -pwd FakePwd -desc &quot;User3 PvD&quot; -mustchpwd no -pwdneverexpires yes

Echo Add user accounts to security groups
Rem all users in the Lab/Accounts/User OU get added to the XDUsers security group
dsquery user &quot;ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -limit 0 | dsmod group &quot;cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -chmbr -c

Rem any user in the Lab/Accounts/User OU that has PvD in the description gets added to the LocalAdmins security group
dsquery user &quot;ou=User,ou=Accounts,ou=Lab,dc=LabADDomain,dc=com&quot; -desc &quot;*PvD*&quot; -limit 0 | dsmod group &quot;cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=LabADDomain,dc=com&quot; -chmbr -c

Echo Create computer accounts
Dsadd computer &quot;cn=PVS76,ou=PVS,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -samid PVS76 -desc &quot;PVS76&quot;

Dsadd computer &quot;cn=XD76,ou=XD76,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -samid XD76 -desc &quot;XD76&quot;
Dsadd computer &quot;cn=Director,ou=XD76,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -samid Director -desc &quot;Director&quot;
Dsadd computer &quot;cn=StoreFront,ou=XD76,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -samid StoreFront -desc &quot;StoreFront&quot;
Dsadd computer &quot;cn=SQL,ou=XD76,ou=Servers,ou=Lab,dc=LabADDomain,dc=com&quot; -samid SQL -desc &quot;SQL&quot;

echo on
</pre>
<p>The results of running the batch file.</p>
<p><strong>Note:</strong> In the text below, I also had to change all the &#8220;something@domain.com&#8221; to &#8220;something at domain.com&#8221; just for this article but they are still there in the <a title="Webster's Batch File to Create the Lab's AD Structure" href="https://carlwebster.sharefile.com/d-sde599cc6aee4b1c8" target="_blank" rel="noopener">batch file you can download</a>.</p>
<pre class="brush: plain; title: ; notranslate">
Echo Create OUs
Create OUs
Dsadd ou &quot;ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;top level OU for Lab&quot;
dsadd succeeded:ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;Accounts top level OU&quot;
dsadd succeeded:ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Admin,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for Admin accounts&quot;
dsadd succeeded:ou=Admin,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for service accounts&quot;
dsadd succeeded:ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for regular user account&quot;
dsadd succeeded:ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Desktops,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;Desktops top level OU&quot;
dsadd succeeded:ou=Desktops,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Admin,ou=Desktops,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for administrator desktops&quot;
dsadd succeeded:ou=Admin,ou=Desktops,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=XD76,ou=Desktops,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for regular user desktops&quot;
dsadd succeeded:ou=XD76,ou=Desktops,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;Security Groups top level OU&quot;
dsadd succeeded:ou=Groups,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for admin security groups&quot;
dsadd succeeded:ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Desktops,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for desktop computer security groups&quot;
dsadd succeeded:ou=Desktops,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for regular user security groups&quot;
dsadd succeeded:ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;Servers top level OU&quot;
dsadd succeeded:ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=PVS,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for PVS servers&quot;
dsadd succeeded:ou=PVS,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd ou &quot;ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;OU for all other XenDesktop servers&quot;
dsadd succeeded:ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Echo Create security groups
Create security groups
Dsadd group &quot;cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -secgrp yes -desc &quot;Group for users who need local admin rights&quot;
dsadd succeeded:cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Dsadd group &quot;cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -secgrp yes -desc &quot;Group for users who need XenDesktop desktop access&quot;
dsadd succeeded:cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Echo Create user accounts
Create user accounts
Dsadd user &quot;cn=svc_ctxpvs,ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -samid svc_ctxpvs -upn svc_ctxpvs at labaddomain -fn svc_ctxpvs -display &quot;svc_ctxpvs&quot; -pwd FakePwd -desc &quot;Citrix PVS Service Account&quot; -mustchpwd no -pwdneverexpires yes
dsadd succeeded:cn=svc_ctxpvs,ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd user &quot;cn=svc_ctxsqldb,ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -samid svc_ctxsqldb -upn svc_ctxsqldb at labaddomain -fn svc_ctxsqldb -display &quot;svc_ctxsqldb&quot; -pwd FakePwd -desc &quot;Citrix SQL DBA Service Account&quot; -mustchpwd no -pwdneverexpires yes
dsadd succeeded:cn=svc_ctxsqldb,ou=Service,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd user &quot;cn=User1,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -samid User1 -upn User1 at labaddomain -fn User1 -display &quot;User1&quot; -pwd FakePwd -desc &quot;User1 PvD&quot; -mustchpwd no -pwdneverexpires yes
dsadd succeeded:cn=User1,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd user &quot;cn=User2,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -samid User2 -upn User2 at labaddomain -fn User2 -display &quot;User2&quot; -pwd FakePwd -desc &quot;User2 PvD&quot; -mustchpwd no -pwdneverexpires yes
dsadd succeeded:cn=User2,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com
Dsadd user &quot;cn=User3,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -samid User3 -upn User3 at labaddomain -fn User3 -display &quot;User3&quot; -pwd FakePwd -desc &quot;User3 PvD&quot; -mustchpwd no -pwdneverexpires yes
dsadd succeeded:cn=User3,ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=comEcho Add user accounts to security groups
Add user accounts to security groups
Rem all users in the Lab/Accounts/User OU get added to the XDUsers security group
dsquery user &quot;ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -limit 0 | dsmod group &quot;cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -chmbr -c
dsmod succeeded:cn=XDUsers,ou=User,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Rem any user in the Lab/Accounts/User OU that has PvD in the description gets added to the LocalAdmins security group
dsquery user &quot;ou=User,ou=Accounts,ou=Lab,dc=labaddomain,dc=com&quot; -desc &quot;*PvD*&quot; -limit 0 | dsmod group &quot;cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com&quot; -chmbr -c
dsmod succeeded:cn=LocalAdmins,ou=Admin,ou=Groups,ou=Lab,dc=labaddomain,dc=com
Echo Create computer accounts
Create computer accounts
Dsadd computer &quot;cn=PVS76,ou=PVS,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -samid PVS76 -desc &quot;PVS76&quot;
dsadd succeeded:cn=PVS76,ou=PVS,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd computer &quot;cn=XD76,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -samid XD76 -desc &quot;XD76&quot;
dsadd succeeded:cn=XD76,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd computer &quot;cn=Director,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -samid Director -desc &quot;Director&quot;
dsadd succeeded:cn=Director,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd computer &quot;cn=StoreFront,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -samid StoreFront -desc &quot;StoreFront&quot;
dsadd succeeded:cn=StoreFront,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com
Dsadd computer &quot;cn=SQL,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com&quot; -samid SQL -desc &quot;SQL&quot;
dsadd succeeded:cn=SQL,ou=XD76,ou=Servers,ou=Lab,dc=labaddomain,dc=com
echo on
C:\&gt;
</pre>
<p>And the results in AD.</p>
<figure id="attachment_33739" aria-describedby="caption-attachment-33739" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001.png" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" class="wp-image-33739 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001.png" alt="Figure 1" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure001-600x449.png 600w" sizes="(max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33739" class="wp-caption-text">Figure 1</figcaption></figure>
<figure id="attachment_33740" aria-describedby="caption-attachment-33740" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002.png" target="_blank" rel="noopener"><img decoding="async" class="wp-image-33740 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002.png" alt="Figure 2" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure002-600x449.png 600w" sizes="(max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33740" class="wp-caption-text">Figure 2</figcaption></figure>
<figure id="attachment_33741" aria-describedby="caption-attachment-33741" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003.png" target="_blank" rel="noopener"><img decoding="async" class="wp-image-33741 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003.png" alt="Figure 3" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure003-600x449.png 600w" sizes="(max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33741" class="wp-caption-text">Figure 3</figcaption></figure>
<figure id="attachment_33742" aria-describedby="caption-attachment-33742" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004.png"><img loading="lazy" decoding="async" class="size-full wp-image-33742" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004.png" alt="Figure 4" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure004-600x449.png 600w" sizes="auto, (max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33742" class="wp-caption-text">Figure 4</figcaption></figure>
<figure id="attachment_33743" aria-describedby="caption-attachment-33743" style="width: 414px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure005.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33743 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure005.png" alt="Figure 5" width="414" height="462" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure005.png 414w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure005-269x300.png 269w" sizes="auto, (max-width: 414px) 100vw, 414px" /></a><figcaption id="caption-attachment-33743" class="wp-caption-text">Figure 5</figcaption></figure>
<figure id="attachment_33744" aria-describedby="caption-attachment-33744" style="width: 414px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure006.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33744 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure006.png" alt="Figure 6" width="414" height="462" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure006.png 414w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure006-269x300.png 269w" sizes="auto, (max-width: 414px) 100vw, 414px" /></a><figcaption id="caption-attachment-33744" class="wp-caption-text">Figure 6</figcaption></figure>
<figure id="attachment_33745" aria-describedby="caption-attachment-33745" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007.png"><img loading="lazy" decoding="async" class="size-full wp-image-33745" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007.png" alt="Figure 7" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure007-600x449.png 600w" sizes="auto, (max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33745" class="wp-caption-text">Figure 7</figcaption></figure>
<figure id="attachment_33746" aria-describedby="caption-attachment-33746" style="width: 414px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure008.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33746 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure008.png" alt="Figure 8" width="414" height="462" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure008.png 414w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure008-269x300.png 269w" sizes="auto, (max-width: 414px) 100vw, 414px" /></a><figcaption id="caption-attachment-33746" class="wp-caption-text">Figure 8</figcaption></figure>
<figure id="attachment_33747" aria-describedby="caption-attachment-33747" style="width: 414px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure009.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33747 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure009.png" alt="Figure 9" width="414" height="462" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure009.png 414w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure009-269x300.png 269w" sizes="auto, (max-width: 414px) 100vw, 414px" /></a><figcaption id="caption-attachment-33747" class="wp-caption-text">Figure 9</figcaption></figure>
<figure id="attachment_33748" aria-describedby="caption-attachment-33748" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33748 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010.png" alt="Figure 10" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure010-600x449.png 600w" sizes="auto, (max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33748" class="wp-caption-text">Figure 10</figcaption></figure>
<figure id="attachment_33749" aria-describedby="caption-attachment-33749" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33749 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011.png" alt="Figure 11" width="820" height="614" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011-401x300.png 401w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011-768x575.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure011-600x449.png 600w" sizes="auto, (max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33749" class="wp-caption-text">Figure 11</figcaption></figure>
<p>And there you have the very quick and very simple way I can create and recreate my AD lab structure.  To delete the structure, I just right-click the top-level Lab OU and select delete as shown in Figure 12.</p>
<figure id="attachment_33750" aria-describedby="caption-attachment-33750" style="width: 408px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure012.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33750 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure012.png" alt="Figure 12" width="408" height="579" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure012.png 408w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure012-211x300.png 211w" sizes="auto, (max-width: 408px) 100vw, 408px" /></a><figcaption id="caption-attachment-33750" class="wp-caption-text">Figure 12</figcaption></figure>
<p>Click <em>Yes</em> to the popup shown in Figure 13.</p>
<figure id="attachment_33751" aria-describedby="caption-attachment-33751" style="width: 483px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure013.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33751 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure013.png" alt="Figure 13" width="483" height="172" /></a><figcaption id="caption-attachment-33751" class="wp-caption-text">Figure 13</figcaption></figure>
<p>Select <em>Use Delete Subtree server control</em> and click Yes as shown in Figure 14.</p>
<figure id="attachment_33752" aria-describedby="caption-attachment-33752" style="width: 402px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure014.png"><img loading="lazy" decoding="async" class="size-full wp-image-33752" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure014.png" alt="Figure 14" width="402" height="288" /></a><figcaption id="caption-attachment-33752" class="wp-caption-text">Figure 14</figcaption></figure>
<p>And in less than the blink of an eye, the Lab OU structure is removed from AD as shown in Figure 15.</p>
<figure id="attachment_33753" aria-describedby="caption-attachment-33753" style="width: 820px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-33753 size-full" src="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015.png" alt="Figure 15" width="820" height="256" srcset="https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015.png 820w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015-530x165.png 530w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015-768x240.png 768w, https://www.carlwebster.com/wp-content/uploads/2014/12/Figure015-600x187.png 600w" sizes="auto, (max-width: 820px) 100vw, 820px" /></a><figcaption id="caption-attachment-33753" class="wp-caption-text">Figure 15</figcaption></figure>
<p>Since <strong>DSAdd OU</strong> does not have a parameter to set the <em>Protect this OU from accidental deletion </em>flag, it is very simple to delete the Lab OU tree and run the batch file to recreate the Lab OU structure whenever I need to have a clean (re)starting point.</p>
<p>I hope this very quick and simple process helps you out.</p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/inside-websters-lab-creating-active-directory-organizational-units-users-groups-computers/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7943</post-id>	</item>
		<item>
		<title>Webster&#8217;s Citrix Documentation Scripts and Microsoft PowerShell Version 3</title>
		<link>https://www.carlwebster.com/websters-citrix-documentation-scripts-and-microsoft-powershell-version-3/</link>
					<comments>https://www.carlwebster.com/websters-citrix-documentation-scripts-and-microsoft-powershell-version-3/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Tue, 10 Sep 2013 21:41:23 +0000</pubDate>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PVS]]></category>
		<category><![CDATA[Server 2012]]></category>
		<category><![CDATA[XenApp 5 for Server 2008]]></category>
		<category><![CDATA[XenApp 6.0]]></category>
		<category><![CDATA[XenApp 6.5]]></category>
		<category><![CDATA[PowerShell V2]]></category>
		<category><![CDATA[PowerShell V3]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=6134</guid>

					<description><![CDATA[I am in the process of creating V4 of the PVS and XenApp documentation scripts.  As part of the process I wanted to make sure all the current and future&#8230;]]></description>
										<content:encoded><![CDATA[<p>I am in the process of creating V4 of the PVS and XenApp documentation scripts.  As part of the process I wanted to make sure all the current and future scripts worked with PowerShell Version 3.</p>
<p><span id="more-6134"></span></p>
<p>The following were tested:</p>
<ul>
<li>XenApp 5 on Windows Server 2008 Sp2, both PowerShell V2 and V3 &#8211; script versions 2 and the in development V4.</li>
<li>XenApp 6 on Windows Server 2008 R2 SP1, both PowerShell V2 and V3 &#8211; script versions 3 and the in development V4.</li>
<li>XenApp 6.5 on Windows Server 2008 R2 SP1, both PowerShell V2 and V3 &#8211; script versions 3.1 and the in development V4.</li>
<li>The PVS version 3 script was updated to support PVS 7.0 running on Server 2012.  Server 2012 includes PowerShell V3 so the PVS script has already been tested with PowerShell V3.</li>
</ul>
<p>All the V4 scripts are being developed exclusively with PowerShell V3.  When PowerShell V4 is released, I will retest my documentation scripts with it.</p>
<p>I have updated all the appropriate ReadMe files and the <a title="Where to Get Copies of the Various Documentation Scripts" href="https://www.carlwebster.com/where-to-get-copies-of-the-documentation-scripts/" target="_blank">Where to Get Copies of the Various Documentation Scripts</a> article.</p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/websters-citrix-documentation-scripts-and-microsoft-powershell-version-3/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6134</post-id>	</item>
		<item>
		<title>Default Domain Group Policy &#8211; What Should Be Configured?</title>
		<link>https://www.carlwebster.com/default-domain-group-policy-what-should-be-configured/</link>
					<comments>https://www.carlwebster.com/default-domain-group-policy-what-should-be-configured/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Sat, 10 Aug 2013 13:03:06 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Certification]]></category>
		<category><![CDATA[Server 2012]]></category>
		<category><![CDATA[XenApp 5 for Server 2003]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=6105</guid>

					<description><![CDATA[Ever since I started working with Microsoft Active Directory (AD) in July 2001, I have always wondered what should be configured in the Default Domain Group Policy Object (GPO).  I&#8230;]]></description>
										<content:encoded><![CDATA[<p>Ever since I started working with Microsoft Active Directory (AD) in July 2001, I have always wondered what should be configured in the Default Domain Group Policy Object (GPO).  I have had a couple of my AD mentors tell me what should be in the Default Domain GPO and I have parroted their recommendation for years now because I agree with them.  I am sure I also read somewhere in the past 12 years the Best Practices for this GPO but just have never been able to find it.  This morning I finally came across an article from Microsoft that clearly states what the Best Practices are for the Default Domain GPO.</p>
<p><span id="more-6105"></span></p>
<p>Excuse me why I explain the journey that took me to the article.</p>
<p>I am currently rebuilding my lab to learn all the Microsoft System Center 2012 SP1 stuff.  I am using only Server 2012 for all my Virtual Machines (VMs).  With all the work I am doing with Server 2012 and since I am also planning on taking the Microsoft Private Cloud certification exams, I decided I needed to take the 70-417 exam (<a title="Upgrading Your Skills to MCSA Windows Server 2012" href="http://www.microsoft.com/learning/en-us/exam-70-417.aspx" target="_blank" rel="noopener">Upgrading your Skills to MCSA Windows Server 2012</a>).  Since I have taken well over 200 certification exams since 1998, I consider myself a professional certification exam taker.  The first thing I do when I decide to take an exam is to look at what the vendor says will be on the exam.  Citrix and Microsoft call that the <em>Exam Preparation Guide.</em></p>
<p>The 70-417 exam is an upgrade exam for someone who already holds an earlier MCSA.  70-417 covers the same material as three other exams: 70-410, 70-411, and 70-412.  Microsoft offers a <a title="Upgrade Your MCITP or MCSA to Windows Server 2012 with this FREE Certification Exam Study Guide for Exam 70-417" href="http://blogs.technet.com/b/keithmayer/archive/2013/05/20/upgrade-your-mcitp-or-mcsa-to-windows-server-2012-with-this-free-certification-exam-study-guide-for-exam-70-417.aspx#.UgYynIIo5GE" target="_blank" rel="noopener">70-417 study guide</a>.</p>
<p>One of the items to be covered is recovering from a deleted GPO.  How do you recover a deleted (or from a really screwed up) Default Domain and or Default Domain Controllers GPO?  I haven&#8217;t had to recover from a deleted Default Domain GPO since 2005 or from a screwed-up one since 2008.  Well, you use the <a title="DCGpoFix" href="http://technet.microsoft.com/en-us/library/hh875588.aspx" target="_blank" rel="noopener">DCGpoFix command-line utility</a>.</p>
<p>Since I am a reader, I read the entire article.  Lo and behold, after all these years, I actually saw in writing from Microsoft the Best Practice I had been telling people about all these years.  Right there in the first paragraph under <em>Examples</em>:</p>
<h2>As a best practice, you should configure the Default Domain Policy GPO only to manage the default Account Policies settings, Password Policy, Account Lockout Policy, and Kerberos Policy.</h2>
<p>I cannot count the number of arguments I have had with Windows Admins over this.  And wouldn&#8217;t you know, my AD mentors have been correct all these years! 🙂</p>
<p>I once did a troubleshooting project for a Citrix XenApp 5 on Server 2003 environment for slow logons.  It seems ever since XenApp 5 had been installed and put into production, EVERY user on the network was experiencing slow logins and many other issues.  Naturally, of course, XenApp 5 received the blame.  The actual problem?  They had put over 800 lockdown configuration settings in the Default Domain GPO!!!!  And they wondered why every user on the network was affected!!!  Instead of having a separate Organizational Unit (OU) for the XenApp servers, they put them in the Computers Container (where you cannot directly apply any GPO).  They then put all their lockdown settings in the Default Domain GPO which instantly affected everyone.</p>
<p>The fix?</p>
<ol>
<li>Record the Account, Password, Account Lockout, and Kerberos policy settings,</li>
<li>Create an OU for the XenApp servers,</li>
<li>Create a lockdown GPO and link it to the new XenApp server&#8217;s OU,</li>
<li>Run DCGpoFix /domain to recreate the Default Domain policy,</li>
<li>Edit the new Default Domain GPO and enter the recorded settings from Step 1 above,</li>
<li>Move the XenApp servers to their new OU,</li>
<li>Reboot the XenApp servers (necessary to affect the move to the new OU), and then</li>
<li>Troubleshoot and fix remaining issues.</li>
</ol>
<p>Projects like this are where I get the material for my &#8220;10 Things in AD&#8230;&#8221; presentations.  This is also why studying for certification exams can be beneficial.  Now I have proof I am correct in what I tell people should go in the Default Domain GPO.</p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/default-domain-group-policy-what-should-be-configured/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6105</post-id>	</item>
		<item>
		<title>Creating a Group Policy using Microsoft PowerShell to Configure the Authoritative Time Server</title>
		<link>https://www.carlwebster.com/creating-a-group-policy-using-microsoft-powershell-to-configure-the-authoritative-time-server/</link>
					<comments>https://www.carlwebster.com/creating-a-group-policy-using-microsoft-powershell-to-configure-the-authoritative-time-server/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Thu, 08 Aug 2013 10:01:43 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Server 2012]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=6061</guid>

					<description><![CDATA[In my 10 Things in AD… presentations, I talk about the importance of having the domain controller that holds the Primary Domain Controller Emulator (PDCe) role configured as the authoritative&#8230;]]></description>
										<content:encoded><![CDATA[<p>In my <a href="https://www.carlwebster.com/briforum-2012-chicago/">10 Things in AD…</a> presentations, I talk about the importance of having the domain controller that holds the Primary Domain Controller Emulator (PDCe) role configured as the authoritative time source for the forest.  In the PDF that accompanies the presentations, I include a link to a Microsoft <a href="http://blogs.technet.com/b/askds/archive/2008/11/13/configuring-an-authoritative-time-server-with-group-policy-using-wmi-filtering.aspx">Ask the Directory Service Team blog article</a>.  The main problem with that article is there is not enough detail for a lot of people.  Now that Server 2008 and later include PowerShell cmdlets for Group Policy, I thought I would add some detail on creating the Group Policy with PowerShell.</p>
<p><span id="more-6061"></span></p>
<p>There is no way to use the in-the-box Group Policy PowerShell cmdlets to create WMI Filters.  For that, there is a <a href="http://gallery.technet.microsoft.com/scriptcenter/Group-Policy-WMI-filter-38a188f3#content">Group Policy WMI</a> filter cmdlet module available.  I downloaded the module and placed it in my scripts folder, c:\webster.  There was an issue for me and I had to change one line in the module.</p>
<p>I had to change line 70 from:</p>
<pre class="brush: powershell; title: ; notranslate">
$msWMIAuthor = (Get-ADUser $env:USERNAME).UserPrincipalName
</pre>
<p>To:</p>
<pre class="brush: powershell; title: ; notranslate">
$msWMIAuthor = (Get-ADUser $env:USERNAME).Name
</pre>
<p>Without that change, I received an error on line 97 with a Null value in the $Attr array defined in line 80.  I traced the Null value to the msWMI-Author value in the array.</p>
<p>The script to create the Group Policy:</p>
<pre class="brush: powershell; title: ; notranslate">
Set-StrictMode -Version 2

#Carl Webster, CTP and independent consultant
#webster@carlwebster.com
#@carlwebster on Twitter
#https://www.carlwebster.com
#With help from Michael B. Smith - &lt;a href=&quot;https://www.essential.exchange/blog/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.essential.exchange/blog/&lt;/a&gt;

# load required modules
Import-Module ActiveDirectory
Import-Module GroupPolicy
#the following module is available for download from
#http://gallery.technet.microsoft.com/scriptcenter/Group-Policy-WMI-filter-38a188f3
#assuming the module is in the same folder as the script
Import-Module ( Join-Path ( Split-Path $MyInvocation.MyCommand.Path -Parent) GPWmiFilter.psm1 )

#define variables specific to an AD environment
$GPOName       = 'Set PDCe as Authoritative Time Server'
$defaultNC     = ( &#x5B;ADSI]&quot;LDAP://RootDSE&quot; ).defaultNamingContext.Value
$TargetOU      = 'OU=Domain Controllers,' + $defaultNC
$TimeServer    = 'north-america.pool.ntp.org,0x1'
$WMIFilterName = 'PDCe Role Filter'

#the GPWmiFilter module said to put this in the main code
new-itemproperty &quot;HKLM:\System\CurrentControlSet\Services\NTDS\Parameters&quot; `
-name &quot;Allow System Only Change&quot; -value 1 -propertyType dword -EA 0

#create WMI Filter
$filter = New-GPWmiFilter -Name $WMIFilterName `
-Expression 'Select * from Win32_ComputerSystem where DomainRole = 5' `
-Description 'Queries for the Domain Controller that holds the PDCe FSMO Role' `
-PassThru

#create new GPO shell
$GPO = New-GPO -Name $GPOName

#add WMI filter
$GPO.WmiFilter = $Filter

#set the three registry keys in the Preferences section of the new GPO
Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context Computer `
-Key 'HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config' `
-Type DWord  -ValueName 'AnnounceFlags' -Value 5 | out-null

Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context Computer `
-Key 'HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters' `
-Type String -ValueName 'NtpServer' -Value $TimeServer | out-null

Set-GPPrefRegistryValue -Name $GPOName -Action Update -Context Computer `
-Key 'HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters' `
-Type String -ValueName 'Type' -Value 'NTP' | out-null

#link the new GPO to the Domain Controllers OU
New-GPLink -Name $GPOName `
-Target $TargetOU | out-null
</pre>
<p>My Group Policy Management Console (GPMC) before running the script is shown in Figure 1 showing no WMI Filters exist.</p>
<figure id="attachment_49478" aria-describedby="caption-attachment-49478" style="width: 321px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49478" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01-1.png" alt="Figure 1" width="321" height="371" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01-1.png 321w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01-1-260x300.png 260w" sizes="auto, (max-width: 321px) 100vw, 321px" /></a><figcaption id="caption-attachment-49478" class="wp-caption-text">Figure 1</figcaption></figure>
<p>The script is processed and then I ran the Get-GPO cmdlet to verify the GPO was created (Figure 2).</p>
<figure id="attachment_49479" aria-describedby="caption-attachment-49479" style="width: 564px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-2.png"><img loading="lazy" decoding="async" class="size-full wp-image-49479" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-2.png" alt="Figure 2" width="564" height="276" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-2.png 564w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-2-530x259.png 530w" sizes="auto, (max-width: 564px) 100vw, 564px" /></a><figcaption id="caption-attachment-49479" class="wp-caption-text">Figure 2</figcaption></figure>
<p>After a refresh, a look back in the GPMC (Figure 3) showing the new WMI Filter and GPO.</p>
<figure id="attachment_49480" aria-describedby="caption-attachment-49480" style="width: 331px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49480" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03-1.png" alt="Figure 3" width="331" height="387" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03-1.png 331w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03-1-257x300.png 257w" sizes="auto, (max-width: 331px) 100vw, 331px" /></a><figcaption id="caption-attachment-49480" class="wp-caption-text">Figure 3</figcaption></figure>
<p>Selecting the new WMI Filter in the GPMC shows all the settings are correct: Filter Name, Description, and Query as shown in Figure 4.</p>
<figure id="attachment_49481" aria-describedby="caption-attachment-49481" style="width: 877px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49481" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1.png" alt="Figure 4" width="877" height="385" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1.png 877w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1-530x233.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1-768x337.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04-1-600x263.png 600w" sizes="auto, (max-width: 877px) 100vw, 877px" /></a><figcaption id="caption-attachment-49481" class="wp-caption-text">Figure 4</figcaption></figure>
<p>Another look in the GPMC at the Domain Controllers OU shows the new GPO is linked properly as shown in Figure 5.</p>
<figure id="attachment_49482" aria-describedby="caption-attachment-49482" style="width: 334px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49482" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05-1.png" alt="Figure 5" width="334" height="427" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05-1.png 334w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05-1-235x300.png 235w" sizes="auto, (max-width: 334px) 100vw, 334px" /></a><figcaption id="caption-attachment-49482" class="wp-caption-text">Figure 5</figcaption></figure>
<p>And Figure 6 shows all the registry keys are set properly.</p>
<figure id="attachment_49483" aria-describedby="caption-attachment-49483" style="width: 743px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49483" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1.png" alt="Figure 6" width="743" height="877" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1.png 743w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1-254x300.png 254w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1-678x800.png 678w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-1-600x708.png 600w" sizes="auto, (max-width: 743px) 100vw, 743px" /></a><figcaption id="caption-attachment-49483" class="wp-caption-text">Figure 6</figcaption></figure>
<p>The current registry keys are shown in Figures 7 and 8.</p>
<figure id="attachment_49484" aria-describedby="caption-attachment-49484" style="width: 721px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49484" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07-1.png" alt="Figure 7" width="721" height="355" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07-1.png 721w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07-1-530x261.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07-1-600x295.png 600w" sizes="auto, (max-width: 721px) 100vw, 721px" /></a><figcaption id="caption-attachment-49484" class="wp-caption-text">Figure 7</figcaption></figure>
<figure id="attachment_49485" aria-describedby="caption-attachment-49485" style="width: 802px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49485" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1.png" alt="Figure 8" width="802" height="355" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1.png 802w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1-530x235.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1-768x340.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08-1-600x266.png 600w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption id="caption-attachment-49485" class="wp-caption-text">Figure 8</figcaption></figure>
<p>After a GPUPDATE /FORCE, the registry keys are shown in Figures 9 and 10.</p>
<figure id="attachment_49486" aria-describedby="caption-attachment-49486" style="width: 802px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49486" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1.png" alt="Figure 9" width="802" height="355" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1.png 802w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1-530x235.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1-768x340.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09-1-600x266.png 600w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption id="caption-attachment-49486" class="wp-caption-text">Figure 9</figcaption></figure>
<figure id="attachment_49487" aria-describedby="caption-attachment-49487" style="width: 802px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49487" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1.png" alt="Figure 10" width="802" height="355" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1.png 802w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1-530x235.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1-768x340.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-1-600x266.png 600w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption id="caption-attachment-49487" class="wp-caption-text">Figure 10</figcaption></figure>
<p>What happens on a domain controller that is not the PDCe?  That is shown in Figure 11.  As you can see, the new GPO was denied because of the WMI Filter.</p>
<figure id="attachment_49488" aria-describedby="caption-attachment-49488" style="width: 568px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49488" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11-1.png" alt="Figure 11" width="568" height="643" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11-1.png 568w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11-1-265x300.png 265w" sizes="auto, (max-width: 568px) 100vw, 568px" /></a><figcaption id="caption-attachment-49488" class="wp-caption-text">Figure 11</figcaption></figure>
<p>There you go.  Now you can automate creating the Group Policy to set the Forest Root Domain’s PDCe as the authoritative time server for your AD Forest.</p>
<p><strong>You can always find the most current script by going to </strong><a title="Current Scripts" href="https://www.carlwebster.com/downloads/" target="_blank" rel="noopener noreferrer"><strong>https://www.carlwebster.com/where-to-get-copies-of-the-documentation-scripts/</strong></a></p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/creating-a-group-policy-using-microsoft-powershell-to-configure-the-authoritative-time-server/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6061</post-id>	</item>
		<item>
		<title>What Happens to the FSMO Roles When the Domain Controller That Holds Them is Demoted</title>
		<link>https://www.carlwebster.com/what-happens-to-the-fsmo-roles-when-the-domain-controller-that-holds-them-is-demoted/</link>
					<comments>https://www.carlwebster.com/what-happens-to-the-fsmo-roles-when-the-domain-controller-that-holds-them-is-demoted/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Wed, 07 Aug 2013 10:30:15 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Server 2012]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=6018</guid>

					<description><![CDATA[At Briforum 2013 Chicago, after my session on More Things in AD…, someone asked me a question.  The question was “What happens to the FSMO roles when the domain controller&#8230;]]></description>
										<content:encoded><![CDATA[<p>At Briforum 2013 Chicago, after my session on <a title="More Things in AD..." href="https://www.carlwebster.com/briforum-2013-chicago/" target="_blank" rel="noopener"><i>More Things in AD…</i></a>, someone asked me a question.  The question was “What happens to the FSMO roles when the domain controller that holds them is demoted and is no longer a domain controller?”  The person asking the question was wondering, in an emergency, if a  domain controller (DC) must be quickly demoted and it is unknown if the DC holds any FSMO roles, what happens?  I gave the answer and this article is to show proof my answer was correct because the asker gave me a puzzled look.  Kind of looking at me asking “Are you sure?”</p>
<p><span id="more-6018"></span></p>
<p>In my lab, I created five different WebstersLab.com domains.  Obviously, only one WebstersLab.com domain was powered on at a time.  The first four labs have three domain controllers: LabDC1, LabDC2, and LabDC3.  The fifth lab had an additional LabDC4 DC.  In all five labs, LabDC1 holds all five FSMO roles.</p>
<p><strong>Note:</strong> FSMO – Flexible Single-Master Operations, see <a title="Managing Flexible Single-Master Operations" href="http://technet.microsoft.com/en-us/library/cc961936.aspx" target="_blank" rel="noopener">http://technet.microsoft.com/en-us/library/cc961936.aspx</a></p>
<p>The following domains were created:</p>
<ul>
<li>2012 with Forest Functional Level (FFL) and Domain Function Level (DFL) set to 2012.</li>
<li>2008 R2 with FFL and DFL of 2008 R2.</li>
<li>2008 with FFL and DFL of 2008.</li>
<li>2003 R2 with FFL and DFL of  2003.</li>
<li>Mixed with a 2003 DC, 2008 DC, 2008 R2 DC, and a 2012 DC.  FFL and DFL were set to 2003.</li>
</ul>
<p>All servers in all labs had all Windows Updates as of 05-AUG-2013.</p>
<p>Because I knew that LabDC1 was going to go through several demotion and promotions for this article, all DCs have the following set for their DNS IP settings:</p>
<ul>
<li>Primary:               LabDC2</li>
<li>Secondary:         LabDC3</li>
<li>Tertiary:               Loopback</li>
</ul>
<h2>Windows Server 2012</h2>
<p>How do you find which domain controller has which FSMO role?  From a PowerShell session or Windows Command Prompt, run the following command as shown in Figure 1:</p>
<pre class="brush: bash; title: ; notranslate">
netdom query fsmo
</pre>
<figure id="attachment_32384" aria-describedby="caption-attachment-32384" style="width: 568px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32384 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01.png" alt="Figure 1" width="568" height="188" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01.png 568w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure01-530x175.png 530w" sizes="auto, (max-width: 568px) 100vw, 568px" /></a><figcaption id="caption-attachment-32384" class="wp-caption-text">Figure 1</figcaption></figure>
<p>Since LabDC1 holds all five FSMO roles, what happens when it is demoted?</p>
<p>From a PowerShell session on LabDC1, run the following command:</p>
<pre class="brush: powershell; title: ; notranslate">
Uninstall-ADDSDomainController -DemoteOperationMasterRole:$true -Force:$true
</pre>
<p><b>Note: </b>The <i>DemoteOperationMasterRole:$true</i> indicates that forced demotion should continue even if an operations master role is discovered on the domain controller from which AD DS is being removed.</p>
<p>Enter and confirm the password for the Local Administrator account and the demotion process runs as shown in Figure 2.</p>
<figure id="attachment_32385" aria-describedby="caption-attachment-32385" style="width: 876px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32385 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1.png" alt="Figure 2" width="876" height="263" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1.png 876w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1-530x159.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1-768x231.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure02-1-600x180.png 600w" sizes="auto, (max-width: 876px) 100vw, 876px" /></a><figcaption id="caption-attachment-32385" class="wp-caption-text">Figure 2</figcaption></figure>
<p>Once the demoted domain controller restarts (or from one of the remaining DCs), from a PowerShell session or Windows Command Prompt, rerun the <b>netdom query fsmo</b> command as shown in Figure 3.</p>
<figure id="attachment_32386" aria-describedby="caption-attachment-32386" style="width: 570px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32386 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03.png" alt="Figure 3" width="570" height="189" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03.png 570w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure03-530x176.png 530w" sizes="auto, (max-width: 570px) 100vw, 570px" /></a><figcaption id="caption-attachment-32386" class="wp-caption-text">Figure 3</figcaption></figure>
<h2>Windows Server 2008 R2</h2>
<p>How do you find which domain controller has which FSMO role?  From a PowerShell session or Windows Command Prompt, run the following command as shown in Figure 4:</p>
<pre class="brush: bash; title: ; notranslate">
netdom query fsmo
</pre>
<figure id="attachment_32387" aria-describedby="caption-attachment-32387" style="width: 426px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32387 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure04.png" alt="Figure 4" width="426" height="141" /></a><figcaption id="caption-attachment-32387" class="wp-caption-text">Figure 4</figcaption></figure>
<p>Since LabDC1 holds all five FSMO roles, what happens when it is demoted?</p>
<p>Click <i>Start, Run</i> type in <i>dcpromo,</i> and press <i>Enter</i> (Figure 5).</p>
<figure id="attachment_32388" aria-describedby="caption-attachment-32388" style="width: 418px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32388 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure05.png" alt="Figure 5" width="418" height="266" /></a><figcaption id="caption-attachment-32388" class="wp-caption-text">Figure 5</figcaption></figure>
<p>Proceed through the <i>Active Directory Domain Services Installation Wizard</i> and click <i>Next</i> (Figure 6).</p>
<figure id="attachment_32389" aria-describedby="caption-attachment-32389" style="width: 503px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32389 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06.png" alt="Figure 6" width="503" height="476" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06.png 503w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure06-317x300.png 317w" sizes="auto, (max-width: 503px) 100vw, 503px" /></a><figcaption id="caption-attachment-32389" class="wp-caption-text">Figure 6</figcaption></figure>
<p>Once the demoted domain controller restarts (or from one of the remaining DCs), from a PowerShell session or Windows Command Prompt, rerun the <b>netdom query fsmo</b> command as shown in Figure 7.</p>
<figure id="attachment_32390" aria-describedby="caption-attachment-32390" style="width: 426px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07.png"><img loading="lazy" decoding="async" class="size-full wp-image-32390" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure07.png" alt="Figure 7" width="426" height="147" /></a><figcaption id="caption-attachment-32390" class="wp-caption-text">Figure 7</figcaption></figure>
<h2>Windows Server 2008</h2>
<p>How do you find which domain controller has which FSMO role?  From a Windows Command Prompt, run the following command as shown in Figure 8:</p>
<pre class="brush: bash; title: ; notranslate">
netdom query fsmo
</pre>
<figure id="attachment_32391" aria-describedby="caption-attachment-32391" style="width: 528px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32391 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure08.png" alt="Figure 8" width="528" height="194" /></a><figcaption id="caption-attachment-32391" class="wp-caption-text">Figure 8</figcaption></figure>
<p>Since LabDC1 holds all five FSMO roles, what happens when it is demoted?</p>
<p>Click <i>Start, Run</i> type in <i>dcpromo,</i> and press <i>Enter</i> (Figure 9).</p>
<figure id="attachment_32392" aria-describedby="caption-attachment-32392" style="width: 416px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32392 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure09.png" alt="Figure 9" width="416" height="254" /></a><figcaption id="caption-attachment-32392" class="wp-caption-text">Figure 9</figcaption></figure>
<p>Proceed through the <i>Active Directory Domain Services Installation Wizard</i> and click <i>Next</i> (Figure 10).</p>
<figure id="attachment_32393" aria-describedby="caption-attachment-32393" style="width: 503px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32393 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10.png" alt="Figure 10" width="503" height="476" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10.png 503w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure10-317x300.png 317w" sizes="auto, (max-width: 503px) 100vw, 503px" /></a><figcaption id="caption-attachment-32393" class="wp-caption-text">Figure 10</figcaption></figure>
<p>Once the demoted domain controller restarts (or from one of the remaining DCs), from a Windows Command Prompt, rerun the <b>netdom query fsmo</b> command as shown in Figure 11.</p>
<figure id="attachment_32394" aria-describedby="caption-attachment-32394" style="width: 520px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32394 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure11.png" alt="Figure 11" width="520" height="198" /></a><figcaption id="caption-attachment-32394" class="wp-caption-text">Figure 11</figcaption></figure>
<h2>Windows Server 2003 R2</h2>
<p>How do you find which domain controller has which FSMO role?  First, the <a title="Windows Server 2003 Service Pack 2 32-bit Support Tools" href="http://www.microsoft.com/en-us/download/details.aspx?id=15326" target="_blank" rel="noopener">Windows Support Tools</a> must be installed.  Then from a Windows Command Prompt, run the following command as shown in Figure 12:</p>
<pre class="brush: bash; title: ; notranslate">
netdom query fsmo
</pre>
<figure id="attachment_32395" aria-describedby="caption-attachment-32395" style="width: 470px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure12.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32395 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure12.png" alt="Figure 12" width="470" height="252" /></a><figcaption id="caption-attachment-32395" class="wp-caption-text">Figure 12</figcaption></figure>
<p>Since LabDC1 holds all five FSMO roles, what happens when it is demoted?</p>
<p>Click <i>Start, Run</i> type in <i>dcpromo,</i> and press <i>Enter</i> (Figure 13).</p>
<figure id="attachment_32396" aria-describedby="caption-attachment-32396" style="width: 350px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure13.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32396 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure13.png" alt="Figure 13" width="350" height="208" /></a><figcaption id="caption-attachment-32396" class="wp-caption-text">Figure 13</figcaption></figure>
<p>Proceed through the <i>Active Directory Installation Wizard</i> and click <i>Next</i> (Figure 14).</p>
<figure id="attachment_32397" aria-describedby="caption-attachment-32397" style="width: 503px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure14.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32397 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure14.png" alt="Figure 14" width="503" height="385" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure14.png 503w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure14-392x300.png 392w" sizes="auto, (max-width: 503px) 100vw, 503px" /></a><figcaption id="caption-attachment-32397" class="wp-caption-text">Figure 14</figcaption></figure>
<p>Once the demoted domain controller restarts (or from one of the remaining DCs), from a Windows Command Prompt, rerun the <b>netdom query fsmo</b> command as shown in Figure 15.</p>
<figure id="attachment_32398" aria-describedby="caption-attachment-32398" style="width: 490px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure15.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32398 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure15.png" alt="Figure 15" width="490" height="254" /></a><figcaption id="caption-attachment-32398" class="wp-caption-text">Figure 15</figcaption></figure>
<h2>One More Just for the Heck of it</h2>
<p>Just out of my own curiosity, I wanted to see what would happen in a mixed environment with four different Windows Server operating systems with each set as a domain controller.</p>
<p>LabDC1 running Windows Server 2003 R2 was installed first and the DFL and FFL were upgraded to Windows Server 2003.  Because LabDC1 was installed first, it is the Forest Root domain controller and holds all five FSMO roles as shown in the screen capture from LabDC4 (Figure 16).</p>
<figure id="attachment_32399" aria-describedby="caption-attachment-32399" style="width: 563px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure16.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32399 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure16.png" alt="Figure 16" width="563" height="197" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure16.png 563w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure16-530x185.png 530w" sizes="auto, (max-width: 563px) 100vw, 563px" /></a><figcaption id="caption-attachment-32399" class="wp-caption-text">Figure 16</figcaption></figure>
<p>The remaining domain controllers were installed in the following order:</p>
<ul>
<li>LabDC2 (Windows Server 2008)</li>
<li>LabDC3 (Windows Server 2008 R2)</li>
<li>LabDC4 (Windows Server 2012)</li>
</ul>
<p>Since LabDC1 holds all five FSMO roles, what happens when it is demoted?</p>
<p>Click <i>Start, Run</i> type in <i>dcpromo,</i> and press <i>Enter</i> (Figure 17).</p>
<figure id="attachment_32400" aria-describedby="caption-attachment-32400" style="width: 350px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure17.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32400 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure17.png" alt="Figure 17" width="350" height="208" /></a><figcaption id="caption-attachment-32400" class="wp-caption-text">Figure 17</figcaption></figure>
<p>Proceed through the <i>Active Directory Installation Wizard</i> and click <i>Next</i> (Figure 18).</p>
<figure id="attachment_32401" aria-describedby="caption-attachment-32401" style="width: 503px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure18.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32401 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure18.png" alt="Figure 18" width="503" height="385" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure18.png 503w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure18-392x300.png 392w" sizes="auto, (max-width: 503px) 100vw, 503px" /></a><figcaption id="caption-attachment-32401" class="wp-caption-text">Figure 18</figcaption></figure>
<p>Once the demoted domain controller restarts (or from one of the remaining DCs), from a Windows Command Prompt, rerun the <b>netdom query fsmo</b> command as shown in Figure 19.</p>
<figure id="attachment_32402" aria-describedby="caption-attachment-32402" style="width: 580px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure19.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-32402 size-full" src="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure19.png" alt="Figure 19" width="580" height="190" srcset="https://www.carlwebster.com/wp-content/uploads/2013/08/Figure19.png 580w, https://www.carlwebster.com/wp-content/uploads/2013/08/Figure19-530x174.png 530w" sizes="auto, (max-width: 580px) 100vw, 580px" /></a><figcaption id="caption-attachment-32402" class="wp-caption-text">Figure 19</figcaption></figure>
<p>I was hoping the FSMO roles would wind up on LabDC4 since it is the most current Windows Server version.</p>
<h2>Conclusion</h2>
<p>There are a few points I want to make.</p>
<ol>
<li>If all your DCs and your Active Directory (AD) are healthy, a demotion of a DC that holds any or all FSMO roles <b><i><span style="text-decoration: underline;">should</span></i></b> automatically transfer the FSMO roles to another DC.</li>
<li>You have NO control over which DC receives the FSMO role or roles held by the demoted DC.</li>
<li>If the demoted DC was running AD-Integrated DNS and any computers were pointing to it for DNS, those computers need to be reconfigured to point to another DNS server.</li>
<li><b>It is really best to transfer any FSMO roles before demoting a DC.</b></li>
</ol>
<p>What happens if there are issues with one or more DCs and or there are issues with AD?  The following error message is returned during the demotion process:</p>
<p>“The directory service is missing mandatory configuration information, and is unable to determine the ownership of floating single-master operation roles.”</p>
<p>If you receive this error message, Philip Elder SBS MVP has an article with several links to help get the underlying issue resolved.  Please see <a title="AD DS Operation Failed – directory service is missing mandatory configuration – Event ID 2091 – FSMO Role Broken" href="http://blog.mpecsinc.ca/2011/03/ad-ds-operation-failed-directory.html" target="_blank" rel="noopener">AD DS Operation Failed – directory service is missing mandatory configuration – Event ID 2091 – FSMO Role Broken</a>.</p>
<p>I know my labs were very simple and it is rare to find a very simple AD environment or one that is perfectly healthy so it is possible there may be issues involved in the process.  My point in spending 25 hours building all these labs and writing this article is to prove that an automatic transfer of FSMO roles works all the way back to Windows Server 2003 and if AD is healthy, the process just works.</p>
<p>My answer to the person who asked the question at Briforum was that <b><i>if</i></b> everything works as it <b><i>should</i></b> when a DC is demoted any FSMO roles it held <b><i>should</i></b> be transferred to another DC.</p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/what-happens-to-the-fsmo-roles-when-the-domain-controller-that-holds-them-is-demoted/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6018</post-id>	</item>
		<item>
		<title>Provisioning Services 7 and Server 2012 Group Managed Service Account</title>
		<link>https://www.carlwebster.com/provisioning-services-7-and-server-2012-group-managed-service-account/</link>
					<comments>https://www.carlwebster.com/provisioning-services-7-and-server-2012-group-managed-service-account/#comments</comments>
		
		<dc:creator><![CDATA[Carl Webster]]></dc:creator>
		<pubDate>Sat, 29 Jun 2013 22:39:53 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PVS]]></category>
		<category><![CDATA[Server 2012]]></category>
		<category><![CDATA[gMSA]]></category>
		<category><![CDATA[group managed service account]]></category>
		<category><![CDATA[provisioning services 7]]></category>
		<category><![CDATA[pvs7]]></category>
		<category><![CDATA[server 2012]]></category>
		<guid isPermaLink="false">https://www.carlwebster.com/?p=5830</guid>

					<description><![CDATA[Citrix released Provisioning Services version 7 (PVS7) with support for running on Microsoft Windows Server 2012.  Server 2012 has a really nice new feature called Group Managed Service  Accounts (gMSA). &#8230;]]></description>
										<content:encoded><![CDATA[<p>Citrix released Provisioning Services version 7 (PVS7) with support for running on Microsoft Windows Server 2012.  Server 2012 has a really nice new feature called Group Managed Service  Accounts (gMSA).  Even though Citrix had to test installing PVS7 on Server 2012, I found that Citrix never tested using gMSA for the Stream or SOAP services.  This article is my attempt to see if PVS7 will allow a gMSA for the Stream and SOAP services.</p>
<p><span id="more-5830"></span></p>
<p>I have absolutely no idea if PVS7 running on Server 2012 will work with a gMSA or not.  Citrix says it <i>should</i> work, but the articles I have read from Microsoft make it seem like the application must be written to support and work with gMSA.  You will find out at the same time I do whether this experiment will work.</p>
<p>To get more information on gMSA, please read <a title="Windows Server 2012: Group Managed Service Accounts" href="http://blogs.technet.com/b/askpfeplat/archive/2012/12/17/windows-server-2012-group-managed-service-accounts.aspx" target="_blank" rel="noopener">this TechNet article</a>.</p>
<p>There are three requirements to use a gMSA:</p>
<ol>
<li>At least one Windows Server 2012 Domain Controller.</li>
<li>A Windows Server 2012 or Windows 8 computer with the ActiveDirectory PowerShell module to create/manage the gMSA.</li>
<li>A Windows Server 2012 or Windows 8 domain member to run/use the gMSA.</li>
</ol>
<p>I installed a Server 2012 Domain Controller into my lab environment, using it to create and manage the gMSA.</p>
<p><b>Step 1: Create the Key Distribution Services (KDS) Root Key</b></p>
<p>The KDS Root Key is used by the KDS service on the domain controller to generate passwords.  On my Server 2012 Domain Controller, I will run from an elevated PowerShell session:</p>
<p>Add-KDSRootKey –EffectiveImmediately</p>
<figure id="attachment_49462" aria-describedby="caption-attachment-49462" style="width: 597px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure001.png"><img loading="lazy" decoding="async" class="size-full wp-image-49462" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure001.png" alt="Figure 1" width="597" height="252" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure001.png 597w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure001-530x224.png 530w" sizes="auto, (max-width: 597px) 100vw, 597px" /></a><figcaption id="caption-attachment-49462" class="wp-caption-text">Figure 1</figcaption></figure>
<p>The TechNet article says the key can take up to 10 hours to replicate and take effect.  Since I only have one Server 2012 domain controller and two domain controllers in my lab, I am not worried about the replication time.  By the way, it took almost one hour in my lab before the key was usable!</p>
<p><b>Step 2: Create and configure the gMSA</b></p>
<p>I am going to create a Security Group containing my two PVS7 servers.  This security group will contain the computer accounts allowed to use the gMSA.</p>
<figure id="attachment_49464" aria-describedby="caption-attachment-49464" style="width: 451px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure002.png"><img loading="lazy" decoding="async" class="size-full wp-image-49464" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure002.png" alt="Figure 2" width="451" height="385" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure002.png 451w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure002-351x300.png 351w" sizes="auto, (max-width: 451px) 100vw, 451px" /></a><figcaption id="caption-attachment-49464" class="wp-caption-text">Figure 2</figcaption></figure>
<figure id="attachment_49465" aria-describedby="caption-attachment-49465" style="width: 471px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure003.png"><img loading="lazy" decoding="async" class="size-full wp-image-49465" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure003.png" alt="Figure 3" width="471" height="258" /></a><figcaption id="caption-attachment-49465" class="wp-caption-text">Figure 3</figcaption></figure>
<figure id="attachment_49466" aria-describedby="caption-attachment-49466" style="width: 414px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure004.png"><img loading="lazy" decoding="async" class="size-full wp-image-49466" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure004.png" alt="Figure 4" width="414" height="462" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure004.png 414w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure004-269x300.png 269w" sizes="auto, (max-width: 414px) 100vw, 414px" /></a><figcaption id="caption-attachment-49466" class="wp-caption-text">Figure 4</figcaption></figure>
<p>&nbsp;</p>
<p>Next, my two PVS7 servers need to be restarted to know they were added to the security group.</p>
<p>From the elevated PowerShell session on my Server 2012 domain controller, I run:</p>
<p>New-ADServiceAccount –Name PVS7StreamSOAP –DNSHostName PVS7StreamSOAP.websterslab.com –PrincipalsAllowedToRetrieveManagedPassword “PVS7gMSAGroup”</p>
<p><b>Note:</b> The <i>Name</i> is a NetBIOS name that must not be more than 15 characters.</p>
<figure id="attachment_49467" aria-describedby="caption-attachment-49467" style="width: 877px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005.png"><img loading="lazy" decoding="async" class="size-full wp-image-49467" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005.png" alt="Figure 5" width="877" height="139" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005.png 877w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005-530x84.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005-768x122.png 768w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure005-600x95.png 600w" sizes="auto, (max-width: 877px) 100vw, 877px" /></a><figcaption id="caption-attachment-49467" class="wp-caption-text">Figure 5</figcaption></figure>
<p>The gMSA now appears in the <i>Managed Service Accounts</i> OU in Active Directory Users and Computers.</p>
<figure id="attachment_49468" aria-describedby="caption-attachment-49468" style="width: 730px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure006-1.png"><img loading="lazy" decoding="async" class="size-full wp-image-49468" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure006-1.png" alt="Figure 6" width="730" height="276" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure006-1.png 730w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure006-1-530x200.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure006-1-600x227.png 600w" sizes="auto, (max-width: 730px) 100vw, 730px" /></a><figcaption id="caption-attachment-49468" class="wp-caption-text">Figure 6</figcaption></figure>
<p><b>Step3: Configure the gMSA on the PVS7 host</b></p>
<p><b>Note:</b> The following requires the <i>Active Directory module for Windows PowerShell</i> to be installed on the PVS7 host.  It can be uninstalled after the test is successful.</p>
<p>From an elevated PowerShell session on the PVS7 server, I will run the following two cmdlets:</p>
<pre class="brush: powershell; title: ; notranslate">

Install-AdServiceAccount PVS7StreamSOAP

Test-AdServiceAccount PVS7StreamSOAP

</pre>
<figure id="attachment_49469" aria-describedby="caption-attachment-49469" style="width: 604px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure007.png"><img loading="lazy" decoding="async" class="size-full wp-image-49469" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure007.png" alt="Figure 7" width="604" height="168" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure007.png 604w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure007-530x147.png 530w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure007-600x167.png 600w" sizes="auto, (max-width: 604px) 100vw, 604px" /></a><figcaption id="caption-attachment-49469" class="wp-caption-text">Figure 7</figcaption></figure>
<p>The Test-AdServiceAccount should return True.  If it returns False, a verbose error message should be included.</p>
<p>Now for the time of truth.  Is this going to work in PVS7 or not.  Start the Provisioning Services Configuration Wizard and go to the <i>User account</i> screen.  The TechNet article says the trick is to use a “$” after the gMSA and leave the password blank.</p>
<figure id="attachment_49470" aria-describedby="caption-attachment-49470" style="width: 513px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure008.png"><img loading="lazy" decoding="async" class="size-full wp-image-49470" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure008.png" alt="Figure 8" width="513" height="399" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure008.png 513w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure008-386x300.png 386w" sizes="auto, (max-width: 513px) 100vw, 513px" /></a><figcaption id="caption-attachment-49470" class="wp-caption-text">Figure 8</figcaption></figure>
<p>Let’s see what happens when I click <i>Next</i>?????</p>
<p>What do you know, it let me continue, but we are not done yet.</p>
<figure id="attachment_49471" aria-describedby="caption-attachment-49471" style="width: 513px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure009.png"><img loading="lazy" decoding="async" class="size-full wp-image-49471" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure009.png" alt="Figure 9" width="513" height="399" srcset="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure009.png 513w, https://www.carlwebster.com/wp-content/uploads/2013/06/Figure009-386x300.png 386w" sizes="auto, (max-width: 513px) 100vw, 513px" /></a><figcaption id="caption-attachment-49471" class="wp-caption-text">Figure 9</figcaption></figure>
<p>DOH!!!  I guess PVS7 will NOT work with Server 2012’s Group Managed service Accounts after all!  Total Bummer.</p>
<figure id="attachment_49472" aria-describedby="caption-attachment-49472" style="width: 496px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure010.png"><img loading="lazy" decoding="async" class="size-full wp-image-49472" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure010.png" alt="Figure 10" width="496" height="185" /></a><figcaption id="caption-attachment-49472" class="wp-caption-text">Figure 10</figcaption></figure>
<figure id="attachment_49473" aria-describedby="caption-attachment-49473" style="width: 496px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure011.png"><img loading="lazy" decoding="async" class="size-full wp-image-49473" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure011.png" alt="Figure 11" width="496" height="185" /></a><figcaption id="caption-attachment-49473" class="wp-caption-text">Figure 11</figcaption></figure>
<figure id="attachment_49474" aria-describedby="caption-attachment-49474" style="width: 496px" class="wp-caption alignnone"><a href="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure012.png"><img loading="lazy" decoding="async" class="size-full wp-image-49474" src="https://www.carlwebster.com/wp-content/uploads/2013/06/Figure012.png" alt="Figure 12" width="496" height="185" /></a><figcaption id="caption-attachment-49474" class="wp-caption-text">Figure 12</figcaption></figure>
<p>Citrix should fix this pronto.  Actually, this should have been in PVS7 from the initial design for Server 2012 support.  gMSA offers several features that would be very useful in a PVS implementation.  Too bad Citrix doesn’t support gMSA at this time.  I hope this gets fixed fast.</p>
<p>Thanks</p>
<p>Webster</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.carlwebster.com/provisioning-services-7-and-server-2012-group-managed-service-account/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5830</post-id>	</item>
	</channel>
</rss>
