<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ldap389</title>
	
	<link>http://www.ldap389.info/en/</link>
	<description>Active Directory Blog</description>
	<lastBuildDate>Thu, 26 Jan 2012 11:37:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Ldap389" /><feedburner:info uri="ldap389" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Windows 8: Install and configure ADCS</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/hVwb2bL6ld0/</link>
		<comments>http://www.ldap389.info/en/2012/01/26/windows-8-install-configure-adcs-pki-powershell/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 11:36:10 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[Public Key Infrastructure @en]]></category>
		<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[pki @en]]></category>
		<category><![CDATA[PowerShell @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1703</guid>
		<description><![CDATA[We will describe in this post how to install ADCS on Windows 8 Developer Preview, and how to configure your PKI with Powershell. Firstly we will install the ADCS role with Server Manager: Select &#8220;Role-based installation or Feature-based installation&#8221; and click next. We now need to select the server on which you will install the [...]]]></description>
			<content:encoded><![CDATA[<p>We will describe in this post how to install ADCS on <em>Windows 8 Developer Preview</em>, and how to configure your PKI with Powershell.</p>
<p>Firstly we will install the ADCS role with <em>Server Manager</em>:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca1.jpg" rel="lightbox[1703]"><img class="aligncenter size-medium wp-image-1681" title="install-ca1" src="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca1-300x155.jpg" alt="" width="300" height="155" /></a><br />
<span id="more-1703"></span><br />
Select &#8220;<em>Role-based installation or Feature-based installation</em>&#8221; and click next. We now need to select the server on which you will install the role, under Windows 8 you can manage a <a href="http://www.windowsitpro.com/article/windowsserver8/server-management-windows-server-8-140938">remote server</a> <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca3.jpg" rel="lightbox[1703]"><img class="aligncenter size-medium wp-image-1682" title="install-ca3" src="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca3-300x166.jpg" alt="" width="300" height="166" /></a></p>
<p>Choose the <em>Active Directory Certificate Services</em> role:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca4.jpg" rel="lightbox[1703]"><img class="aligncenter size-medium wp-image-1683" title="install-ca4" src="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca4-300x130.jpg" alt="" width="300" height="130" /></a></p>
<p>Skip the <em>Features</em> screen, then under the <em>role services</em> screen, select only <em>Certification Authority</em>:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca5.jpg" rel="lightbox[1703]"><img class="aligncenter size-medium wp-image-1684" title="install-ca5" src="http://www.ldap389.info/wp-content/uploads/2012/01/install-ca5-300x139.jpg" alt="" width="300" height="139" /></a></p>
<p>On the next screen we start the role installation. Once it is done, open a Powershell session on the server on which the role is installed and launch the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>Module –ListAvailable</pre></div></div>

<p>We notice that a new module called <em>CertificateServicesCmdlets</em> shows up. We can list the cmdlets available in that module with the command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>get<span style="color: pink;">-</span>module CertificateServicesCmdlets<span style="color: #000000;">&#41;</span>.exportedcommands</pre></div></div>

<p>Here are the cmdlets:</p>
<blockquote><p>Get-AdcsCertificationAuthorityConfigurationDefaults<br />
Get-AdcsConfigurationState<br />
Get-AdcsEnrollmentPolicyWebServiceConfigurationDefaults<br />
Get-AdcsEnrollmentWebServiceConfigurationDefaults<br />
Get-AdcsNetworkDeviceEnrollmentConfigurationDefaults<br />
Get-SSLCertificates<br />
Import-AdcsCertificationAuthorityCACertificatePfx<br />
Install-AdcsCertificationAuthority<br />
Install-AdcsEnrollmentPolicyWebService<br />
Install-AdcsEnrollmentWebService<br />
Install-AdcsNetworkDeviceEnrollmentService<br />
Install-AdcsOnlineResponder<br />
Install-AdcsWebEnrollment<br />
Uninstall-AdcsCertificationAuthority<br />
Uninstall-AdcsEnrollmentPolicyWebService<br />
Uninstall-AdcsEnrollmentWebService<br />
Uninstall-AdcsNetworkDeviceEnrollmentService<br />
Uninstall-AdcsOnlineResponder<br />
Uninstall-AdcsWebEnrollment</p></blockquote>
<p>We will use the <em>Install-AdcsCertificationAuthority</em> in order to configure our Enterprise rootCA server. The script <a href="http://blogs.technet.com/b/pki/archive/2009/09/18/automated-ca-installs-using-vb-script-on-windows-server-2008-and-2008r2.aspx">setupCA.vbs</a> inspired us to launch the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Install<span style="color: pink;">-</span>AdcsCertificationAuthority <span style="color: pink;">-</span>CAType EnterpriseRootCA <span style="color: pink;">-</span>CACommonName LDAP389<span style="color: pink;">-</span>CA <span style="color: pink;">-</span>KeyLength <span style="color: #804000;">4096</span> <span style="color: pink;">-</span>HashAlgorithmName SHA256 <span style="color: pink;">-</span>CryptoProviderName <span style="color: #800000;">&quot;RSA#Microsoft Software Key Storage Provider&quot;</span></pre></div></div>

<p>Here we go, the Enterprise rootCA server is ready to use. We launch the <em>Certification Authority</em> console in order to check that the configuration matches the parameters we set up with Powershell:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/ca-certificate.jpg" rel="lightbox[1703]"><img class="aligncenter size-medium wp-image-1686" title="ca-certificate" src="http://www.ldap389.info/wp-content/uploads/2012/01/ca-certificate-300x212.jpg" alt="" width="300" height="212" /></a></p>
<p>Under Windows 8 you can configure your PKI with Powershell, but maybe not yet get rid of the excellent <a href="http://en-us.sysadmins.lv/Lists/Posts/Post.aspx?ID=58">PS PKI module</a> developed by the Powershell Crypto Guy, time will tell&#8230;</p>
<p><strong>N.B.:</strong> As it is a <em>Developer Preview</em> the cmdlets and installation procedure might change in the future.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Windows+8%3A+Install+and+configure+ADCS+http%3A%2F%2Fis.gd%2Fn9ZIdm" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/hVwb2bL6ld0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2012/01/26/windows-8-install-configure-adcs-pki-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2012/01/26/windows-8-install-configure-adcs-pki-powershell/</feedburner:origLink></item>
		<item>
		<title>Windows 8: Manage Active Directory replication topology with powershell</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/aEovNG3CTns/</link>
		<comments>http://www.ldap389.info/en/2012/01/11/windows-8-manage-active-directory-replication-topology-with-powershell/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 10:54:58 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[PowerShell @en]]></category>
		<category><![CDATA[repadmin @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1668</guid>
		<description><![CDATA[I finally managed to free some time to install my first Windows 8 Developer Preview domain controllers in a test lab (thanks Vmdude). In this ldap389.local domain I installed two RWDCs named ldap389-pdce and ldap389-dc2, each one located in their own AD site. For the DC&#8217;s promotion you can read this two part post (here [...]]]></description>
			<content:encoded><![CDATA[<p>I finally managed to free some time to install my first <em>Windows 8 Developer Preview </em>domain controllers in a test lab (thanks <a href="http://www.vmdude.fr/">Vmdude</a>). In this <em>ldap389.local</em> domain I installed two RWDCs named <em>ldap389-pdce</em> and <em>ldap389-dc2</em>, each one located in their own AD site. For the DC&#8217;s promotion you can read this two part post (<a href="http://jorgequestforknowledge.wordpress.com/2011/11/04/installing-and-uninstalling-ad-on-windows-server-8-as-an-rwdc-and-as-an-rodc-part-1/">here</a> and <a href="http://jorgequestforknowledge.wordpress.com/2011/11/04/installing-and-uninstalling-ad-on-windows-server-8-as-an-rwdc-and-as-an-rodc-part-2/">here</a>)</p>
<p>Once installation was completed, I launched the following Powershell command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#40;</span>get<span style="color: pink;">-</span>module ActiveDirectory<span style="color: #000000;">&#41;</span>.exportedcommands</pre></div></div>

<p><span id="more-1668"></span></p>
<p>In order to list all the Cmdlets available for the Active Directory module. We notice, among others, new Cmdlets for managing Active Directory replication topology:</p>
<blockquote><p>Get-ADReplicationAttributeMetadata</p>
<p>Get-ADReplicationConnection</p>
<p>Get-ADReplicationFailure</p>
<p>Get-ADReplicationPartnerMetadata</p>
<p>Get-ADReplicationQueueOperation</p>
<p>Get-ADReplicationSite</p>
<p>Get-ADReplicationSiteLink</p>
<p>Get-ADReplicationSiteLinkBridge</p>
<p>Get-ADReplicationSubnet</p>
<p>Get-ADReplicationUpToDatenessVectorTable</p>
<p>New-ADReplicationSite</p>
<p>New-ADReplicationSiteLink</p>
<p>New-ADReplicationSiteLinkBridge</p>
<p>New-ADReplicationSubnet</p>
<p>Remove-ADReplicationSite</p>
<p>Remove-ADReplicationSiteLink</p>
<p>Remove-ADReplicationSiteLinkBridge</p>
<p>Remove-ADReplicationSubnet</p>
<p>Set-ADReplicationConnection</p>
<p>Set-ADReplicationSite</p>
<p>Set-ADReplicationSiteLink</p>
<p>Set-ADReplicationSiteLinkBridge</p>
<p>Set-ADReplicationSubnet</p></blockquote>
<p>The <em>ldap389.local</em> domain replication topology is as follows:</p>
<p><img class="aligncenter size-medium wp-image-1649" title="toplogy-windows8" src="http://www.ldap389.info/wp-content/uploads/2012/01/toplogy-windows8-300x195.jpg" alt="" width="300" height="195" /></p>
<p>Firstly we will list the Active Directory sites with the command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>ADReplicationSite <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #000000;">&#123;</span>cn <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*&quot;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationsite2.jpg" rel="lightbox[1668]"><img class="aligncenter size-medium wp-image-1650" title="get-adreplicationsite" src="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationsite2-300x189.jpg" alt="" width="300" height="189" /></a><br />
There are two sites in the domain: <em>HQ-LDAP389</em> and <em>BRANCH-LDAP389</em>. We also retrieve the <a href="http://support.microsoft.com/kb/224815">ISTG</a> of each site.</p>
<p>Secondly we list the Active Directory site links using the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>ADReplicationSiteLink <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #000000;">&#123;</span>cn <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*&quot;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationsitelink1.jpg" rel="lightbox[1668]"><img class="aligncenter size-medium wp-image-1651" title="get-adreplicationsitelink" src="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationsitelink1-300x91.jpg" alt="" width="300" height="91" /></a><br />
The only site link is the default one: <em>DEFAULTIPSITELINK</em>. It is configured to launch a replication every 15 minutes between both sites.</p>
<p>Finally we will list every Active Directory replication connection with the command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>ADReplicationConnection <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #000000;">&#123;</span>cn <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*&quot;</span><span style="color: #000000;">&#125;</span></pre></div></div>

<p><a href="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationconnection.jpg" rel="lightbox[1668]"><img class="aligncenter size-medium wp-image-1652" title="get-adreplicationconnection" src="http://www.ldap389.info/wp-content/uploads/2012/01/get-adreplicationconnection-300x289.jpg" alt="" width="300" height="289" /></a></p>
<p>There are two connections: The first one to replicate from <em>ldap389-pdce</em> to <em>ldap389-dc2</em>, the second one to replicate in the opposite direction.<br />
I want to reassure you: The <em><a href="http://technet.microsoft.com/en-us/library/cc755360(WS.10).aspx">repadmin</a></em> command is not deprecated under <em>Windows 8 Developer Preview</em>, unlike the <em><a href="http://www.jackcobben.nl/?p=1659">dcpromo</a></em> which is replaced by the <em>ADDSDeployment</em> Powershell module.</p>
<p><strong>N.B.:</strong> As it is a <em>Developer Preview</em> those cmdlets might change in the future. But this post shows you that you will be able to manage ADDS replication with Powershell <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Windows+8%3A+Manage+Active+Directory+replication+topology+with+powershell+http%3A%2F%2Fis.gd%2FUtVkuY" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/aEovNG3CTns" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2012/01/11/windows-8-manage-active-directory-replication-topology-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2012/01/11/windows-8-manage-active-directory-replication-topology-with-powershell/</feedburner:origLink></item>
		<item>
		<title>Powershell: Export firewall rules on your TMG servers</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/JakzKruYF7U/</link>
		<comments>http://www.ldap389.info/en/2012/01/04/powershell-export-firewall-rules-on-your-tmg-servers/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 16:44:10 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[PowerShell @en]]></category>
		<category><![CDATA[tmg @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1626</guid>
		<description><![CDATA[In order to manage TMG with powershell you need to use the FPC.root COM object. For more details you can read this article. The purpose of this script is to export for each TMG server the Firewall Policies in XML format: In order to perform a connection on each TMG server we invoke the ConnectToConfigurationStorageServer [...]]]></description>
			<content:encoded><![CDATA[<p>In order to manage TMG with powershell you need to use the <a href="http://msdn.microsoft.com/en-us/library/ms826706.aspx">FPC.root</a> COM object. For more details you can read <a href="http://www.isaserver.org/tutorials/Forefront-TMG-Scripting-with-VBScript-Powershell.html">this article</a>. The purpose of this script is to export for each TMG server the <em>Firewall Policies</em> in XML format: </p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/firewallpolicies1.jpg" rel="lightbox[1626]"><img class="aligncenter size-medium wp-image-1606" title="firewallpolicies" src="http://www.ldap389.info/wp-content/uploads/2011/12/firewallpolicies1-300x169.jpg" alt="" width="300" height="169" /></a><br />
<span id="more-1626"></span></p>
<p>In order to perform a connection on each TMG server we invoke the <em><a href="http://msdn.microsoft.com/en-us/library/ms826310.aspx">ConnectToConfigurationStorageServer</a></em> method. Then we use the <em><a href="http://msdn.microsoft.com/en-us/library/aa491800.aspx">FPCPolicyRules</a></em> collection in order to browse the different firewall rules. For each TMG server is displayed:</p>
<ul>
<li>The rule name.</li>
<li>Wether the rule is enabled.</li>
<li>Action: Allow traffic (0), deny traffic (1).</li>
</ul>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/scriptresult.jpg" rel="lightbox[1626]"><img class="aligncenter size-medium wp-image-1607" title="scriptresult" src="http://www.ldap389.info/wp-content/uploads/2011/12/scriptresult-300x93.jpg" alt="" width="300" height="93" /></a><br />
Each firewall rule is exported in the current directory in a file named %TMGSERRVERNAME%_%RULENAME%.xml. In order to export the configuration in XML format we invoke the <em><a href="http://msdn.microsoft.com/en-us/library/ms826700.aspx">FPC.ExportToFile</a></em> method:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$oFPC</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-comObject</span> FPC.root
<span style="color: #800080;">$cArrays</span> <span style="color: pink;">=</span> <span style="color: #800080;">$oFPC</span>.Arrays
<span style="color: #0000FF;">Foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$oArray</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$cArrays</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$policyrules</span> <span style="color: pink;">=</span> <span style="color: #800080;">$oArray</span>.ArrayPolicy.policyrules
    <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$policyrule</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$policyrules</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
        <span style="color: #800080;">$policyrule</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">select</span> name<span style="color: pink;">,</span>enabled<span style="color: pink;">,</span>action
        <span style="color: #800080;">$szOutFilePath</span> <span style="color: pink;">=</span> <span style="color: #800000;">'C:\'</span> <span style="color: pink;">+</span> <span style="color: #800080;">$policyrule</span>.name <span style="color: pink;">+</span> <span style="color: #800000;">'.xml'</span>
        <span style="color: #008000;">#See options for $iOptionalData at http://msdn.microsoft.com/en-us/library/aa490382.aspx</span>
        <span style="color: #800080;">$iOptionalData</span> <span style="color: pink;">=</span>  0x00000001 <span style="color: #FF0000;">-bor</span> 0x00000002 <span style="color: #FF0000;">-bor</span> 0x00000004 <span style="color: #FF0000;">-bor</span> 0x00000008
        <span style="color: #800080;">$szPassword</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;12345678&quot;</span>
        <span style="color: #800080;">$szComment</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span>
        <span style="color: #800080;">$policyrule</span>.ExportToFile<span style="color: #000000;">&#40;</span><span style="color: #800080;">$szOutFilePath</span><span style="color: pink;">,</span> <span style="color: #800080;">$iOptionalData</span><span style="color: pink;">,</span> <span style="color: #800080;">$szPassword</span><span style="color: pink;">,</span> <span style="color: #800080;">$szComment</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Just click on the link below to download the full script:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/export-fw-policy.txt"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>Change the following default values:</p>
<ul>
<li>$servers: TMG server names.</li>
<li>$iOptionalData: Export type (Radius data&#8230;) See <a href="http://msdn.microsoft.com/en-us/library/aa490382.aspx">this link</a> for more details.</li>
<li>$szPassword: Password used to encrypt confidential data (e.g. Radius data&#8230;)</li>
</ul>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Powershell%3A+Export+firewall+rules+on+your+TMG+servers+http%3A%2F%2Fis.gd%2FG2zUQW" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/JakzKruYF7U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2012/01/04/powershell-export-firewall-rules-on-your-tmg-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2012/01/04/powershell-export-firewall-rules-on-your-tmg-servers/</feedburner:origLink></item>
		<item>
		<title>OWA published with a TMG array member of a domain located in the DMZ</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/P3d6rWHYkK8/</link>
		<comments>http://www.ldap389.info/en/2011/12/19/owa-published-tmg-enterprise-array-member-domain-located-in-dmz-perimeter-network/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 12:57:06 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[Public Key Infrastructure @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Exchange @en]]></category>
		<category><![CDATA[pki @en]]></category>
		<category><![CDATA[rodc @en]]></category>
		<category><![CDATA[tmg @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1585</guid>
		<description><![CDATA[We will describe in this post how to set up Threat Management Gateway in a domain located in the perimeter network (DMZ) in order to publish your Outlook Web Access external URL and ensure a secure SSL connection. The OWA site is installed on the CAS servers of your Exchange infrastructure. The internal URL, registered [...]]]></description>
			<content:encoded><![CDATA[<p>We will describe in this post how to set up Threat Management Gateway in a domain located in the perimeter network (DMZ) in order to publish your Outlook Web Access external URL and ensure a secure SSL connection. The OWA site is installed on the CAS servers of your Exchange infrastructure. The internal URL, registered in your private DNS, is being accessed by the computers in your internal network which are members of your domain. The external URL, registered in your public DNS, is being accessed by any computer connected to the internet, which obviously is not necessarily a member of your domain. To get both internal and external URL launch the following command on the Exchange Management Shell:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">Get<span style="color: pink;">-</span>OwaVirtualDirectory <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">ft</span> server<span style="color: pink;">,</span>InternalURL<span style="color: pink;">,</span>externalURL</pre></div></div>

<p><span id="more-1585"></span><br />
In our example the internal URL is <em>mail.internal.ldap389.info</em>, the external URL is <em>mail.ldap389.info</em>. We want to ensure a secure SSL connection from the client to the OWA Website: To achieve that a SAN certificate issued by our enterprise PKI and including both URLs is installed on each member of the CAS array.</p>
<p>The network traffic of the computers located in your internal network, accessing the <em>mail.internal.ldap389.info</em> internal URL, is balanced across the CAS servers with a HLB device (represented by green arrows on the below diagram).</p>
<p>The clients connecting from the internet via the <em>mail.ldap389.info</em> internal URL first contact the TMG array, the traffic is balanced across the TMG server&#8217;s external NICs with a HLB device, those IPs are located in the public DMZ. The network traffic of the clients accessing your OWA from the internet is represented by red arrows on the below diagram and detailed in the next paragraphs:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/owa-tmg3.jpg" rel="lightbox[1585]"><img class="aligncenter size-medium wp-image-1577" title="owa-tmg" src="http://www.ldap389.info/wp-content/uploads/2011/12/owa-tmg3-229x300.jpg" alt="" width="229" height="300" /></a></p>
<p>I suggest you purchase a certificate from an external certificate authority and set it up on the TMG&#8217;s OWA web listener, by using this kind of certificate the computers which are not members of the <em>internal.ldap389.info</em> domain will perform an SSL connection with the TMG without any warning displayed on their web browser. If you use a certificate issued by your enterprise PKI, the certificate of the enterprise root CA will not be installed on the Trusted Root Certification Authorities store on the computers which are not members of your domain. For those computers you will get this kind of warning when connecting to the Outlook Web Access:</p>
<p>&nbsp;</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/certificate-not-trusted-internet-explorer2.jpg" rel="lightbox[1585]"><img class="aligncenter size-thumbnail wp-image-1602" title="certificate-not-trusted-internet-explorer" src="http://www.ldap389.info/wp-content/uploads/2011/12/certificate-not-trusted-internet-explorer2-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>Communication is also secured with SSL between the TMG&#8217;s internal NICs (located in the &#8220;private DMZ&#8221;) and the CAS servers. In order to perform a secure communication by using the SAN enterprise certificate installed on the CAS servers, you have to install the certificate of the enterprise root CA as a trusted root CA certificate on your TMG servers.</p>
<p>TMG presents an HTML Form in which the user enters a user name and password, which TMG can then authenticate against Active Directory over LDAP secure protocol. LDAPs connection is performed on a Windows 2008R2 Core <a href="http://blogs.technet.com/b/activedirectoryua/archive/2009/01/15/planning-and- deploying-rodcs.aspx">RODC</a> which is a member of your internal network domain (DNS name <em>rodc.internal.ldap389.info</em>). You can configure more than one RODC in the <em>LDAP Server Set</em> in order to provide redundancy. You <a href="http://technet.microsoft.com/en-us/library/cc730883(WS.10).aspx">can </a>cache credentials on the RODCs for users using the OWA from the internet, in that case you need to configure one <a href="http://technet.microsoft.com/fr-fr/library/cc730693(WS.10).aspx">AD site per RODC</a>. Your TMG OWA listener will be set up as below:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/12/tmg-rodc.jpg" rel="lightbox[1585]"><img class="aligncenter size-medium wp-image-1560" title="tmg-rodc" src="http://www.ldap389.info/wp-content/uploads/2011/12/tmg-rodc-300x113.jpg" alt="" width="300" height="113" /></a></p>
<p>In order to perform an LDAP over SSL connection with your internal RODC, the TMG must resolve the <em>rodc.internal.ldap389.info</em> name by using a host file. In the same host file, the <em>mail.ldap389.info</em> name points to the HLB which balances the traffic across the CAS servers (see <em>host file </em>on the diagram).</p>
<p>If you want to get all the benefits of a <a href="http://technet.microsoft.com/en-us/library/ee207137.aspx">TMG Enterprise</a> array, including the <a href="http://araihan.wordpress.com/2010/06/10/install-and-configure- forefront-tmg-2010-enterprise-management-server-ems-for-centralized-management-step-by-step/">EMS</a> replication, it needs to be member of a <a href="http://technet.microsoft.com/en-us/library/dd897048.aspx">domain</a> (<em>dmz.local</em>). I suggest you read this <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=3957">document</a> on how to set up a domain in a DMZ. In our case there is neither trust relationship nor DNS forwarders between the two domains <em>dmz.local</em> and <em>internal.ldap389.info</em> (that is why we use host files). We only allow SSL connections between the private DMZ network and the internal network.</p>
<p>Securing your <em>dmz.local</em> domain is very important because it is located close to the internet, here are a few leads on how to secure it: The domain controllers should be located in a dedicated subnet in your private DMZ. TMG servers only authenticate against Windows 2008R2 RODCs, they should only communicate with a RWDC on the <a href="http://technet.microsoft.com/en-us/library/cc754956(WS.10).aspx">DNS TCP 53</a> port, in order to allow DNS update (see <em>How does the client DNS update referral mechanism work?</em>). In order to join a TMG server through a RODC perform the steps described in this <a href="http://blogs.dirteam.com/blogs/jorge/archive/2009/01/02/domain-join-through-an-rodc-instead-of-an-rwdc.aspx">article</a>. You can also set up <a href="http://technet.microsoft.com/fr-fr/library/cc755310(WS.10).aspx">administrator role separation </a>on the RODCs and deny password caching for domain administrators. Finally, you can set up the <em><a href="http://support.microsoft.com/kb/172931/en-us">CachedLogonCounts</a></em> value to 0 on the TMG servers, but you will not able log on with a domain account if no domain controller is available. In that configuration your TMG array is member of a secured domain and you can enjoy all the features of the enterprise version.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=OWA+published+with+a+TMG+array+member+of+a+domain+located+in+the+DMZ+http%3A%2F%2Fis.gd%2Fr64cMu" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/P3d6rWHYkK8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/12/19/owa-published-tmg-enterprise-array-member-domain-located-in-dmz-perimeter-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/12/19/owa-published-tmg-enterprise-array-member-domain-located-in-dmz-perimeter-network/</feedburner:origLink></item>
		<item>
		<title>Powershell: Blackberry and Activesync mobile devices inventory</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/0BQDr0ku3As/</link>
		<comments>http://www.ldap389.info/en/2011/11/21/powershell-sql-ems-mobile-device-inventory-blackberry-activesync-exchange/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 17:10:52 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[tools @en]]></category>
		<category><![CDATA[ActiveSync @en]]></category>
		<category><![CDATA[Blackberry @en]]></category>
		<category><![CDATA[Exchange @en]]></category>
		<category><![CDATA[PowerShell @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1517</guid>
		<description><![CDATA[When you setup a corporate Exchange mail system users can access their mailbox on most mobile devices (iPhone, Android, Windows Phone&#8230;) through the ActiveSync protocol. For blackberry owners to access your mail system, you need to setup a BES infrastructure. The purpose of this Powershell script is to make an inventory of all the mobile [...]]]></description>
			<content:encoded><![CDATA[<p>When you setup a corporate Exchange mail system users can access their mailbox on most mobile devices (iPhone, Android, Windows Phone&#8230;) through the <a href="http://www.microsoft.com/about/legal/en/us/IntellectualProperty/IPLicensing/Programs/ExchangeActiveSyncProtocol.aspx">ActiveSync protocol</a>. For blackberry owners to access your mail system, you need to setup a <a href="http://us.blackberry.com/apps-software/server/exchange/">BES</a> infrastructure.<br />
<span id="more-1517"></span></p>
<p>The purpose of this Powershell script is to make an inventory of all the mobile devices accessing your Exchange mail system. First we will retrieve BlackBerry devices information by querying the BES SQL configuration database, then the other devices using the ActiveSync protocol by querying the Active Directory.   </p>
<p><span style="text-decoration: underline;"><strong>BlackBerry Inventory:</strong></span></p>
<p>Your BackBerry system configuration is stored in the BESMGMT SQL database, among other things you will find information about the Blackberry devices connecting to your mail system. We will query three tables in that database:
<ul>
<li>UserConfig: Contains among others the user&#8217;s Email address (<em>MailboxSMTPAddr</em> value).</li>
<li>SyncDeviceMgmtSummary: Blackberry model and OS version (<em>ModelName</em> and <em>AppsVer</em>).</li>
<li>UserStats: Time the last message was received by the BlackBerry (<em>LastFwdTime</em>).</li>
</ul>
<p>If you browse the database with SQL Management Studio you can see all that information:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/11/besmgmt.jpg" rel="lightbox[1517]"><img class="aligncenter size-medium wp-image-1496" title="besmgmt" src="http://www.ldap389.info/wp-content/uploads/2011/11/besmgmt-300x200.jpg" alt="" width="300" height="200" /></a><br />
You just need to use Powershell to connect to the SQL database and retrieve those values for each user. The primary key between the three tables is the <em>ID</em> value. We will filter only the users who received an Email during the last 60 days (<em>LastFwdTime</em>).</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$days</span> <span style="color: pink;">=</span> <span style="color: #804000;">60</span>
<span style="color: #800080;">$dbServer</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;SQLBES-SRV&quot;</span>
<span style="color: #800080;">$db</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;BESMgmt&quot;</span>
&nbsp;
<span style="color: #008000;">#If you use SA account to connect database, change pwd=XXXXXX!, or use Windows Authentication, see below</span>
<span style="color: #800080;">$connString</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Server=$dbServer;Database=$db;uid=sa;pwd=XXXXXX&quot;</span>
&nbsp;
<span style="color: #008000;">#If you use Windows Authentication to connect BESMGMT SQL Database, need setup the database</span>
<span style="color: #008000;">#$connString = &quot;Server=$dbServer;Database=$db;Integrated Security=True&quot;</span>
&nbsp;
<span style="color: #008000;">#SQL Query to retrieve BB devices Info (only devices who  recieved mail in the last $days)</span>
<span style="color: #800080;">$Query</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Select UserConfig.DisplayName,MailboxSMTPAddr,ModelName,LastFwdTime,AppsVer from UserConfig,SyncDeviceMgmtSummary,UserStats where UserConfig.ID=SyncDeviceMgmtSummary.UserConfigID AND UserConfig.ID=UserStats.UserConfigID AND DeviceType &lt;&gt; 0 AND ModelName &lt;&gt; '' AND DateDiff(dd,LastFwdTime,GETDATE()) &lt; &quot;</span><span style="color: pink;">+</span><span style="color: #800080;">$days</span>
&nbsp;
<span style="color: #008000;">#Connect to Database, run Query, Disconnect</span>
&nbsp;
<span style="color: #800080;">$SqlConnection</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> 
&nbsp;
System.Data.SqlClient.SqlConnection
<span style="color: #800080;">$SqlConnection</span>.ConnectionString <span style="color: pink;">=</span> <span style="color: #800080;">$connString</span>
<span style="color: #800080;">$SqlCmd</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Data.SqlClient.SqlCommand
<span style="color: #800080;">$SqlCmd</span>.CommandText <span style="color: pink;">=</span> <span style="color: #800080;">$Query</span>
<span style="color: #800080;">$SqlCmd</span>.Connection <span style="color: pink;">=</span> <span style="color: #800080;">$SqlConnection</span>
<span style="color: #800080;">$SqlAdapter</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Data.SqlClient.SqlDataAdapter
<span style="color: #800080;">$SqlAdapter</span>.SelectCommand <span style="color: pink;">=</span> <span style="color: #800080;">$SqlCmd</span>
<span style="color: #800080;">$DataSet</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.Data.DataSet
<span style="color: #800080;">$SqlAdapter</span>.Fill<span style="color: #000000;">&#40;</span><span style="color: #800080;">$DataSet</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$SqlConnection</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$bbs</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DataSet</span>.Tables<span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span></pre></div></div>

<p>If you need more details on how to query the BESMGMT database you can read this <a href="http://www.jigsawboys.com/2008/04/04/sql-query-to-exportlist-all-users-in-your-blackberry-server-farm/">post</a> or this <a href="http://www.blackberryforums.com/bes-admin-corner/178896-powershell-bes.html">forum</a> topic, which discusses how to query the database with SQL 2008 CmdLets (you will need to install the Microsoft <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&#038;id=8824">SQL Server 2008 Feature Pack</a>.) The above script uses the .NET <em><a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.aspx">System.Data.SqlClient</a></em> Namespace, so you won&#8217;t need any additional installation. All the information about your user&#8217;s Blackberry devices is retrieved in the <em>$bbs</em> variable.</p>
<p><span style="text-decoration: underline;"><strong>ActiveSync Inventory:</strong></span></p>
<p>For other mobile devices connecting to your mail system it is more simple because they use the ActiveSync protocol, and all the information you need is stored in the Active Directory. Florian&#8217;s blog <a href="http://www.frickelsoft.net/blog/?p=285">post</a> explains that <em>msExchActiveSyncDevice</em> objects are a subcontainer of your AD account. Just open <em>dsa.msc</em> to check this out:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/11/activesync-device.jpg" rel="lightbox[1517]"><img class="aligncenter size-medium wp-image-1498" title="activesync-device" src="http://www.ldap389.info/wp-content/uploads/2011/11/activesync-device-300x117.jpg" alt="" width="300" height="117" /></a></p>
<p>Thanks to the Exchange Management Shell (2007 and 2010), the <em><a href="http://technet.microsoft.com/en-us/library/aa996908(EXCHG.80).aspx">Get-ActiveSyncDeviceStatistics </a></em> cmdlet gives you all the information you need about the <em>msExchActiveSyncDevice</em> objects. You can read <a href="http://www.simple-talk.com/sysadmin/exchange/identifying-exchange-activesync-users-with-powershell/">Ben Lye&#8217;s post</a> to know how to identify ActiveSync users. With that Cmdlet we will retrieve the following values:</p>
<ul>
<li>DeviceType: Mobile type (Iphone, WP, Android&#8230;)</li>
<li>DeviceModel: Mobile model (HTC, LG, Samsung, Iphone&#8230;)</li>
<li>DeviceUserAgent: OS build is displayed in that value (Iphone, WP, Android&#8230;)</li>
<li>LastSuccessSync: Last successful device synchronization, like BlackBerry devices we will filter only users who successfully synchronized during the last 60 days</li>
</ul>
<p>We retrieve more or less the same information as the one retrieved with the SQL query for Blackberry devices.</p>
<p><span style="text-decoration:underline;"><strong>How the script works:</strong></span></p>
<p>We will describe how to aggregate both queries. First we query the BESMGMT SQL database to retrieve Blackberry devices information. For each Email address <em>MailboxSMTPAddr </em>we also check if the user has a device using the ActiveSync protocol (when you are a real VIP you have a Blackberry and an iPad <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) by using the following Powershell command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$acts</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>ActiveSyncDeviceStatistics <span style="color: pink;">-</span>Mailbox <span style="color: #800080;">$bb</span>.MailboxSMTPAddr
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$acts</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Measure-object</span><span style="color: #000000;">&#41;</span>.count <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span> 
<span style="color: #000000;">&#123;</span>User has just one BB no ActiveSync device<span style="color: #000000;">&#125;</span>
<span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span>User has one ActiveSync device <span style="color: #0000FF;">in</span> addition to BB<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Once the Blackberry inventory is done we load every Exchange mailbox with this command:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$Mailboxes</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>Mailbox <span style="color: pink;">-</span>RecipientTypeDetails UserMailbox <span style="color: pink;">-</span>ResultSize Unlimited</pre></div></div>

<p>Then we compare the <em>PrimarySmtpAddress</em> value (retrieved with the get-mailbox Cmdlet) with every <em>MailboxSMTPAddr</em> value (stored in the <em>$BESsmtpArray</em> variable) in order to exclude the users already processed during the BlackBerry devices inventory. For each remaining user we check if they have any devices using the ActiveSync protocol. The result of the inventory is written in a CSV file containing the following information:</p>
<ul>
<li>User&#8217;s Email address.</li>
<li>Number of mobile devices (ActiveSync + BlackBerry).</li>
<li>Device type: BlackBerry, IPhone, WP, Android&#8230;</li>
<li>Device model: BlackBerry model, Samsung, HTC, LG&#8230;</li>
<li>OS version.</li>
<li>Last connection: Last mail received on the BlackBerry device, last ActiveSync synchronization.</li>
</ul>
<p>Here is an example of inventory result imported in Excel:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/11/output.jpg" rel="lightbox[1517]"><img class="aligncenter size-medium wp-image-1499" title="output" src="http://www.ldap389.info/wp-content/uploads/2011/11/output-300x65.jpg" alt="" width="300" height="65" /></a></p>
<p>Just modify the following variables in the script and launch it from the Exchange management shell:</p>
<ul>
<li>$days: Inactivity threshold in days (default is 60).</li>
<li>$dbServer: Name of the server hosting the SQL BES configuration database.</li>
<li>$connString: Authentication to the SQL database (Windows integrated or with SA account).</li>
</ul>
<p>To download the full script, just click below:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/11/countMobile.ps1"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a><br />
PS: The script was tested under Exchange 2010 and BES 5.02, thanks for your feedback on other versions.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Powershell%3A+Blackberry+and+Activesync+mobile+devices+inventory+http%3A%2F%2Fis.gd%2FxAebgL" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/0BQDr0ku3As" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/11/21/powershell-sql-ems-mobile-device-inventory-blackberry-activesync-exchange/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/11/21/powershell-sql-ems-mobile-device-inventory-blackberry-activesync-exchange/</feedburner:origLink></item>
		<item>
		<title>Powershell: Compare WSUS target groups</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/0U6Wqk9uyc8/</link>
		<comments>http://www.ldap389.info/en/2011/11/04/powershell-compare-wsus-target-groups/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 19:45:47 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[scripts @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[PowerShell @en]]></category>
		<category><![CDATA[wsus @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1470</guid>
		<description><![CDATA[This script compares the updates approved between two WSUS target groups. It can ben useful when you want to get the differences between a test and a production group, you can read this Group Policy Central article to get more details on how to set up a WSUS test group using GPO (chapter Implement a WSUS [...]]]></description>
			<content:encoded><![CDATA[<p>This script compares the updates approved between two WSUS target groups. It can ben useful when you want to get the differences between a <em>test</em> and a <em>production</em> group, you can read this <a href="http://www.grouppolicy.biz/2011/06/best-practices-group-policy-for-wsus/">Group Policy Central</a> article to get more details on how to set up a WSUS test group using GPO (chapter <em>Implement a WSUS Update Test Group of Computers</em>).<br />
<span id="more-1470"></span><br />
In order to get the approval status of a patch we will use the <em>Microsoft.UpdateServices.Administration</em> namespace (<em><a href="http://msdn.microsoft.com/en-us/library/microsoft.updateservices.administration.updateapprovalaction(v=VS.85).aspx">UpdateApprovalAction</a></em> enumeration), the following code enumerates all the KB updates and returns its approval status for all target groups:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>reflection.assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.UpdateServices.Administration&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$wsus</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.UpdateServices.Administration.AdminProxy<span style="color: #000000;">&#93;</span>::getUpdateServer<span style="color: #000000;">&#40;</span><span style="color: #800080;">$wsusserver</span><span style="color: pink;">,</span><span style="color: #800080;">$False</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$updateScope</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.UpdateServices.Administration.UpdateScope;
<span style="color: #800080;">$updateScope</span>.UpdateApprovalActions <span style="color: pink;">=</span><span style="color: #000000;">&#91;</span>Microsoft.UpdateServices.Administration.UpdateApprovalActions<span style="color: #000000;">&#93;</span>::Install <span style="color: #FF0000;">-bor</span> <span style="color: #000000;">&#91;</span>Microsoft.UpdateServices.Administration.UpdateApprovalActions<span style="color: #000000;">&#93;</span>::Uninstall <span style="color: #FF0000;">-bor</span> <span style="color: #000000;">&#91;</span>Microsoft.UpdateServices.Administration.UpdateApprovalActions<span style="color: #000000;">&#93;</span>:: All <span style="color: #FF0000;">-bor</span> <span style="color: #000000;">&#91;</span>Microsoft.UpdateServices.Administration.UpdateApprovalActions<span style="color: #000000;">&#93;</span>::NotApproved
&nbsp;
<span style="color: #800080;">$updates</span> <span style="color: pink;">=</span> <span style="color: #800080;">$wsus</span>.GetUpdates<span style="color: #000000;">&#40;</span><span style="color: #800080;">$updateScope</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #800080;">$groups</span> <span style="color: pink;">=</span> <span style="color: #800080;">$wsus</span>.GetComputerTargetGroups<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span> <span style="color: #800080;">$update</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$updates</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$group</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$groups</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #800080;">$status</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Pending&quot;</span>
&nbsp;
    <span style="color: #008000;">#MSDN update status:</span>
    <span style="color: #008000;">#All: Use to query all updates, regardless of their action.</span>
    <span style="color: #008000;">#Install: Client installs the update.</span>
    <span style="color: #008000;">#NotApproved :The Update will not be available for clients. This value can be used in a simple targeting ComputerTargetGroup to &quot;override&quot; a UpdateApproval made to the &quot;All Computers&quot; ComputerTargetGroup.</span>
    <span style="color: #008000;">#Uninstall: Client removes the update.</span>
&nbsp;
        <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$update</span>.GetUpdateApprovals<span style="color: #000000;">&#40;</span><span style="color: #800080;">$group</span><span style="color: #000000;">&#41;</span>.Count <span style="color: #FF0000;">-ne</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span><span style="color: #800080;">$status</span> <span style="color: pink;">=</span> <span style="color: #800080;">$update</span>.GetUpdateApprovals<span style="color: #000000;">&#40;</span><span style="color: #800080;">$group</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span>.Action<span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-weight: bold;">write-host</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$update</span>.Title <span style="color: pink;">+</span> <span style="color: #800000;">';'</span> <span style="color: pink;">+</span> <span style="color: #800080;">$group</span>.Name <span style="color: pink;">+</span> <span style="color: #800000;">';'</span> <span style="color: pink;">+</span> <span style="color: #800080;">$status</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Both <em>test</em> and <em>production</em> target groups inherit from the <em>&#8220;All Computers&#8221;</em> group:<br />
<img class="aligncenter size-medium wp-image-1449" title="wsus-hierarchy" src="http://www.ldap389.info/wp-content/uploads/2011/10/wsus-hierarchy-215x300.jpg" alt="" width="215" height="300" /></p>
<p>We need to retrieve the update approval status for the following target groups:</p>
<ul>
<li>$Allstatus: Approval status for the &#8221;<em>All computers</em>&#8221; group, default value &#8220;<em>Not Approved</em>&#8220;.</li>
<li>$statusprod: Approval status for the <em>production</em> target group, default value &#8220;<em>Pending</em>&#8220;, in this case the approval status inherits from the &#8220;<em>All computers</em>&#8221; group.</li>
<li>$statusqualif: Approval status for the <em>test</em> target group, default value &#8220;<em>Pending</em>&#8220;, in this case the approval status inherits from the &#8220;<em>All computers</em>&#8221; group.</li>
</ul>
<p>For a given patch, if <em>$statusprod</em> is different from <em>$statusqualif</em> then the status of each group is returned, if one of the two groups has no value (status <em>pending</em>) then the <em>All computers</em> group approval status is returned.</p>
<p>Download the full script here:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/10/compare-wsus-groups.ps1"><img class="aligncenter size-full wp-image-83" title="tool" src="http://www.ldap389.info/wp-content/uploads/2010/03/tool1.png" alt="" width="48" height="48" /></a></p>
<p>The script returns a CSV file with the following information:</p>
<ul>
<li>KB update name.</li>
<li>Approval status for the <em>production</em> target group, inheritance from the <em>All Computers</em> group is displayed if needed.</li>
<li>Approval status for the <em>test</em> target group, inheritance from the <em>All Computers</em> group is displayed if needed.</li>
<li>MSRC severity of the patch (see this <a href="http://msdn.microsoft.com/en-us/library/microsoft.updateservices.administration.msrcseverity(v=VS.85).aspx">MSDN article</a> to get more information on the possible values), this concerns security patches.</li>
<li>MS Security bulletin the patch is related to, this concerns security patches.</li>
<li>Products concerned by this update.</li>
</ul>
<p>In the script, change the following default values:</p>
<ul>
<li><em>$wsusserver</em>: WSUS server name.</li>
<li><em>$grqualif</em>: WSUS Target group name for the test computers.</li>
<li><em>$grprod</em>: WSUS Target group name for the production computers.</li>
</ul>
<p>If you want more Powershell scripts about WSUS server management, visit the <a href="http://gallery.technet.microsoft.com/scriptcenter/?f%5B0%5D.Type=RootCategory&amp;f%5B0%5D.Value=windowsupdate&amp;f%5B0%5D.Text=Windows%20Update&amp;f%5B1%5D.Type=SubCategory&amp;f%5B1%5D.Value=serverside&amp;f%5B1%5D.Text=Server-Side%20Management">technet script center</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Powershell%3A+Compare+WSUS+target+groups+http%3A%2F%2Fis.gd%2FV7mENP" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/0U6Wqk9uyc8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/11/04/powershell-compare-wsus-target-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/11/04/powershell-compare-wsus-target-groups/</feedburner:origLink></item>
		<item>
		<title>@ldap389 :-)</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/VLgVi6CMJlc/</link>
		<comments>http://www.ldap389.info/en/2011/11/01/ldap389/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 20:17:20 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1482</guid>
		<description><![CDATA[A quick word to tell you that I (finally) signed up on twitter. You will also find @ldap389 latest tweets on the blog&#8217;s sidebar (Twitter Updates widget), it replaces the old &#8220;Latest AD news&#8221; sidebar.]]></description>
			<content:encoded><![CDATA[<p>A quick word to tell you that I (finally) signed up on twitter. You will also find <a href="http://twitter.com/#!/ldap389">@ldap389</a> latest tweets on the blog&#8217;s sidebar (<em>Twitter Updates</em> widget), it replaces the <a href="http://www.ldap389.info/en/2010/07/05/sidebar-add-on-latest-ad-news/">old <em>&#8220;Latest AD news&#8221;</em></a> sidebar.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=%40ldap389+%3A-%29+http%3A%2F%2Fis.gd%2FFffob3" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/VLgVi6CMJlc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/11/01/ldap389/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/11/01/ldap389/</feedburner:origLink></item>
		<item>
		<title>ADDS 2008 migration: Before migrating to windows 8 server…</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/r6SNV_rjtMw/</link>
		<comments>http://www.ldap389.info/en/2011/09/24/adds-2008-migration-before-windows-8-server/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 23:14:51 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[Disaster recovery @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[troubleshooting @en]]></category>
		<category><![CDATA[adprep @en]]></category>
		<category><![CDATA[login @en]]></category>
		<category><![CDATA[rodc @en]]></category>
		<category><![CDATA[schema @en]]></category>
		<category><![CDATA[vdc @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1427</guid>
		<description><![CDATA[You can&#8217;t wait to install Windows server 8 developer preview in order to test it in the event of a future deployment&#8230; But you might want to finish your migration to ADDS 2008R2 before thinking about all that Bellow is a tab showing some client compatibility issues and the important steps when migrating your domain [...]]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t wait to <a href="http://blogs.dirteam.com/blogs/sanderberkouwer/archive/2011/09/14/how-to-install-windows-server-8-build-8102.aspx">install Windows server 8</a> developer preview in order to test it in the event of a future deployment&#8230; But you might want to finish your migration to ADDS 2008R2 before thinking about all that <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Bellow is a tab showing some client compatibility issues and the important steps when migrating your domain controllers to Windows server 2008R2:</p>
<p><span id="more-1427"></span></p>
<table style="width: 500px;" border="1">
<tbody>
<tr>
<td width="25%">Prepare AD: adprep.exe or adprep32.exe</td>
<td width="25%">Install the first Windows 2008R2 <em>RWDC</em> (not fsmo holder).</td>
<td width="25%">Migrate the <em>PDCe</em> to Windows 2008R2.</td>
<td width="25%">Migrate the <em>schema master</em> to Windows 2008: enable <em>Filtered Attribute Set</em> when installing a RODC.</td>
</tr>
<tr>
<td width="25%">1\ Minimum domain functional level: 2000.Recommended: 2003.</p>
<p>See this <a href="http://blogs.technet.com/b/askds/archive/2008/11/11/so-you-want-to-upgrade-to-windows-2008-domain-controllers-adprep.aspx">askDS post</a> for more details on running adprep</p>
<p>&nbsp;</p>
<p>2\ Deploying a RODC:</p>
<p><em>adprep /rodcprep:</em></p>
<p>Minimum domain functional level: <a href="http://technet.microsoft.com/en-us/library/cc754629%28WS.10%29.aspx#bkmk_raiseforestlevel">2003</a>.</td>
<td width="25%">1\ NT4.0 and old CIFS servers will not authenticate against a <a href="http://support.microsoft.com/kb/942564/en-us">Windows 2008R2 domain controller</a>.Symptom 4:</p>
<p><em>A SMB storage device may be unable to use weak cryptography algorithms to establish a security channel to a Windows Server 2008-based domain controller.</em></p>
<p>Here is an example if your EMC Celerra <a href="http://ecn-staging.emc.com/servlet/JiveServlet/previewBody/4724-102-2-15824/Celerra_Network_Server_5-6-46-%204_RN_300-004-151_a17.pdf;jsessionid=8BE2E66E9B324A416227F054E311CC6E.node0">target version is lower than 5.6</a>:</p>
<p><em>As of version 5.6.42.5, Celerra Network Server supports Microsoft’s new SMB 2 protocol.<br />
</em></p>
<p>&nbsp;</p>
<p>2\ Applications using Data Encryption Standard (DES) encryption for Kerberos authentication to a Windows 2008R2 domain controller <a href="http://support.microsoft.com/kb/977321/en-us">will fail to authenticate</a>.</p>
<p>Because this old cryptography algorithm is disabled by default.</p>
<p>Have a look a this example describing an <a href="http://www.jonathanmedd.net/2011/06/sap-single-sign-on-issues-with-windows-server-2008-r2-domain-controllers.html">SSO problem with SAP and a Windows 2008R2 DC.</a></td>
<td width="25%">1\ Active directory trust with a Windows NT4.0 domain, still <a href="http://support.microsoft.com/kb/942564/en-us">in the same KB</a>:Symptom 5:<br />
<em><br />
Servers that are running Windows Server 2008 R2 cannot be accessed by using a Windows NT 4.0-based domain trust.</em></p>
<p><strong>As a bonus</strong>: The trust relationship breaks when the 2008R2 PDCe is renewing the trust password with a NT4.0 DC, a few days later. See <em>TDO passwords</em> chapter of <a href="http://technet.microsoft.com/en-us/library/cc773178%28WS.10%29.aspx">this article</a>.</p>
<p>&nbsp;</p>
<p>2\ Deploying a RODC:</p>
<p>It will not advertise as a time source untill the PDCe is migrated to Windows server 2008, have a look at <a href="http://technet.microsoft.com/en-us/library/cc753966%28WS.10%29.aspx">this article for information and a possible workaround.</a></td>
<td width="25%">1\ The Schema master holder must be running Windows 2008 before using <a href="http://technet.microsoft.com/en-%20us/library/cc755310%28WS.10%29.aspx">Filtered Attribute Set</a>:<em>Make sure that the domain controller that holds the schema operations master (also known as flexible single master operations or FSMO) role is running Windows Server 2008 when you add attributes to the RODC FAS so that the attributes are verified to not be system critical.</em></p>
<p>&nbsp;</p>
<p>2\ Another important point about FAS from the same <a href="http://technet.microsoft.com/en-us/library/cc755310%28WS.10%29.aspx">article</a>:</p>
<p><em></em><em>A rogue RODC can replicate RODC FAS data from a domain controller that runs Windows Server 2003 by making a replication request.</em></p>
<p>Do not configure a Windows 2003 DC as a replication partner of a Windows 2008 DC. Use <em>dssite.msc</em> and/or firewall rules to make sure it doesn&#8217;t happen.</td>
</tr>
</tbody>
</table>
<p>Ok now you migrated to ADDS 2008R2 you can enjoy <a href="http://technet.microsoft.com/en-us/library/understanding-active-directory-functional- levels%28WS.10%29.aspx">many new features</a> like the active directory recycle bin when you forest functional level is 2008R2&#8230;</p>
<p>Well when you will start migrating to Windows server 8 ADDS you will get a new feature to make your disaster recovery plan even faster: The ability to <a href="http://www.windowsitpro.com/article/windowsserver8/windows-server-8-active-directory-140571">do snapshots of a V-DC.</a> <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I am sure my colleagues <a href="http://www.hypervisor.fr/">Hypervisor</a> and <a href="http://www.vmdude.fr/">VMDude</a> will appreciate that quote:</p>
<p><em>Microsoft is working with other virtualization vendors to make sure they include this technology in the latest version of their hypervisors as well. It’s in their interest to do so.</em></p>
<p> <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=ADDS+2008+migration%3A+Before+migrating+to+windows+8+server%E2%80%A6+http%3A%2F%2Fis.gd%2FOGcIRl" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/r6SNV_rjtMw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/09/24/adds-2008-migration-before-windows-8-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/09/24/adds-2008-migration-before-windows-8-server/</feedburner:origLink></item>
		<item>
		<title>Sign an Excel macro with a certificate issued by your enterprise PKI</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/PHhIOqesjEM/</link>
		<comments>http://www.ldap389.info/en/2011/09/08/sign-excel-macro-vba-with-certificate-issued-by-enterprise-pki-adcs/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 14:56:03 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[Public Key Infrastructure @en]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[adm @en]]></category>
		<category><![CDATA[pki @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1271</guid>
		<description><![CDATA[This article describes how to digitally sign an Excel VBA project with a certificate issued by your ADCS PKI. You can use the same method to sign any Office VBA project but in this post we will focus on Excel. For an introduction on how to sign Office macros you can read these KB and [...]]]></description>
			<content:encoded><![CDATA[<p>This article describes how to digitally sign an Excel VBA project with a certificate issued by your ADCS PKI. You can use the same method to sign any Office VBA project but in this post we will focus on Excel. For an introduction on how to sign Office macros you can read these <a href="http://support.microsoft.com/kb/206637/en-us">KB</a> and <a href="http://msdn.microsoft.com/en-us/library/aa141471(v=office.10).aspx">MSDN</a> articles.<br />
<span id="more-1271"></span>You can deduce from both articles that you need to use the &#8220;<a href="http://technet.microsoft.com/en-us/library/cc786499(WS.10).aspx">code signing</a>&#8221; certificate template to perform the digital signature. So we will create <a href="http://technet.microsoft.com/en-us/library/cc740077(WS.10).aspx">a new certificate template</a> named &#8220;<em>Excel</em>&#8221; which will be a duplicate from the existing &#8220;<em>code signing</em>&#8221; template. It will have the following characteristics:</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/cc778954(WS.10).aspx">Autoenrollment</a> is set up for the <em>ldap389-excel-dev</em> group which contains the users authorized to sign Excel macros, the user <em>ldap389-dev</em> is a member of this group.</li>
<li>Private key: length 2048 bits, not exportable.</li>
<li>Certificate validity period: 1 year.</li>
</ul>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/code-signing-vba-certificate-template1.jpg" rel="lightbox[1271]"><img class="aligncenter size-medium wp-image-1244" title="code-signing-vba-certificate-template" src="http://www.ldap389.info/wp-content/uploads/2011/08/code-signing-vba-certificate-template1-300x171.jpg" alt="" width="300" height="171" /></a> Once the <em>Excel</em> certificate template is configured, the certificate will be automatically installed via <em>autoenrollment</em> in the <em>ldap389-dev</em> user&#8217;s personal store:<a href="http://www.ldap389.info/wp-content/uploads/2011/08/certificate-store.jpg" rel="lightbox[1271]"><img class="aligncenter size-medium wp-image-1245" title="certificate-store" src="http://www.ldap389.info/wp-content/uploads/2011/08/certificate-store-300x84.jpg" alt="" width="300" height="84" /></a></p>
<p>You may want to lock your project before signing it, under the visual basic editor right click on your project, select &#8220;Properties&#8221;, on the &#8220;Protection&#8221; tab select the &#8220;Lock project for viewing&#8221; check box and enter a password. To sign your project navigate to &#8220;Tools\Digital Signatures&#8221;, click &#8220;choose&#8221;, the &#8220;code signing&#8221; certificate installed in your <em>ldap389-dev</em> user&#8217;s personal store should appear:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/vba_lock_and_sign.jpg" rel="lightbox[1271]"><img class="aligncenter size-medium wp-image-1247" title="vba_lock_and_sign" src="http://www.ldap389.info/wp-content/uploads/2011/08/vba_lock_and_sign-300x264.jpg" alt="" width="300" height="264" /></a></p>
<p>You just signed your VBA project, the certificate validity period is one year. You will need to resign and redeploy the macro before the expiration date<br />
(the 16th of August 2012). After that date the signature will be considered expired and invalid, unless you use a <em>TimeStamp</em> server (<a href="http://www.ietf.org/rfc/rfc3161.txt">RFC 3161</a> compliant) when signing your VBA project. To achieve that, you should edit the <em>ldap389-dev</em> user&#8217;s registry: Edit the key <em>HKEY_CURRENT_USER\Software\Microsoft\VBA\Security</em> as described in the <em>&#8220;Office files: enable time-stamping&#8221;</em> chapter of this <a href="http://surewebconsulting.com/code-signing-microsoft-office-files-with-vba-macros/">post</a>. This registry setting can be deployed via GPO for the <em>ldap389-excel-dev</em> group. In our case we will use the following registry values:</p>
<ul>
<li>TimeStampURL (REG_SZ): http://timestamp.verisign.com/scripts/timstamp.dll.</li>
<li>TimeStampRetryCount (REG_DWORD): 2.</li>
<li>TimeStampRetryDelay (REG_DWORD): 2.</li>
</ul>
<p>Once all your Excel macros are signed by your developers you can enforce the Excel security level with a GPO for all Office versions deployed in your domain, for that you will need to download the &#8220;administrative templates&#8221; of each Office version:</p>
<ul>
<li><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=9035">Office 2003 SP3</a> Administrative Template Files (ADM).</li>
<li><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=22666">Office 2007</a> Administrative Template Files (ADM,ADMX/ADML).</li>
<li><a href="http://www.microsoft.com/download/en/details.aspx?id=18968">Office 2010</a> Administrative Template Files (ADM,ADMX/ADML).</li>
</ul>
<p>You can now setup a GPO that disables all except digitally signed macros for each Excel version:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_macro_security.jpg" rel="lightbox[1271]"><img class="aligncenter size-medium wp-image-1248" title="gpo_macro_security" src="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_macro_security-300x201.jpg" alt="" width="300" height="201" /></a></p>
<p>The above setting is the default one, but it is better to enforce it with a GPO in case it is modified&#8230;</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Sign+an+Excel+macro+with+a+certificate+issued+by+your+enterprise+PKI+http%3A%2F%2Fis.gd%2FZethmG" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/PHhIOqesjEM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/09/08/sign-excel-macro-vba-with-certificate-issued-by-enterprise-pki-adcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/09/08/sign-excel-macro-vba-with-certificate-issued-by-enterprise-pki-adcs/</feedburner:origLink></item>
		<item>
		<title>GPO: Loopback processing and Group Policy Preferences</title>
		<link>http://feedproxy.google.com/~r/Ldap389/~3/Que9knrCpo8/</link>
		<comments>http://www.ldap389.info/en/2011/08/23/gpo-loopback-processing-and-group-policy-preferences/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 08:50:03 +0000</pubDate>
		<dc:creator>ldap389</dc:creator>
				<category><![CDATA[gpo @en]]></category>
		<category><![CDATA[gpmc @en]]></category>
		<category><![CDATA[gpp @en]]></category>
		<category><![CDATA[rsop @en]]></category>

		<guid isPermaLink="false">http://www.ldap389.info/?p=1236</guid>
		<description><![CDATA[In this post we talk about loopback processing of group policy and what interesting new feature is available when combining with Group Policy Preferences. If you need a detailed explanation on how loopback processing of group policy works I suggest you read this 4sysops two part blog post (part 1, part 2). When using loopback [...]]]></description>
			<content:encoded><![CDATA[<p>In this post we talk about <a href="http://support.microsoft.com/kb/231287/en-us">loopback </a>processing of group policy and what interesting new feature is available when combining with <a href="http://www.microsoft.com/download/en/details.aspx?id=24449">Group Policy </a>Preferences.</p>
<p>If you need a detailed explanation on how loopback processing of group policy works I suggest you read this 4sysops two part blog post (<a href="http://4sysops.com/archives/group-policy-loopback-processing-part-1-usage- scenarios/">part 1</a>, <a href="http://4sysops.com/archives/group-policy-loopback-processing- part-2-replace-mode-and-merge-mode/">part 2</a>).</p>
<p><span id="more-1236"></span>When using loopback processing of group policy on a TS/Citrix server I generally choose the <a href="http://technet.microsoft.com/en-us/library/cc782810%28WS.10%29.aspx">replace</a> mode, in order to discard any specific user settings and get the same environment for each user. The below GPO is applied to the TS/Citrix computer objects located in the same Organizational Unit:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/boucle_rappel_replace.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1219" title="boucle_rappel_replace" src="http://www.ldap389.info/wp-content/uploads/2011/08/boucle_rappel_replace-300x294.jpg" alt="" width="300" height="294" /></a></p>
<p>All the servers of our Citrix/TS farm are located in the same OU, there are just two web applications published in our farm, each server hosts only one application. Each application needs a different user configuration, in our case study the IE title bar:</p>
<ul>
<li>IE title bar set to &#8220;Web Application 1&#8243; for the users member of the &#8220;Qualif-Xen-Usr-Param1&#8243; group and logging on the TS/Citrix servers located in the &#8220;460-XenApp6&#8243; Organizational Unit and member of the &#8220;Qualif-Xen-srv-Param1&#8243; group.</li>
<li>IE title bar set to &#8220;Web Application 2&#8243; for the users member of the &#8220;Qualif-Xen-Usr-Param2&#8243; group and logging on the TS/Citrix servers located in the &#8220;460-XenApp6&#8243; Organizational Unit and member of the &#8220;Qualif-Xen-srv-Param2&#8243; group.</li>
</ul>
<p>Without using GPP (Group Policy Preferences) you cannot target a specific computer group in order to apply user settings, <a href="http://technet.microsoft.com/en-us/library/cc781988 (WS.10).aspx">security filtering</a> will be set up for the &#8220;Qualif-Xen-Usr-Param1&#8243; and &#8220;Qualif-Xen-Usr-Param2&#8243; user groups. User configuration GPOs linked to the &#8220;460-XenApp6&#8243; OU will be as follows:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_user_no_gpp.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1220" title="gpo_user_no_gpp" src="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_user_no_gpp-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>When a user is member of the &#8220;Qualif-Xen-Usr-Param1&#8243; group the IE title bar will be &#8220;Web Application 1&#8243;, the &#8220;Web Application 2&#8243; IE title bar will be displayed if the user is member of the &#8220;Qualif-Xen-Usr-Param2&#8243; group. But if the same user is a member of both groups &#8220;Quali-Xen-Usr-Param2&#8243; and &#8220;Qualif-Xen-Usr-Param1&#8243;, the IE title bar &#8220;Web Application 1&#8243; will be displayed even if the user logs on a server hosting &#8220;Web Application 2&#8243;, because of the GPO processing order:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/title_bar_ctx-ts.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1221" title="title_bar_ctx-ts" src="http://www.ldap389.info/wp-content/uploads/2011/08/title_bar_ctx-ts-300x227.jpg" alt="" width="300" height="227" /></a>The only way to get the expected behaviour without using GPP is to move the servers hosting &#8220;Web Application 1&#8243; and the ones hosting &#8220;Web Application 2&#8243; in separate OUs and link each user configuration GPO on each OU. This might not be convenient in terms of administration, because you might end up with as many OUs as applications in your TS/Citrix farm.</p>
<p>When using GPP you have the <a href="http://technet.microsoft.com/en-us/library/cc733022.aspx"><em>Item level Targeting</em></a> feature, which will allow you to leave all you servers in the same OU. The GPO parameter &#8220;IE title bar&#8221; is just a registry setting, you need to edit the &#8220;Window Title&#8221; value located under HKEY_CURRENT_USER\Software\Microsft\Internet Explorer\Main. We will use registry GPP and edit that value with &#8220;Web Application 1&#8243; if the user belongs to the &#8220;Qualif-Xen-Usr-Param1&#8243; and logs on a server member of the &#8220;Qualif-Xen-srv-Param1&#8243; group thanks to the <em>item level targeting</em>:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/item_level_tergeting.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1222" title="item_level_tergeting" src="http://www.ldap389.info/wp-content/uploads/2011/08/item_level_tergeting-300x105.jpg" alt="" width="300" height="105" /></a></p>
<p>The user configuration GPPs linked to the &#8220;460-XenApp6&#8243; OU will look like this:</p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_user_gpp_enabled.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1223" title="gpo_user_gpp_enabled" src="http://www.ldap389.info/wp-content/uploads/2011/08/gpo_user_gpp_enabled-300x211.jpg" alt="" width="300" height="211" /></a></p>
<p>For a user belonging to both groups &#8220;Qualif-Xen-Usr-Param1&#8243; and &#8220;Qualif-Xen-Usr-Param2&#8243; the IE title bar will be different if he logs on a server hosting &#8220;Web application 1&#8243; or &#8220;Web application 2&#8243;, that is the expected behaviour <img src='http://www.ldap389.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://www.ldap389.info/wp-content/uploads/2011/08/title_bar_ctx-ts_different.jpg" rel="lightbox[1236]"><img class="aligncenter size-medium wp-image-1224" title="title_bar_ctx-ts_different" src="http://www.ldap389.info/wp-content/uploads/2011/08/title_bar_ctx-ts_different-300x147.jpg" alt="" width="300" height="147" /></a></p>
<p>By the way, do not forget to use the GPMC to get the resultant set of policy settings when working with GPP (see my <a href="http://www.ldap389.info/en/2011/07/28/mmc-tales/">previous post</a>).</p>
<p>As long as the user parameter you want to apply is a registry setting or a common GPP object (shortcut, network drive&#8230;) you can use this method to keep your TS/Citrix servers in the same OU when using loopback processing of group policy.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=GPO%3A+Loopback+processing+and+Group+Policy+Preferences+http%3A%2F%2Fis.gd%2FjVGbnq" title="Post to Twitter"><img class="nothumb" src="http://www.ldap389.info/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p></div><img src="http://feeds.feedburner.com/~r/Ldap389/~4/Que9knrCpo8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ldap389.info/en/2011/08/23/gpo-loopback-processing-and-group-policy-preferences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.ldap389.info/en/2011/08/23/gpo-loopback-processing-and-group-policy-preferences/</feedburner:origLink></item>
	</channel>
</rss>

