<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Summut you might not have known</title><link>http://blogs.technet.com/b/carlh/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Get User Profiles and Last User that Logged on to Desktop Computers</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/03/get-user-profiles-and-last-user-that-logged-on-to-desktop-computers.aspx</link><pubDate>Tue, 03 Jul 2012 10:52:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507184</guid><dc:creator>carl h2</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3507184</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/03/get-user-profiles-and-last-user-that-logged-on-to-desktop-computers.aspx#comments</comments><description>&lt;p&gt;Another Powershell script that helps with a migration. In this instance the requirement was for a way of understanding the accounts that had previously logged onto desktop systems and the credentials of the last logged on user, for either all desktop systems in a Domain\OU structure or all desktop systems listed in a text file. Additionally, in this instance, there was a requirement to add a delay between each iteration of the data gathering to minimise impact on the script running system and to the network.&lt;/p&gt;
&lt;p&gt;The challenge was that this information is stored differently in XP and Vista\Win7 in the registry and the Profile information is accessible on Vista\Win7 systems using Get-Profiles, but needs some registry scripting jiggery-pokery for XP\Win2k3 systems. Additionally, I could not find any script out there that did both these things, so I decided to use functions from other peoples work and stitch them together to get what is attached.&lt;/p&gt;
&lt;p&gt;To understand what can be done with the script, read the header. If the script is run without parameters it will just get Profile information for all desktop systems in the currently logged on domain. The output is stored in 3 csv files that are suffixed with Date\Time stamps in the same location that the script is run from.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The Syntax for running the script is this and none of the parameters are required.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;.\Get-PCUserProfilePath.ps1 -srcDomainPath &amp;lt;SearchPathdnOrDNSName&amp;gt; -IterationDelay &amp;lt;TimeInSeconds&amp;gt; -ComputerType &amp;lt;ServerOrDesktop&amp;gt; -ComputerListFile &amp;lt;sAMAccountNameTextList&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;I have not included a listing of the script here because it is too large, but the script can be downloaded at the bottom of this posting.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;HTH&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507184" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-71-84/Get_2D00_PCsUserProfileInfo.ps1.txt" length="27593" type="text/plain" /></item><item><title>Compare AD Object Direct Group Membership</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/02/compare-ad-object-direct-group-membership.aspx</link><pubDate>Mon, 02 Jul 2012 15:14:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507018</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3507018</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/02/compare-ad-object-direct-group-membership.aspx#comments</comments><description>&lt;p&gt;Who can guess I am working on an AD migration project at the moment? And it presents an opportunity to cut my teeth further on Powershell scripting. Yes the AD Powershell scripts I have produced so far could have been done much easier if I had used the AD module provided with AD in Windows Server 2008 R2, but unfortunately not everyone is in a situation where they can take advantage of that module or even the Quest Modules that are also available. Hence some of the long winded scripts I have been producing.&lt;/p&gt;
&lt;p&gt;Back to this problemette I was presented with. Following a user migration process\procedure the AD support team had discovered that a number of users were not able to access some resources and as one of the checks during remediation, wanted a quick way of comparing a users Group Membership with that of the source account. The following script is what I came up with for them. Basically, it gets all the direct Group memberships for the source object and destination objects (as specified at the command line) and runs a compare operation. The on screen output is of a table that displays the Group Memberships that are different between the objects with an arrow indicator showing what side of the evaluation the Group Membership exists. So for example if you ran the following command :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.\Compare-UserGroups.ps1 -srcDomain domain1.local -destDomain woodgrovebank.com -srcsAMAccountName carlh1 -destsAMAccountName carlh2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You would get 2 files that list each objects Group Membership and something like the table below, which shows that the entry for destsAMAccountName (carlh2) is a member of a group named "Password Policy Group", which the entry for srcsAMAccountName (carlh) is not a member of and vice versa for the other groups.&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;InputObject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SideIndicator&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;-----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;-------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;Password Policy Group&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;=&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;EventLogAccess&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;DnsAdmins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;Backup Operators&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;It is true this is just a "like for like" sAMAccountName comparison and not a true SID to SID\SIDHistory comparison and it only compares Direct membership, but the requirement was for a quick check to ensure nothing was awry for odd troubleshooting instances and suits the needs where Groups have been migrated wholesale. If you need anything more funky that does Group Nesting then&amp;nbsp;I advise you pop over to here &lt;a href="http://www.rlmueller.net/freecode1.htm"&gt;http://www.rlmueller.net/freecode1.htm&lt;/a&gt;&amp;nbsp;. Richards scripts are awesome.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;lt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Compare-UserGroups.ps1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Syntax:&amp;nbsp; Compare-UserGroups.ps1 -srcDomain &amp;lt;SourceDomain&amp;gt; -destDomain &amp;lt;DestinationDomain&amp;gt; -srcsAMAccountName &amp;lt;UserNetbiosName&amp;gt; -destsAMAccountName &amp;lt;UserNetbiosName&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Example: Compare-UserGroups.ps1 -srcDomain domain1.local -destDomain woodgrovebank.com -srcsAMAccountName carlh -destsAMAccountName carlh&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Purpose: Compares the DIRECT Group Membership of 2 user accounts.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Be aware that it compares the Netbios names (sAMAccountName) of the groups&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and is only useful either within a domain\forest or after a migration&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; of a user account between domains where the group names have not been changed&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as a consequence of the migration.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Params:&amp;nbsp; As shown in syntax above or by typing the script name at the command prompt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Req:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows 2003 SP2 or above, Powershell V2.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run "set-executionpolicy remotesigned" in Powershell&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://blogs.technet.com/b/carlh"&gt;&lt;span style="color: #000080;"&gt;http://blogs.technet.com/b/carlh&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Author:&amp;nbsp; Carl Harrison&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This script is provided "AS IS" with no warranties, confers no rights and &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is not supported by the authors or authors employer. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use of this script sample is subject to the terms specified at &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.microsoft.com/info/copyright.mspx"&gt;&lt;span style="color: #000080;"&gt;http://www.microsoft.com/info/copyright.mspx&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;Version: 1.0 - First cut&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;#&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Param (&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;[Parameter()][string]$srcDomain='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;[Parameter()][String]$destDomain='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter()][String]$srcsAMAccountName='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter()][String]$destsAMAccountName='')&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function Compare-GroupsHelp () {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$helptext=@"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;NAME: Compare-UserGroups.ps1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Compares the DIRECT Group Membership of 2 user accounts&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Be aware that it compares the Netbios names (sAMAccountName) of the groups&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;and is only useful either within a domain\forest or after a migration&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;of a user account between domains where the group names have not been changed&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;as a consequence of the migration.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;PARAMETERS:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-srcDomain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source Domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-destDomain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Destination Domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-srcsAMAccountName&amp;nbsp; Netbios name of the user account in the source domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-destsAMAccountName Netbios name of the user account in the destination domain (Required)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;SYNTAX:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Compare-UserGroups.ps1 -srcDomain domain1.local -destDomain woodgrovebank.com -srcsAMAccountName carlh -destsAMAccountName carlh2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Thsi compares the group memberships that carlh from domain1.local has in domain1.local&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;with the group memberships that carlh from woodgrovebank.com has in woodgrovebank.com&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;"@&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$helptext&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;exit&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function Get-LDAPUser ($UserName, $SourceDomain) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain1 = new-object DirectoryServices.DirectoryEntry ("&lt;a href="ldap://$SourceDomain"&gt;&lt;span style="color: #000080;"&gt;LDAP://$SourceDomain&lt;/span&gt;&lt;/a&gt;")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher = new-object DirectoryServices.DirectorySearcher($domain1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher.filter = "(&amp;amp;(objectClass=user)(sAMAccountName= $UserName))"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher.findone().getDirectoryEntry()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain1 =""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($srcDomain)) {"Source Domain Required";Compare-GroupsHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($destDomain)) {"Destination Domain Required";Compare-GroupsHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($srcsAMAccountName)) {"Netbios Name or Source Account Required";Compare-GroupsHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($destsAMAccountName)) {"Netbios Name or Destination Account Required";Compare-GroupsHelp}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcUserGroupsFile = '.\srcUserGroupsFile.txt'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destUserGroupsFile = '.\destUserGroupsFile.txt'&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcUser = get-ldapuser $srcsAMAccountName $srcDomain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host $srcUser.displayName "is a member of" $srcUser.memberOf.Count " groups in domain $srcDomain. The groups are:"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcUser.memberOf | ft&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destUser = get-ldapuser $destsAMAccountName $destDomain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host $destUser.displayName "is a member of" $destUser.memberOf.Count " groups in domain $destDomain. The groups are:"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destUser.memberOf | ft&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcUserGroups = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcGroupsDN = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destUserGroups = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destGroupsDN = @()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Foreach($Group in $srcUser.memberOf)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GroupsAMAccountName = ([ADSI]"&lt;a href="ldap://$Group&amp;quot;).sAMAccountName.value"&gt;&lt;span style="color: #000080;"&gt;LDAP://$Group").sAMAccountName.value&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$GroupsAMAccountName&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $srcUserGroups += "$GroupsAMAccountName"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $srcGroupsDN += $Group.tostring()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Foreach($Group in $destUser.memberOf)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GroupsAMAccountName = ([ADSI]"&lt;a href="ldap://$Group&amp;quot;).sAMAccountName.value"&gt;&lt;span style="color: #000080;"&gt;LDAP://$Group").sAMAccountName.value&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$GroupsAMAccountName&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUserGroups += "$GroupsAMAccountName"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destGroupsDN += $Group.tostring()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcGroupsDN | Out-File $srcUserGroupsFile&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destGroupsDN | Out-File $destUserGroupsFile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Compare-Object $srcUserGroups $destUserGroups -SyncWindow 100&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$destUser = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$srcUser = ""&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507018" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-70-18/Compare_2D00_UserGroups.ps1.txt" length="4642" type="text/plain" /></item><item><title>Copy AD User Profile Path etc between Domain User Objects</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/02/copy-ad-user-profile-path-etc-between-domain-user-objects.aspx</link><pubDate>Mon, 02 Jul 2012 14:19:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3507006</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3507006</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/02/copy-ad-user-profile-path-etc-between-domain-user-objects.aspx#comments</comments><description>&lt;p&gt;Here's a weird one, you are migrating users from multiple domains to a single domain and your migration process\procedure had determined that the primary domain of a user was not what it actually is, so the settings (Profile Path, Home Drive\Directory, and Script Path) for the new user are for the wrong account.&amp;nbsp;For various reasons you don't want or cannot merge the user objects attributes. This was one of the queries posed to me recently by a customer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The script below gives&amp;nbsp;a remedy to this by taking as a command line parameter the name and domain of one domain user and copying profile settings (the Profile Path, Home Drive &amp;amp; Directory, and Script Path) to relevant attributes of another command line parameter specified user name (in another domain). I even included the ability to prefix the ScriptPath Attribute (in case you use a different folder tree in the new domain).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Before using the script read the header to give you a clue as to the syntax. I have attached a copy of the code in a text file at the bottom of this post.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;lt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Copy-UserProfile.ps1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Syntax:&amp;nbsp; Copy-UserProfile.ps1 -srcDomain &amp;lt;SourceDomain&amp;gt; -destDomain &amp;lt;DestinationDomain&amp;gt; -scriptPathPrefix &amp;lt;ScriptPrefix&amp;gt; -srcsAMAccountName &amp;lt;UserNetbiosName&amp;gt; -&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;destsAMAccountName &amp;lt;UserNetbiosName&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Example: Copy-UserProfile.ps1 -srcDomain domain1.local -destDomain woodgrovebank.com -scriptPathPrefix domain1\ -srcsAMAccountName carlh -destsAMAccountName carlh2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Purpose: This Sets the ProfilePath, ScriptPath, HomeDrive and HomeDirectory of the user carlh2 in the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Woodgrovebank.com domain to the same settings as those for carlh in domain.local. Additionally,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the scriptPath attribute content is prefixed with the word domin1\&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Params:&amp;nbsp; As shown in syntax above or by typing the script name at the command prompt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Req:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows 2003 SP2 or above, Powershell V2.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp; run "set-executionpolicy remotesigned" in Powershell&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp; &lt;a href="http://blogs.technet.com/b/carlh"&gt;&lt;span style="color: #000080;"&gt;http://blogs.technet.com/b/carlh&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Author:&amp;nbsp; Carl Harrison&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This script is provided "AS IS" with no warranties, confers no rights and &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is not supported by the authors or Microsoft Corporation. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use of this script sample is subject to the terms specified at &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.microsoft.com/info/copyright.mspx"&gt;&lt;span style="color: #000080;"&gt;http://www.microsoft.com/info/copyright.mspx&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Version: 1.0 - First cut&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;#&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Param (&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;[Parameter()][string]$srcDomain='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;[Parameter()][String]$destDomain='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter()][String]$scriptPathPrefix='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter()][String]$srcsAMAccountName='',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter()][String]$destsAMAccountName='')&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function GetSetUserHelp () {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$helptext=@"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;NAME: Copy-UserPofile.ps1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Used to copy User Profile, Logon Script and Home details of user&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;from one domain to the next.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;PARAMETERS:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-srcDomain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source Domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-destDomain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Destination Domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-scriptPathPrefix&amp;nbsp;&amp;nbsp; Prefix to add to Script Path attribute (include any back slashes or forward slashes as required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-srcsAMAccountName&amp;nbsp; Netbios name of the user account in the source domain (Required)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-destsAMAccountName Netbios name of the user account in the destination domain (Required)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;SYNTAX:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Copy-UserProfile.ps1 -srcDomain domain1.local -destDomain woodgrovebank.com -scriptPathPrefix domain1\ -srcsAMAccountName carlh -destsAMAccountName carlh2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;This Sets the ProfilePath, ScriptPath, HomeDrive and HomeDirectory of the user carlh2 in the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Woodgrovebank.com domain to the same settings as those for carlh in domain.local. Additionally,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;the scriptPath attribute content is prefixed with the word domin1\&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;"@&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$helptext&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;exit&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function Get-LDAPUser ($UserName, $SourceDomain) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain1 = new-object DirectoryServices.DirectoryEntry ("&lt;a href="ldap://$SourceDomain"&gt;&lt;span style="color: #000080;"&gt;LDAP://$SourceDomain&lt;/span&gt;&lt;/a&gt;")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher = new-object DirectoryServices.DirectorySearcher($domain1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher.filter = "(&amp;amp;(objectClass=user)(sAMAccountName= $UserName))"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher.findone().getDirectoryEntry()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain1 =""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function Set-LDAPUser ($UserName2, $DestinationDomain) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain2 = new-object DirectoryServices.DirectoryEntry ("&lt;a href="ldap://$DestinationDomain"&gt;&lt;span style="color: #000080;"&gt;LDAP://$DestinationDomain&lt;/span&gt;&lt;/a&gt;")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher = new-object DirectoryServices.DirectorySearcher($domain2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $searcher.filter = "(&amp;amp;(objectClass=user)(sAMAccountName= $UserName2))"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser = $searcher.findone().getDirectoryEntry()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser.scriptPath = "$Global:ScriptPathPrefix" + $Global:srcUser.scriptPath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser.profilePath = $Global:srcUser.profilePath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser.homeDrive = $Global:srcUser.homeDrive&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser.homeDirectory = $Global:srcUser.homeDirectory&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $destUser.setinfo() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $domain2 = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($srcDomain)) {"Source Domain Required";GetSetUserHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($destDomain)) {"Destination Domain Required";GetSetUserHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($srcsAMAccountName)) {"Netbios Name or Source Account Required";GetSetUserHelp}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;if(!($destsAMAccountName)) {"Netbios Name or Destination Account Required";GetSetUserHelp}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:ScriptPathPrefix = $ScriptPathPrefix&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser = get-ldapuser $srcsAMAccountName $srcDomain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host $Global:srcUser.displayName "in domain $srcDomain settings are:"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser.scriptPath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser.profilePath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser.homeDrive&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser.homeDirectory&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;set-ldapuser $destsAMAccountName $destDomain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser = get-ldapuser $destsAMAccountName $destDomain&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Write-Host $Global:destUser.displayName "in domain $destDomain settings are now:"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser.scriptPath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser.profilePath&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser.homeDrive&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser.homeDirectory&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:destUser = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Global:srcUser = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$ScriptPathPrefix = ""&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3507006" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-70-06/Copy_2D00_UserProfile.ps1.txt" length="9378" type="text/plain" /></item><item><title>Powershell Script to find if Domain Admins is a member of Computer Local Administrators</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/02/powershell-script-to-find-if-domain-admins-is-a-member-of-computer-local-administrators.aspx</link><pubDate>Mon, 02 Jul 2012 12:09:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3506986</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3506986</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/02/powershell-script-to-find-if-domain-admins-is-a-member-of-computer-local-administrators.aspx#comments</comments><description>&lt;p&gt;So here's another script that I quickly&amp;nbsp;knocked up. Basically, I was asked whether there was a way of finding out whether the Domain Admins&amp;nbsp;group was a member of the Local Administrators group on a list of computers.&amp;nbsp;Powershell to the rescue; I'm really getting into this Powershell Malarkey.&lt;/p&gt;
&lt;p&gt;It is rather rudimentary and could actually be made a bit more usable by getting it to search AD and even specific OU structures in AD. Examples of this follow later in my TechNet Blog.&lt;/p&gt;
&lt;p&gt;Script attached to blog below (requires removal&amp;nbsp;of txt extension to work).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;lt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;#####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;SCRIPT IsADMemberOfLocalAdmins.ps1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;SYNTAX&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;.\IsADMemberOfLocalAdmins.ps1 -InputFile &amp;lt;.\ComputerList.txt&amp;gt; -OutputFile &amp;lt;.\OutPutFile.txt&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-InputFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text file containing list of Computers to query&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;-OutputFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text File containing results from script&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;SYNOPSIS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Queries the Local Administrators group on the computers listed in the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;text file provided as a parameter, to determine if Domain Admins is&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;listed as a member.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;NOTE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Script requires no parameters or arguments, but does have some.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I recommend you have the relevant permissions in the domain and&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on the computers being queried for optimal results.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This script is provided "AS IS" with no warranties, confers no rights and &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is not supported by the authors or employer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;AUTHOR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Carl Harrison&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;VERSION: 1.0 - First cut&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;#####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;#&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;# Change these two to suit your needs&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Param (&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;[Parameter()][string]$InputFile='.\computers.txt',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;[Parameter()][String]$OutputFile='.\IsDAMemberOfAdminsOutput.txt')&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$ChildGroups = "Domain Admins"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$LocalGroup = "Administrators"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$MemberNames = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$OutPutResults = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$Computers = Get-Content $InputFile&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;foreach ( $Computer in $Computers ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;$Group= [ADSI]"WinNT://$Computer/$LocalGroup,group"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;$Members = @($Group.psbase.Invoke("Members"))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;$Members | ForEach-Object {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;$MemberNames += $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;$ChildGroups | ForEach-Object {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;$output = "" | Select-Object Computer, Group, InLocalAdmin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;$output.Computer = $Computer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;$output.Group = $_&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;$output.InLocalAdmin = $MemberNames -contains $_&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;Write-Output $output&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $OutputResults += $output&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $MemberNames = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;$OutputResults | Export-CSV -NoTypeInformation $OutputFile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3506986" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-69-86/IsDAMemberOflocalAdmins.ps1.txt" length="1952" type="text/plain" /></item><item><title>Delete Stuff in AD</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/02/delete-stuff-in-ad.aspx</link><pubDate>Mon, 02 Jul 2012 11:48:08 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3506969</guid><dc:creator>carl h2</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3506969</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/02/delete-stuff-in-ad.aspx#comments</comments><description>&lt;p&gt;Once again another script to help one of my colleagues in need of a method of bulk deleting objects in AD taken from a list in CSV file. In this instance he need it for deletion of groups that they had determined as no longer useful. Bizarrely, this&amp;nbsp;type of script did not exist when he searched for it (I would have thought someone would have written something like this previously). Actually I had some written some of this code already over 8 years ago and decided to repurpose it for my colleague.&lt;/p&gt;
&lt;p&gt;Below is a listing of the VBScript. It reads in a file named Groups.csv that contains a list of all groups (sAMAccountName's) to be deleted (the original CSV file also had a second column that had the group type integer, but the script strips this). The script works in the domain of the currently logged on credentials, so you need the necessary permissions in AD for it to work.&lt;/p&gt;
&lt;p&gt;Normally, I comment my scripts a lot more, but this was a rush order :-) and I haven't had the time to revisit it (and I an trying to move from VBScript now).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My colleague has proven, the script is easily altered to enable it t delete any type of object and these scripts have been posted to Microsoft Script Center.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'Script deletes security groups from a csv file.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'csv format is strsAMGroupName,Whatever&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'This script is offered with no warranty&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'On Error Resume Next 'used in case group not found&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Option Explicit&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Const ForReading = 1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Dim strL, spl1, strOU, strGroupCN, strGroupName&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Dim objFSO, objInputFile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objInputFile = objFSO.OpenTextFile(".\groups.csv", ForReading) 'your csv file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;wscript.echo "script started"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'extract from csv file&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Do until objInputFile.AtEndOfStream&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;strL = objInputFile.ReadLine&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;spl1 = Split(strL, ",")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;strGroupName = (spl1(0))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;If GroupExists(strGroupName) = True Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;'WScript.Echo strGroupName &amp;amp; " exists."&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;DelGroup&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;End If&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Loop&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objFSO = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objInputFile = Nothing&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;wscript.echo "script finished"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'group exist check&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Function GroupExists(strsAMGroupName)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Dim strDNSDomain, strFilter, strQuery&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Dim objConnection, objCommand, objRootLDAP, objLDAPGroup, objRecordSet&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;GroupExists = False&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objConnection = CreateObject("ADODB.Connection")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objCommand =&amp;nbsp;&amp;nbsp; CreateObject("ADODB.Command")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objRootLDAP = GetObject("&lt;a href="ldap://RootDSE"&gt;&lt;span style="color: #000080;"&gt;LDAP://RootDSE&lt;/span&gt;&lt;/a&gt;")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objConnection.Provider = "ADsDSOObject"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objConnection.Open "Active Directory Provider"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objCommand.ActiveConnection = objConnection&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objCommand.Properties("Page Size") = 1000&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;strDNSDomain = objRootLDAP.Get("DefaultNamingContext")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;strFilter = "(&amp;amp;(objectCategory=group)(sAMAccountName=" &amp;amp; strsAMGroupName &amp;amp; "))"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;strQuery = "&amp;lt;LDAP://" &amp;amp; strDNSDomain &amp;amp; "&amp;gt;;" &amp;amp; strFilter &amp;amp; ";sAMAccountName,adspath,CN;subTree"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objCommand.CommandText = strQuery&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'WScript.Echo strFilter&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'WScript.Echo strQuery&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objRecordSet = objCommand.Execute&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;If objRecordSet.RecordCount = 1 Then&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objRecordSet.MoveFirst&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'WScript.Echo "We got here " &amp;amp; strsAMGroupName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;'WScript.Echo objRecordSet.Fields("sAMAccountname").Value&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;'WScript.Echo objRecordSet.Fields("adspath").Value&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;If objRecordSet.Fields("sAMAccountname").Value = strsAMGroupName Then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;GroupExists = True&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;Set objLDAPGroup = GetObject(objRecordSet.Fields("adspath").Value)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;strOU = objLDAPGroup.Parent&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;strGroupCN = objRecordSet.Fields("CN").Value&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;WScript.Echo strsAMGroupName &amp;amp; " Group doesn't exist or Duplicate sAMAccountName"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;GroupExists = False&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;strGroupCN = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;&amp;nbsp;strOU = ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;End If&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objRecordSet.Close&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objConnection = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objCommand = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objRootLDAP = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objLDAPGroup = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objRecordSet = Nothing&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;end function&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Sub DelGroup&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Dim objOU&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'WScript.Echo strOU&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;'WScript.Echo strGroupCN&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set objOU = GetObject(strOU)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;objOU.Delete "Group", "cn=" &amp;amp; strGroupCN &amp;amp; ""&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;WScript.Echo strGroupName &amp;amp; " (CN=" &amp;amp; strGroupCN &amp;amp; ") has been deleted."&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;Set ObjOU = Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;strGroupCN = ""&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000080; font-family: courier new,courier;"&gt;End Sub&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3506969" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-69-69/Bulkdeletegroups.vbs.txt" length="2883" type="text/plain" /></item><item><title>Ever wanted to know what shares are on all your Servers</title><link>http://blogs.technet.com/b/carlh/archive/2012/07/02/ever-wanted-to-know-what-shares-are-on-all-your-servers.aspx</link><pubDate>Mon, 02 Jul 2012 10:56:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3506944</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3506944</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2012/07/02/ever-wanted-to-know-what-shares-are-on-all-your-servers.aspx#comments</comments><description>&lt;p&gt;I have been scripting using VBScript for some time now, and only on occasion have I had the motivation and\or reason to write a script using Powershell, but&amp;nbsp;I have decided in the last 9 months to make a concerted effort to utilise the Power of Powershell as my main scripting technology. In this time period I have produced a number of scripts and I will be adding them to my blog in case anybody finds them useful.&lt;/p&gt;
&lt;p&gt;So my first offering is something I wrote for a colleague of mine, that queries all the Windows Servers in your domain and gathers their Shares, the permissions set on the shares and the permissions set on the NTFS file system at the share level (not lower). All this is output to 2 CSV files in the same folder that the script is run from. There are no Parameters for the script, and I hadn't written it to specifically search in specific OU structures or to read from text file&amp;nbsp;based list of computers. I have since written another script that I will be posting here, that has this functionality, so if you need it that functionality it can be done.&lt;/p&gt;
&lt;p&gt;The script requires that you have the necessary Rights on all the Servers you will be querying to get back all the information.&lt;/p&gt;
&lt;p&gt;Below is a listing of the script, but I have attached the code in a text file as well (obviously remove the txt extension to use)..&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;lt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;SCRIPT GetPermissions.ps1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;SYNOPSIS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gets all Servers from the domain from which the script is run in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (i.e. the domain you are logged in to).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then uses the server list to query each servers Share permissions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and the NTFS permissions of each share root folder.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The Script creates 2 files in the same location the script is&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run from (sharereport.csv and ntfsreport.csv).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;NOTE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Script requires no parameters or arguments&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I recommend you have the relevant permissions in the domain and&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on the servers being queried for optimal results.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Myself or my employer do not warrantee this script in any way and&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use of it is entirely at the users own risk.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The working functions of this script are taken from examples found&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft Script Center web site and are written by Boe Prox.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;AUTHOR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Carl Harrison&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The script utilises 2 functions written by Boe Prox and publically&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; available at Microsoft Script Center. They have been altered slightly&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; to work with this script.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;VERSION: 1.0 - First cut&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1 - Sorted FQDN Ping instead of netbios ping &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#####################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;function Get-SharePermissions{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;lt;#&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.SYNOPSIS&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retrieves share permissions. This function was extracted from a &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Powershell Module written by Boe Prox named FileSharePermissions.psm1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.DESCRIPTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retrieves share permissions.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.PARAMETER computer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name of server to test.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.EXAMPLE&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-SharePermissions -computer Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;[cmdletbinding(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;DefaultParameterSetName = 'computer',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;ConfirmImpact = 'low'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mandatory = $True,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Position = 0,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterSetName = 'computer',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueFromPipeline = $True)]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [array]$computer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;Begin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Process Share report&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sharereport = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;Process&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Iterate through comptuers&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($c in $computer)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Write-Verbose "Computer: $($c)"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Retrieve share information from comptuer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ShareSec = Get-WmiObject -Class Win32_LogicalShareSecuritySetting -ComputerName $c -ea stop&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($Shares in $sharesec)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Write-Verbose "Share: $($Shares.name)"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Try to get the security descriptor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;$SecurityDescriptor = $ShareS.GetSecurityDescriptor()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Iterate through each descriptor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;ForEach ($DACL in $SecurityDescriptor.Descriptor.DACL)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrshare = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrshare | Add-Member NoteProperty Computer $c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty Name $Shares.Name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty ID $DACL.Trustee.Name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Convert the current output into something more readable&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;Switch ($DACL.AccessMask)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2032127 {$AccessMask = "FullControl"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1179785 {$AccessMask = "Read"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1180063 {$AccessMask = "Read, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1179817 {$AccessMask = "ReadAndExecute"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-1610612736 {$AccessMask = "ReadAndExecuteExtended"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1245631 {$AccessMask = "ReadAndExecute, Modify, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1180095 {$AccessMask = "ReadAndExecute, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;268435456 {$AccessMask = "FullControl (Sub Only)"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default {$AccessMask = $DACL.AccessMask}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty AccessMask $AccessMask&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Convert the current output into something more readable&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;Switch ($DACL.AceType)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0 {$AceType = "Allow"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 {$AceType = "Deny"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2 {$AceType = "Audit"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty AceType $AceType&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add to existing array&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sharereport += $arrshare&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Catch any errors&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrshare = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrshare | Add-Member NoteProperty Computer $c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty Name "NA"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;$arrshare | Add-Member NoteProperty ID "NA" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrshare | Add-Member NoteProperty AccessMask "NA"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add to existing array&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sharereport += $arrshare&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Do Nothing Currently&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;End {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Display report&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$ShareReport&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$ShareReport | Export-Csv -notypeinformation "sharereport.csv"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $sharereport&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;function Get-ShareNTFSPermissions{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;lt;#&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.SYNOPSIS&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retrieves NTFS permissions on a share. This function was extracted from a &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Powershell Module written by Boe Prox named FileSharePermissions.psm1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.DESCRIPTION&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Retrieves NTFS permissions on a share.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.PARAMETER computer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name of server to test.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;.EXAMPLE&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-ShareNTFSPermissions -computer Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;[cmdletbinding(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;DefaultParameterSetName = 'computer',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;ConfirmImpact = 'low'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Parameter(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mandatory = $True,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Position = 0,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterSetName = 'computer',&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueFromPipeline = $True)]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [array]$computer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;Begin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Process NTFS Share report&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ntfsreport = @()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Process&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Iterate through each computer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($c in $computer)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Verbose "Computer: $($c)" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Gather share information&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $shares = Gwmi -comp $c Win32_Share -ea stop | ? {$_.Name -ne 'ADMIN$'-AND $_.Name -ne 'C$' -AND $_.Name -ne 'IPC$'} | Select Name,Path&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($share in $shares)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Iterate through shares&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Verbose "Share: $($share.name)"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($share.path -ne "")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Retrieve ACL information from Share&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $remoteshare = $share.path -replace ":","$" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Gather NTFS security information from each share&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $acls = Get-ACL "&lt;a href="file://\\$computer\$remoteshare"&gt;&lt;span style="color: #333399;"&gt;\\$computer\$remoteshare&lt;/span&gt;&lt;/a&gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #iterate through each ACL&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($acl in $acls.access)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($acl.FileSystemRights -match "\d")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;Switch ($acl.FileSystemRights)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2032127 {$AccessMask = "FullControl"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1179785 {$AccessMask = "Read"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1180063 {$AccessMask = "Read, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1179817 {$AccessMask = "ReadAndExecute"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-1610612736 {$AccessMask = "ReadAndExecuteExtended"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1245631 {$AccessMask = "ReadAndExecute, Modify, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1180095 {$AccessMask = "ReadAndExecute, Write"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;268435456 {$AccessMask = "FullControl (Sub Only)"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default {$AccessMask = "Unknown"}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AccessMask = $acl.FileSystemRights&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs = New-Object PSObject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Process NTFS Report&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Computer $c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty ShareName $Share.name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Path $share.path&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_User $acl.IdentityReference&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_Rights $AccessMask&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ntfsreport += $arrntfs&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs = New-Object PSObject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Process NTFS Report&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Computer $c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty ShareName "NA"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Path "NA"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_User "NA"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_Rights "NA"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add to existing array&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ntfsreport += $arrntfs&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Do nothing currently&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Computer $c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty ShareName "NA" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty Path "NA" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_User "NA" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $arrntfs | Add-Member NoteProperty NTFS_Rights "NA"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Add to existing array&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ntfsreport += $arrntfs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Do Nothing Currently&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Display report&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$ntfsreport&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$ntfsreport | Export-Csv -notypeinformation "ntfsreport.csv"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $ntfsreport&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#THIS IS THE START OF THE SCRIPT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#Define Some variables and Arrays&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$strOperatingSystem = "*Server*" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$Servers = @() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersShareReport = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersNTFSReport = @()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#Set up the Directory Search parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$objDomain = New-Object System.DirectoryServices.DirectoryEntry &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$objSearcher = New-Object System.DirectoryServices.DirectorySearcher &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$objSearcher.SearchRoot = $objDomain &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$objSearcher.Filter = ("OperatingSystem=$strOperatingSystem") &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$objSearcher.PageSize = 1000&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#Define the Attributes we need from the search&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$colProplist = "name","dnshostname","operatingsystemversion"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#Do the Search&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$colResults = $objSearcher.FindAll() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$Ping = New-Object System.Net.NetworkInformation.Ping&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;ForEach ($objResult in $colResults)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Server = $objResult.Properties.name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServerDNS = $objResult.Properties.dnshostname&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "Pinging $ServerDNS"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $errorActionPreference="SilentlyContinue"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Pingy = $ping.send($ServerDNS,5000)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServerShareOutput = $Null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServerNTFSOutput = $Null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #This is where we go get the information&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($Pingy.status.tostring() &amp;ndash;eq &amp;ldquo;Success&amp;rdquo;) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Cool we can get to the server now lets gather some information&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-host &amp;ldquo;$Server Available&amp;rdquo;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $errorActionPreference="Continue"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServerShareOutput = Get-SharePermissions -computer $ServerDNS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServerNTFSOutput = Get-ShareNTFSPermissions -computer $ServerDNS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersShareReport += $ServerShareOutput&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersNTFSReport += $ServerNTFSOutput&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #oh-oh either WMI is restricted or we cannot get to the current server&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-host &amp;ldquo;$Server Not Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer | Add-Member NoteProperty Computer "$Server"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer | Add-Member NoteProperty Name "Server No Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersShareReport += $FailedShareServer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer | Add-Member NoteProperty Computer "$Server"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer | Add-Member NoteProperty ShareName "Server No Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersNTFSReport += $FailedNTFSServer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #And this just catches any weird error events&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-host &amp;ldquo;$Server Not Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer | Add-Member NoteProperty Computer "$Server"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedShareServer | Add-Member NoteProperty Name "Server Not Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersShareReport += $FailedShareServer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer = New-Object PSObject&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer | Add-Member NoteProperty Computer "$Server"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $FailedNTFSServer | Add-Member NoteProperty ShareName "Server Not Available"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ServersNTFSReport += $FailedNTFSServer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $errorActionPreference="Continue"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pingy = $null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Server = $Null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;#Now we have the data let's save it to file - in the same location the script is run from&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersShareReport | Export-Csv -notypeinformation ".\sharereport.csv"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersShareReport = @()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersNTFSReport | Export-Csv -notypeinformation ".\ntfsreport.csv"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333399; font-family: courier new,courier;"&gt;$ServersNTFSReport = @()&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3506944" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-50-69-44/GetPermissions.ps1.txt" length="28582" type="text/plain" /></item><item><title>Script to Recover a Hyper-V Guest</title><link>http://blogs.technet.com/b/carlh/archive/2010/12/15/script-to-recover-a-hyper-v-guest.aspx</link><pubDate>Wed, 15 Dec 2010 00:15:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375094</guid><dc:creator>carl h2</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3375094</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2010/12/15/script-to-recover-a-hyper-v-guest.aspx#comments</comments><description>&lt;p&gt;Recently,&amp;nbsp;a colleague of mine had a customer that had a Hyper-V server whose operating system had failed. They did not have any backups of the Operating system and had not taken any backups of the Hyper-V guests using Export\Import (I won't bang on about Best Practices here; I think you probably guess what I would say if I did though :-)). They had access to the disks on which the Hyper-V guest VHD's and configuration xml files&amp;nbsp;were located and intended re-installing the the OS and Hyper-V Role. They were asking whether there is a method of recovering the Hyper-V guests to the new server. Fortunately another one of my colleagues suggested the method detailed on this great blog here&amp;nbsp;&lt;a href="http://blogs.msdn.com/b/robertvi/archive/2008/12/19/howto-manually-add-a-vm-configuration-to-hyper-v.aspx"&gt;http://blogs.msdn.com/b/robertvi/archive/2008/12/19/howto-manually-add-a-vm-configuration-to-hyper-v.aspx&lt;/a&gt;&amp;nbsp;which I am led to believe worked.&lt;/p&gt;
&lt;p&gt;Funnily enough, I had to use parts of this same method to recover a couple of Hyper-V guests on my PC&amp;nbsp;when I had done some disk volume management and moved the VHD's and config files around a bit, which caused permissions changes obviously; honestly guv'nor I had forgotten I had these guests running from the said volume (I know Best&amp;nbsp;Practice and all that ;-) , but it is just my laptop and not a production service providing environment).&lt;/p&gt;
&lt;p&gt;My colleague then commented that it would be cool if such a process were to be scripted. Tada ...... "his wish was my command". To be honest I had put this on my list of things to do, to get me to extend my scripting skills from VBScript to Powershell and having to actually go through the process myself made me agree with my colleague a script would be so much easier and useful to anybody else having to do it. There may actually be another script out there that does this, but at least I actually got to do some Powershell scripting :-) . It may not be the most correctly written script, but it is my first crack of the whip (as the saying goes). There is currently no error trapping and\or exception handling, but I have provided some command line markers that should make it easier to determine at which points it fails (if it does). I intend adding error handling later, but if I didn't share the script now it would always be sat on my laptop as a work in progress without being used (and tested).&lt;/p&gt;
&lt;p&gt;What I must say is, that after recovering the Hyper-V Guest using this script, the Hyper-V Guest is in an unsupported state and it is highly recommended that before starting the guest OS, you should use Hyper-V Manager to Export the Guest, remove it from Hyper-V Manager and then Import again into Hyper-V Manager. This will set all the permissions on all files as they should be.&lt;/p&gt;
&lt;p&gt;This script definitely works with Windows Server 2008 R2 Hyper-V and I suspect it also works on Windows Server 2008 (I don't have a n environment to check this though). The script utilises icacls and mklink (both provided as command line applications with the OS), because I was unable to use inbuilt Powershell functionality without some deep coding knowledge (not quite there yet) requiring that I write some additional libraries that someone has actually already made available here &lt;a href="http://pscx.codeplex.com/"&gt;http://pscx.codeplex.com/&lt;/a&gt;&amp;nbsp;. Basically, the Powershell cmdlet Set-ACL is not able to change owner when setting&amp;nbsp;permissions on certain types of files and folders, this requires some special jiggery-pockery of which I am not yet averse. You may ask why I didn't decide to use the PSCX myself; well I thought it best to produce a script that is standalone and does not require anything that is not already available through Powershell.&lt;/p&gt;
&lt;p&gt;Additionally, the script will only work correctly if the volume paths (i.e. drive letters) are the same as from before the issue that caused the Hyper-V guests to be disconnected from the Hyper-V Host Management Services.&lt;/p&gt;
&lt;p&gt;The only other thing you will need to do when using this script is to open Powershell with elevated privileges and to run "set-executionpolicy remotesigned".&lt;/p&gt;
&lt;p&gt;It may be worth checking the formatting of the code if you copy and paste it from this page as some of the lines have wrapped to the next line on this page. Alternatively, just download the txt file at the bottom of this post.&lt;/p&gt;
&lt;p&gt;Enjoy. Oh and please provide feedback if it works or not for you.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new,courier;"&gt;####################################################################&lt;br /&gt;# Recover-VM.ps1&lt;br /&gt;#&lt;br /&gt;# Syntax:&amp;nbsp; Recover-VM.ps1 "&amp;lt;drive:\path\VM_Config_File_as_GUID.xml&amp;gt;" &lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Use quotes in the argument)&lt;br /&gt;#&lt;br /&gt;# Example: Recover-VM.ps1 "v:\VirtualMachine1\Virtual Machines\7660AA46-BA41-4171-8820-CDD7C71050A0.xml"&lt;br /&gt;#&lt;br /&gt;# Purpose: Creates Symbolic Links and sets the required permissions&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to make a Hyper-V Virtual Machine available in Hyper-V&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Management Console. This script is intended for use in&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; recovery scenario where a Virtual Guests files have been&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; manually moved to another Virtual Server, but the volume&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drive mappings are the same, only.&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The methodology that this script employs is as discussed&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in the below blog.&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It should be noted that once this script has been used&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the Virtual Guest is in an unsupported state and should&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; be exported and re-imported in Hyper-V Manager to&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; correctly set all the Virtual Machines permissions.&lt;br /&gt;#&lt;br /&gt;# Params:&amp;nbsp; The drive, folder and filename of the Virtual Machine&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xml configuration file.&lt;br /&gt;#&lt;br /&gt;# Req:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows 2008 or above, Powershell V2, mklink, icacls.&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run "set-executionpolicy remotesigned" in Powershell&lt;br /&gt;#&lt;br /&gt;# Ref:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http://blogs.msdn.com/b/robertvi/archive/2008/12/19/howto-manually-add-a-vm-configuration-to-&lt;span style="font-family: courier new,courier;"&gt;hyper-v.aspx&lt;/span&gt;&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http://blogs.technet.com/b/carlh&lt;br /&gt;#&lt;br /&gt;# Author:&amp;nbsp; CarlH&lt;br /&gt;#&lt;br /&gt;# Myself or my employer do not warantee this script in any way and use&lt;br /&gt;# of it is entirely at the users own risk. The script is intended to&lt;br /&gt;# Recover Virtual Machines only in a recovery scenario, and such VM's&lt;br /&gt;# should be exported and imported onto the Hyper-V server to ensure&lt;br /&gt;# a supported state.&lt;br /&gt;#&lt;br /&gt;# Version: 1.0 - First cut&lt;br /&gt;#&lt;br /&gt;####################################################################&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new,courier;"&gt;Param($VMConfigFile)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;Write-Host ""&lt;br /&gt;Write-Host "---------------Recover-VM Script Start"&lt;br /&gt;$SystemDrive = (Get-item env:systemdrive).Value&lt;br /&gt;$VMFolder = (Get-Item $VMConfigFile).directoryname&lt;br /&gt;$VMFolder = (Get-Item $VMFolder).parent&lt;br /&gt;$VMFolderName = $VMFolder.fullname&lt;br /&gt;Write-Host ""&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#Read from the VM Configuration file. VM GUID for Service account. VM Name.&lt;br /&gt;Write-Host "---------------Reading VM Configuration File"&lt;br /&gt;[xml]$VMXML = Get-Content $VMConfigFile&lt;br /&gt;$VMSvcAccount = $VMXML.configuration.properties.global_id."#text"&lt;br /&gt;$VMName = $VMXML.configuration.properties.name."#text"&lt;br /&gt;Write-Host "---------------Completed reading VM Configuration File"&lt;br /&gt;Write-Host ""&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#This function takes a file name including the full path as a ThisItem string parameter and gets the current ACL.&lt;br /&gt;#It adds the VM Service account to the current ACL and then Sets the new ACL&lt;br /&gt;function SetACL&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param($ThisItem)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "---------------Setting Permissions for $ThisItem"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Acl = Get-Acl $ThisItem&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AccessRule = New-Object&amp;nbsp; system.security.accesscontrol.filesystemaccessrule("NT VIRTUAL MACHINE\$VMSvcAccount","FullControl","Allow")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Acl.SetAccessRule($AccessRule)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-Acl $ThisItem $Acl&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "---------------Finished Permissions for $ThisItem"&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#This Function uses the cmd line utility mklink to create a symbolic link of the physical file passed to it in the HardFile parameter as a string&lt;br /&gt;#The LinkLocation string parameter defines what folder the link will be created in under systemdrive\programdata\Microsoft\Windows\Hyper-V\&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;function MkSymLink&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param($HardFile, $LinkLocation)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "---------------Creating Symbolic Link for $HardFile"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $LinkFile = (get-item $HardFile).name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Write-Host "%systemdrive%\programdata\Microsoft\Windows\Hyper-V\$LinkLocation\$LinkFile" $HardFile&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd /c mklink "%systemdrive%\programdata\Microsoft\Windows\Hyper-V\$LinkLocation\$LinkFile" $HardFile&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host ""&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "---------------Finished Symbolic Link for $HardFile"&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#Get the VM config xml Fully Qualified Name and pass it to the MKSymLink function with the location for the for storing the Symbolic Link&lt;br /&gt;$VMFileString = (get-item $VMConfigFile).name&lt;br /&gt;MkSymLink -HardFile $VMConfigFile -LinkLocation "Virtual Machines"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#Call the SetACL function and pass it the FQN of the Symbolic Link to which we need to set the ACL &lt;br /&gt;$ConfigFileSymLink = "$SystemDrive\programdata\Microsoft\Windows\Hyper-V\Virtual Machines\$VMFileString"&lt;br /&gt;SetACL -ThisItem $ConfigFileSymLink&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#Get the FQN of the boot VHD from the VM Config xml file passed into the script. Then pass this to the SetACL function &lt;br /&gt;$VMVHDBootFile = $VMXML.configuration.'_83f8638b-8dca-4152-9eda-2ca8b33039b4_'.controller0.drive0.pathname."#text"&lt;br /&gt;SetACL -ThisItem $VMVHDBootFile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;#Build a string that defines the VM Service Account and use it with the cmd line utility icacls to set the permissions for all folders and files of the VM &lt;br /&gt;Write-Host ""&lt;br /&gt;Write-Host "---------------Setting Permissions for Folder $VMFolderName"&lt;br /&gt;Write-Host ""&lt;br /&gt;$VMSvcAccountFQN = 'NT VIRTUAL MACHINE\'+$VMSvcAccount&lt;br /&gt;cmd /c icacls ""$VMFolderName"" /T /grant ""$VMSvcAccountFQN""':(F)'&lt;br /&gt;Write-Host ""&lt;br /&gt;Write-Host "---------------Finished Permissions for Folder $VMFolderName"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;#Discover if there are any Snapshots. If so, for each one, create a Symbolic link for each by passing the FQN of the snapshot and snapsot link location&lt;br /&gt;#Also, call SetACL to set permissions for the VM Services account on the Symbolic Link&lt;br /&gt;foreach ($Thing in (Get-ChildItem $VMFolderName))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($Thing.name -eq "Snapshots")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SnapshotsFolder = $Thing.Fullname&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach ($Thing2 in (Get-ChildItem $SnapshotsFolder))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ($Thing2.extension -eq ".xml")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $VMSnapshotFileString = $Thing2.name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MkSymLink -HardFile $Thing2.fullname -LinkLocation "Snapshots"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SnapshotFileSymLink = "$SystemDrive\programdata\Microsoft\Windows\Hyper-V\Snapshots\$VMSnapshotFileString"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetACL -ThisItem $SnapshotFileSymLink&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;Write-Host ""&lt;br /&gt;Write-Host "----------------End Script Recover-VM.ps1"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375094" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-03-37-50-94/Recover_2D00_VM.ps1.txt" length="12468" type="text/plain" /><category domain="http://blogs.technet.com/b/carlh/archive/tags/Recover+Hyper_2D00_V+Guests/">Recover Hyper-V Guests</category></item><item><title>FRS Problem when Virtualising a Domain Controller </title><link>http://blogs.technet.com/b/carlh/archive/2010/06/22/frs-problem-when-virtualising-a-domain-controller.aspx</link><pubDate>Tue, 22 Jun 2010 14:41:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3339707</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3339707</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2010/06/22/frs-problem-when-virtualising-a-domain-controller.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;I recently had to assist&amp;nbsp;someone who had virtualised a single Windows 2003 Domain Controller from physical hardware to a virtualised Virtual Guest file using a third party (Non Microsoft) utility (not that I am saying this issue would be any different using a Microsoft utility).&amp;nbsp;This is not an advised\recommended practice for Domain Controllers, but in this instance they had no choice and the DC concerned was in fact a single DC (once again; Bad Practice, I know, but we work with what we have sometimes) in a test environment. Ignoring the list of&amp;nbsp;bad practices, the resulting DC was producing Event ID 13559 errors in the NTFRS log (see description below)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman';"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: small;"&gt;The File Replication Service has detected that the replica root path has changed from "x:\windows\sysvol\domain" to "x:\windows\sysvol\domain". If this is an intentional move then a file with the name NTFRS_CMD_FILE_MOVE_ROOT needs to be created under the new root path. This was detected for the following replica set: "DOMAIN SYSTEM VOLUME (SYSVOL SHARE)" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA;"&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&lt;span style="font-size: small;"&gt;Changing the replica root path is a two step process which is triggered by the creation of the NTFRS_CMD_FILE_MOVE_ROOT file. [1] At the first poll which will occur in 5 minutes this computer will be deleted from the replica set. [2] At the poll following the deletion this computer will be re-added to the replica set with the new root path. This re-addition will trigger a full tree sync for the replica set. At the end of the sync all the files will be at the new location. The files may or may not be deleted from the old location depending on whether they are needed or not.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;Indeed the description is also discussed in this KB article &lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/887440"&gt;&lt;span style="font-size: small;"&gt;http://support.microsoft.com/kb/887440&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: small;"&gt; and it&amp;nbsp;would appear that the disk signatures for the volumes that host the SYSVOL folder structure are changed during the conversion of the system from physical to virtual. Following the procedures detailed in the error event and in the article did in fact remedy the situation and the NTFRS event logs showed this fact by logging 13560, 13553 and 13516 (which effectively proves the DC is functioning correctly from and FRS\SYSVOL perspective) over a period of time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;This issue has also been seen during the Restore of a Domain Controller from backup or during a failed attempt to move SYSVOL to another volume as per this article&amp;nbsp;&lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/842162"&gt;&lt;span style="font-size: small;"&gt;http://support.microsoft.com/kb/842162&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3339707" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/NTFRS_5F00_CMD_5F00_FILE_5F00_MOVE_5F00_ROOT/">NTFRS_CMD_FILE_MOVE_ROOT</category></item><item><title>Windows 2008 R2 Domain Controller Backup Lifetime advice</title><link>http://blogs.technet.com/b/carlh/archive/2009/12/23/windows-2008-r2-domain-controller-backup-lifetime-advice.aspx</link><pubDate>Wed, 23 Dec 2009 14:21:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3302254</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3302254</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/12/23/windows-2008-r2-domain-controller-backup-lifetime-advice.aspx#comments</comments><description>&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;I was asked why we recommend not using backups older than the lesser of TSL and Deleted Lifetime and below is my interpretation of the answer I got from a reputable source.&lt;/P&gt;
&lt;P&gt;There are 2 main reasons we advise not using backups longer than the lesser of Deleted Lifetime and Tombstone Lifetime.&lt;/P&gt;
&lt;P&gt;The first reason is very much the same as it has always been. We don’t want the possibility of introducing Lingering Objects. Basically, if you do a restore older than TSL this will introduce what the replication engine perceives as Lingering Objects and Strict Replication Consistency will kick in and stop Replication. Although the objects should disappear and not cause an issue in most circumstances, you still have replication failed and will have to use non recommended methods of getting it going again (i.e. “Allow Replication with Divergent or Corrupt Partner” registry Hack).&lt;/P&gt;
&lt;P&gt;The second reason is more to do with the way group memberships are stored in the Link Table for Deleted objects in Windows 2008 R2 with the Recycle Bin feature enabled. Basically, when an object is removed from a group, the Link table (in the database) is updated with a flag and date stamp marking the object that has been removed as “De-activated”. When an object is deleted the groups to which it was a member retain the object as a member, but another flag “Deleted” is added with the time stamp. Both the “Deleted” and “De-activated” flags effectively make the objects not visible as members of the group. In other words the Link table still has some knowledge that an object was a member of a group (remember, group membership is stored by the group not the object that is a member of a group). This enables the ability to ensure that when an object is undeleted it gets added back to any groups it used to be a member of. The “De-activated” and “Deleted” flag is removed from the Link Table after Deleted Lifetime (i.e. as an object becomes a Recycled object; Tombstoned in previous versions). If a backup older than Deleted Lifetime is used then we will not get group membership back of objects as expected (at best), at worst we could have inconsistent link tables across DC’s (although this is a slim chance and needs certain circumstances to occur. Of which I am not sure if I totally understand).&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3302254" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/Backup+Lifetime/">Backup Lifetime</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Deleted+Lifetime/">Deleted Lifetime</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Tombstone+Lifetime/">Tombstone Lifetime</category></item><item><title>Online Kernel Memory Dump using LiveKd.exe</title><link>http://blogs.technet.com/b/carlh/archive/2009/11/30/online-kernel-memory-dump-using-livekd-exe.aspx</link><pubDate>Mon, 30 Nov 2009 16:14:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3297273</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3297273</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/11/30/online-kernel-memory-dump-using-livekd-exe.aspx#comments</comments><description>&lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;span style="color: black; mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;How many times have you had to acquire a kernel memory dump, but you or your customer (quite rightly) refuses to have the target system attached to the internet (which usually needed to download the symbol files). Well, I have had the dubious pleasure 3 times in the past 3 months. So, to remind me of the process I decided to write it down for future reference. If you know this already, sorry to waste your time, but for everyone else it’s one for your cerebral index.            &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="color: black; mso-ascii-font-family: calibri; mso-hansi-font-family: calibri; mso-bidi-font-family: calibri; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;Firstly you need to get the correct symbols files for the kernel memory dump, and just downloading the ones from WHDC or MSDN for the OS version and Service Pack version is not quite good enough, because the symbols change for each version of the kernel files that are released. There may be kernel files that have changed with Updates since the Service Pack was released.&lt;/span&gt;&lt;span style="font-family: &amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;; color: black; font-size: 10pt; mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;"&gt;            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Install the Windows Debugging Tools &lt;/span&gt;&lt;/font&gt;&lt;a href="http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx" mce_href="http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt; on the computer from which you require a kernel memory dump.            &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;2.&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Download LiveKd from &lt;/span&gt;&lt;/font&gt;&lt;a href="http://www.microsoft.com/technet/sysinternals/SystemInformation/LiveKd.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/SystemInformation/LiveKd.mspx"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;&lt;font color="#0000ff" face="tahoma,arial,helvetica,sans-serif"&gt;http://www.microsoft.com/technet/sysinternals/SystemInformation/LiveKd.mspx&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt; and on the computer that you require a Kernel Memory Dump from, uncompress it to the location that the Windows Debug Tools have been installed to (the default is &amp;quot;C:\Program Files\Debugging Tools for Windows (X86)\&amp;quot;).            &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;3.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Copy ntoskrnl.exe, ntkrnlpa.exe, kernel32.dll and ntdll.dll files (not sure if all of these are required every time, but I do it just in case) from the System32 folder of the computer to be debugged (without internet access) and copy them to a folder (e.g. c:\debugsymbols\system32) on a computer with internet access. (If the internet facing computer has the same versions of these files to the non internet facing then there is no need for this part, but the Symbol cache will be enormous and all we want is the symbol files for the kernel).            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;4.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Install the Debugging tools on the internet facing system (or copy the installed folder from the server you installed them on previously; the default is “C:\Program Files\Debugging Tools for Windows”).            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;5.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;From a command prompt on the Internet facing server, run this command:            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt 36pt" class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;     &lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt 36pt" class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;        &lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;C:\&amp;lt;path to debugging tools&amp;gt;\&lt;b style="mso-bidi-font-weight: normal"&gt;Symchk.exe&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;/if &amp;lt;path to copied file&amp;gt;\*.*&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;/s srv*&amp;lt;path to folder to store symbols locally&amp;gt;*http://msdl.microsoft.com/download/symbols&lt;/b&gt;             &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt 36pt" class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;e.g. C:\Program Files\Debugging Tools for Windows (x86)&amp;gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Symchk.exe /if c:\debugsymbols\system32\*.* /s srv*c:\debugsymbols*http://msdl.microsoft.com/download/symbols&lt;/b&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt 36pt" class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin"&gt;        &lt;/span&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;6.&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Copy the cached symbols (i.e. the c:\debugsymbols folder and its new contents, minus the \system32 folder with the 4 exe\dll’s in it) from the internet facing server to the original server.            &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;7.&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;On the computer that you require a Kernel Memory Dump from, Open &lt;b style="mso-bidi-font-weight: normal"&gt;WinDbg&lt;/b&gt;, click on the &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&amp;quot;File&amp;quot;&lt;/b&gt; menu, and choose &lt;b style="mso-bidi-font-weight: normal"&gt;&amp;quot;Symbol Search Path&amp;quot;&lt;/b&gt;. Enter the following path &lt;b style="mso-bidi-font-weight: normal"&gt;SRV*c:\debugsymbols*&lt;/b&gt; and click Ok. Close Windbg.exe.             &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;8.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;With Administrator privileges, open a Command prompt and navigate to the WinDbg installation folder (e.g&lt;b style="mso-bidi-font-weight: normal"&gt;. C:\Program Files\Debugging Tools for Windows (X86)\&lt;/b&gt;) if this is where you expanded LiveKd to and run &lt;b style="mso-bidi-font-weight: normal"&gt;livekd.exe&lt;/b&gt;.              &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;9.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Type “&lt;b style="mso-bidi-font-weight: normal"&gt;.dump&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;-f c:\memory.dmp”&lt;/b&gt; (without the quotes) to generate the Complete Memory Dump on the C: drive (you will need to make sure there is enough space on this drive).              &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;10.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;Type &lt;b style="mso-bidi-font-weight: normal"&gt;q&lt;/b&gt; to quit LiveKD.             &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt" class="MsoListParagraph"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;span style="font-size: 10pt; mso-bidi-font-family: calibri; mso-fareast-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-fareast-theme-font: minor-latin"&gt;&lt;span style="mso-list: ignore"&gt;11.&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&lt;font size="2"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-size: 11.0pt"&gt;You should find memory.dmp in the root of c:\&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;   &lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p style="margin: 0cm 0cm 10pt" class="MsoNormal"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;Your work is now complete and you can compress and deliver the kernel dump for analysis.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3297273" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/livekd-exe/">livekd.exe</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/livekd/">livekd</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Kernel+Memory+Dump/">Kernel Memory Dump</category></item><item><title>Dual Boot from VHD</title><link>http://blogs.technet.com/b/carlh/archive/2009/08/18/dual-boot-from-vhd.aspx</link><pubDate>Tue, 18 Aug 2009 11:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3274601</guid><dc:creator>carl h2</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3274601</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/08/18/dual-boot-from-vhd.aspx#comments</comments><description>&lt;P&gt;When Windows 7 Beta came out, a colleague and I decided that the being able to dual boot from a VHD file would be useful for demos and to test Windows7 and Windows Server 2008 R2, due to the ability to replace and service VHD files pretty much at will (VHD files can be mounted as volumes in Vista &lt;A href="http://blogs.msdn.com/cschotte/archive/2008/03/26/how-to-mount-a-vhd-quickly-under-vista-using-your-mouse.aspx" mce_href="http://blogs.msdn.com/cschotte/archive/2008/03/26/how-to-mount-a-vhd-quickly-under-vista-using-your-mouse.aspx"&gt;http://blogs.msdn.com/cschotte/archive/2008/03/26/how-to-mount-a-vhd-quickly-under-vista-using-your-mouse.aspx&lt;/A&gt; and it is even easier in Windows 7 using the task Attach VHD in Disk Management). So I pulled together some information from various sources and wrote a script (BootFromVHD.vbs) to come up with a process that quickly enables booting from a VHD file.&lt;/P&gt;
&lt;P&gt;This method does not provide any way of single booting from a VHD and assumes that either Windows 7\Windows Server 2008 R2 are already installed and running.&lt;/P&gt;
&lt;H3&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Create a VHD&lt;/FONT&gt;&lt;/U&gt;&lt;/H3&gt;
&lt;P&gt;To start with a VHD is required and this will only work with a Windows 7 or Windows Server 2008 R2 VHD. I personally found it easier to create a vanilla Windows Server 2008 R2 (in my case; but it works equally well with Windows 7) virtual guest in Windows Server 2008 Hyper-V with a fixed disk size. Then while the guest virtual computer is still running on the Hyper-V server I ran the following command from an elevated (administrator) command prompt within the guest &lt;B&gt;“c:\windows\system32\sysprep\sysprep /generalize /oobe /shutdown”&lt;/B&gt;. This basically, re-bases the image and removes anything specific to the hardware it was built on (in this case a virtual environment).&lt;/P&gt;
&lt;P&gt;Alternatively, you could use this method to create a VHD from a WIM image.&lt;/P&gt;
&lt;P&gt;1. Download Win7 WAIK - &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. Download WIM2VHD - &lt;A href="http://code.msdn.microsoft.com/wim2vhd" mce_href="http://code.msdn.microsoft.com/wim2vhd"&gt;http://code.msdn.microsoft.com/wim2vhd&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;3. Windows 7 or Windows 2008 R2 installation media required.&lt;/P&gt;
&lt;P&gt;4. Install WAIK on a Windows 7 client&lt;/P&gt;
&lt;P&gt;5. Run WIM2VHD using this command line (this can be modified for Win7 or other version of 2008 R2; see the examples on the WIM2VHD page): &lt;/P&gt;
&lt;P&gt;&lt;B&gt;cscript wim2vhd.wsf /wim:&lt;I&gt;path &lt;/I&gt;/sku:serverstandard /vhd:&lt;I&gt;path &lt;/I&gt;/size:15360 /disktype:fixed &lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Once you have a VHD file it needs to be copied to the hardware from which it will boot.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;Very Important Notes&lt;/I&gt;&lt;/B&gt;&lt;B&gt;&lt;I&gt;:&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;I&gt;The VHD can reside in a folder on the volume on which you copy it, but the VHD needs to reside on a volume that does not have Bitlocker enabled.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;Also, the VHD needs to be less than the size of the partition it is stored on minus the Pagefile size (VHD size + PageFile Size &amp;lt;= Storage partition Size).&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;Booting from VHD does not work with VHD’s created in Virtual PC.&lt;/I&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;If the VHD is dynamically expanding, when it first opens it will convert to a full fixed size VHD and this may take a very long time. This will fail if the volume the VHD sits on is not sized correctly see note above. &lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;This is a vanilla install and will result in the “out of the box” installation running to configure for your hardware. You may need to provide drivers to get it all working. &lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;Each tool provides its own instructions on how it works and what changes will be made.&lt;/I&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;H3&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;Add an entry in the BCD to boot from the VHD&lt;/FONT&gt;&lt;/U&gt;&lt;/H3&gt;
&lt;P&gt;This can be done manually by using an elevated command prompt in the original operating system on the computer using the Windows 7 version of BCDEdit.exe, or by script (VBScript or PowerShell). I did tried to write a VBScript that uses just WMI to carry out this task, but unfortunately I couldn’t get the BCDEdit WMI provider to recognise that I had created a new entry for the rest of the script to edit. So, I went with the method of calling BCDEdit.exe from within the VBScript.&lt;/P&gt;
&lt;P&gt;I won’t explain the method of doing this manually, but will provide the script below. Please be aware that I or my employer holds no responsibility for your using this script and the outcomes thereof and I provide the code without guarantees or warranties (basically, test it prior to using it and ensure you are happy with what it is doing; myself and many of my colleagues have used this and have only seen one failure; which was not terminal). The script does create a backup of your existing BCD and will roll back any changes if any errors are encountered. If for some reason you want to roll back the BCD changes all you need to do is run “&lt;B&gt;bcdedit /import c:\bcdbackup&lt;/B&gt;” from an elevated command prompt.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Notes&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The script needs to be run using cscript in an elevated command prompt. &lt;/LI&gt;
&lt;LI&gt;Carefully read the instructions of each popup dialog box to ensure you input the correct information. Firstly you must provide a name for the BCD entry and secondly the location of the VHD does not require the drive specifier (the bootloader will find what volume the file is stored on at boot time). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*************************************************************************************************************&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* bcdbootfromvhd.vbs&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Purpose: Creates a new BCD Boot Loader Entry by copying an&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* existing entry and making changes&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Parms: None.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Requires: To be run on Vista\Windows 7 or Windows Server 2008 (R2) to access BcdStore using&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* BCDEDIT and WMI.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* References: 1) Vista Software Development Kit.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* 2) MSDN Library, "Boot Configuration Data (BCD)" at&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* http://msdn2.microsoft.com/en-us/library/aa362692.aspx &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* 3) "Boot Configuration Data in Windows Vista" at&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/BCD.doc&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Note : This function should be invoked as a cscript.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Issue the command "cscript //h:cscript" to set the&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* default scripting as cscript before issuing this&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* command.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'* Author : Carl Harrison&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'*************************************************************************************************************&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Option Explicit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;On Error Resume Next&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim strComputer&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim strNewLoaderGUID&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim strVHDPath, strBootEntryName&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim objStoreClass, objStore, objDefault, objElement&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim objShell, objBCDEditCopyCmd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim strCommandOutputReadLine&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Dim varDefaultLoader&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Const BcdLibraryString_Description = &amp;amp;h12000004&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Const Current = "{fa926493-6f1c-4193-a414-58f0b2456d1e}"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Const WindowsImages = &amp;amp;h10200003&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;strComputer = "."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Connect to the BCD store with WMI&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Set objStoreClass = GetObject("winmgmts:{(Backup,Restore)}\\" &amp;amp; strComputer &amp;amp; "\root\wmi:BcdStore")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;if not objStoreClass.OpenStore("", objStore) then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Couldn't open the system store!"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;end if&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Get some info about the current booted OS from the BCD&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'We are going to use it later&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;objStoreClass.OpenStore "", objStore&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;objStore.OpenObject Current, objDefault&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;objDefault.GetElement BcdLibraryString_Description, objElement&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Set objShell = CreateObject("Wscript.Shell")&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Get a backup of the existing BCD&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Set objBCDEditCopyCmd = objShell.Exec("bcdedit /export c:\bcdbackup")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If Instr(objBCDEditCopyCmd.StdOut.ReadAll,"The operation completed successfully.") &amp;lt;&amp;gt; 0 then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "BCD Backup was created successfully"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Failed to create BCD Backup"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Script is Exiting"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Popup dialog to ask for the BCD entry human friendly name&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'We don’t accept blanks&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;strBootEntryName = InputBox ("Name of Boot loader entry at Start Up e.g. Windows 7")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If strBootEntryName = "" then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Blank Loader Entry Name is not accepted."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "ROLLING BACK CHANGES"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objBCDEditCopyCmd = objShell.Exec("bcdedit /import C:\bcdbackup")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Now copy the existing current BCD entry and determine the new GUID of the new BCD entry&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Set objBCDEditCopyCmd = objShell.Exec("bcdedit /copy " &amp;amp; objElement.ObjectID &amp;amp; " /d " &amp;amp; """" &amp;amp; strBootEntryName &amp;amp; """")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Do While Not objBCDEditCopyCmd.StdOut.AtEndOfStream&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strCommandOutputReadLine = objBCDEditCopyCmd.StdOut.ReadLine()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Instr(strCommandOutputReadLine, "The entry was successfully copied to") &amp;lt;&amp;gt; 0 Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strNewLoaderGUID = Left(Right(strCommandOutputReadLine,39),38)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Loop&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;WScript.Echo "New Loader GUID = " &amp;amp; strNewLoaderGUID&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;WScript.Echo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If strNewLoaderGUID = "" Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo strComputer &amp;amp; vbTAB &amp;amp; "Could not Copy OS Loader."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Popup dialog to get the location and name of the vhd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'The BCD does not need a drive specification&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'We do not accept blank entries&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;strVHDPath = InputBox ("Please provide the path, excluding drive letter and colon and file name of the VHD to boot from (use quotes if there are spaces). So if the path to the vhd is d:\win7.vhd just type \win7.vhd")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If strVHDPath = "" then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Blank path is not accepted for " &amp;amp; strNewLoaderGUID&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "ROLLING BACK CHANGES"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objBCDEditCopyCmd = objShell.Exec("bcdedit /import C:\bcdbackup")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'Ok now call the sub setBCDEdit and pass it the necessary parameters to make changes to the newly copied BCD entry&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Call setBCDEdit ("/set " &amp;amp; strNewLoaderGUID &amp;amp; " device vhd=[locate]" &amp;amp; strVHDPath, "device partition", strVHDPath)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Call setBCDEdit ("/set " &amp;amp; strNewLoaderGUID &amp;amp; " osdevice vhd=[locate]" &amp;amp; strVHDPath, "osdevice partition", strVHDPath)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Call setBCDEdit ("/set " &amp;amp; strNewLoaderGUID &amp;amp; " resumeobject " &amp;amp; strNewLoaderGUID, "resumeObject", strNewLoaderGUID)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Call setBCDEdit ("/set " &amp;amp; strNewLoaderGUID &amp;amp; " detecthal on", "detecthal value", "on")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Call setBCDEdit ("/set " &amp;amp; strNewLoaderGUID &amp;amp; " nx OptIn", "nx value", "optin")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;varDefaultLoader = MsgBox ("Do you want this to be the default booting OS?", vbYesNo)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If varDefaultLoader = vbYes Then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call setBCDEdit ("/default " &amp;amp; strNewLoaderGUID, "boot loader", "Default")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Wscript.Echo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;'This Sub accepts parameters from the calling line and inserts them into the subsequent bcdedit command line before running them&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Sub setBCDEdit (strCmdswitch, strSwitchDescription, strSwitchSetting)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Set objBCDEditCopyCmd = objShell.Exec("bcdedit " &amp;amp; strCmdSwitch)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;If Instr(objBCDEditCopyCmd.StdOut.ReadAll,"The operation completed successfully.") &amp;lt;&amp;gt; 0 then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "The " &amp;amp; strSwitchDescription &amp;amp; " for the new Boot Loader " &amp;amp; strNewLoaderGUID &amp;amp; " was successfully set to " &amp;amp; strSwitchSetting&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "Failed to set the " &amp;amp; strSwitchDescription &amp;amp; " for the new Boot Loader to " &amp;amp; strSwitchSetting&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Echo "ROLLING BACK CHANGES"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objBCDEditCopyCmd = objShell.Exec("bcdedit /import C:\bcdbackup")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WScript.Quit&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3274601" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/Dual+Boot/">Dual Boot</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/bcdedit/">bcdedit</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/VHD/">VHD</category></item><item><title>Dual Boot Vista with Windows Server 2008</title><link>http://blogs.technet.com/b/carlh/archive/2009/07/06/dual-boot-vista-with-windows-server-2008.aspx</link><pubDate>Mon, 06 Jul 2009 16:14:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3261509</guid><dc:creator>carl h2</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3261509</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/07/06/dual-boot-vista-with-windows-server-2008.aspx#comments</comments><description>&lt;P align=justify&gt;Some time ago I built my laptop with dual boot and had a few issues along the way. I thought it might be worth sharing, but have only just got round to sharing this information. This information works equally as well with Windows 7 and Windows Server 2008 R2.&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;ISSUE 1 (Bitlocker PIN enabling for Dual boot partitions that may not be on a domain)&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;I wanted to dual boot with Vista x64 and Windows 2008 (actually triple boot, but this information is useful all ways). And I wanted all partitions (with the exception of the boot partition) to be protected with Bitlocker. I couldn’t seem to get Bitlocker to use a PIN for all boot partitions (the other 2 partitions were not going to live on any domain; well not immediately anyway).&lt;/P&gt;
&lt;P align=justify&gt;Unfortunately, I had blindly enabled Bitlocker before ensuring the Advanced Settings were enabled (this can be set to be enabled by default on a domain), which allows the setting of a PIN or USB key. Further it was looking increasingly like I had to decrypt the partition, enable the advanced settings and then re-encrypt (while at the same time setting a PIN). I did a little bit of searching around and came up with the following (in essence you can enable Advanced Bitlocker settings post encryption (the easy bit) and then create a PIN afterwards (even easier, but not well known)).&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;Enable Advanced Bitlocker Settings &lt;/B&gt;As per points 1 -6 in Section “&lt;STRONG&gt;To turn on BitLocker Drive Encryption with a TPM plus a PIN or with a TPM plus a startup key on a USB flash drive&lt;/STRONG&gt;” in this article &lt;A href="http://technet.microsoft.com/en-us/library/cc766295.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc766295.aspx"&gt;http://technet.microsoft.com/en-us/library/cc766295.aspx&lt;/A&gt; (extract below)&lt;/P&gt;
&lt;P align=justify&gt;1. Click &lt;STRONG&gt;Start&lt;/STRONG&gt;, type &lt;STRONG&gt;gpedit.msc &lt;/STRONG&gt;in the &lt;STRONG&gt;Start Search&lt;/STRONG&gt; box, and then press ENTER&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P align=justify&gt;2. If the &lt;STRONG&gt;User Account Control&lt;/STRONG&gt; dialog box appears, verify that the proposed action is what you requested, and then click &lt;STRONG&gt;Continue&lt;/STRONG&gt;. For more information, see &lt;A href="http://technet.microsoft.com/en-us/library/cc766295.aspx#BKMK_addres" mce_href="http://technet.microsoft.com/en-us/library/cc766295.aspx#BKMK_addres"&gt;Additional Resources&lt;/A&gt; later in this document.&lt;/P&gt;
&lt;P align=justify&gt;3. In the &lt;STRONG&gt;Group Policy Object Editor &lt;/STRONG&gt;console tree, click &lt;STRONG&gt;Local Computer Policy&lt;/STRONG&gt;, click &lt;STRONG&gt;Administrative Templates&lt;/STRONG&gt;, click &lt;STRONG&gt;Windows Components&lt;/STRONG&gt;, and then double-click &lt;STRONG&gt;BitLocker Drive Encryption&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P align=justify&gt;4. Double-click the setting &lt;STRONG&gt;Control Panel Setup: Enable Advanced Startup Options&lt;/STRONG&gt;. The &lt;STRONG&gt;Control Panel Setup: Enable Advanced Startup Options&lt;/STRONG&gt; dialog box appears.&lt;/P&gt;
&lt;P align=justify&gt;5. Select the &lt;STRONG&gt;Enabled&lt;/STRONG&gt; option. For TPM plus a PIN or startup key configurations, you do not need to change any further settings, but you can choose to require or disallow users to create a startup key or PIN. Click &lt;STRONG&gt;OK&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P align=justify&gt;6. Click &lt;STRONG&gt;Start&lt;/STRONG&gt;, type &lt;STRONG&gt;gpupdate.exe /force &lt;/STRONG&gt;in the &lt;STRONG&gt;Search&lt;/STRONG&gt; box, and then press ENTER. Wait for the process to finish.&lt;/P&gt;
&lt;P align=justify&gt;This doesn’t give you the Option\Dialog to set\create a PIN when the volume is already encrypted, which is a bit of a pain.&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;Create a PIN for the partition&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;1. Open a Command prompt as Administrator&lt;/P&gt;
&lt;P align=justify&gt;2. Use the following command “c&lt;B&gt;script %systemroot%\system32\manage-bde.wsf –protectors –add %systemdrive% -tpmandpin &amp;lt;4-20 digit numeric PIN&amp;gt;&lt;/B&gt;” (without the quotes)&lt;/P&gt;
&lt;P align=justify&gt;3. Now to be really sure the PIN is was you want it to be and you don’t trust what you typed in replacement for&amp;nbsp; &amp;lt;4-20 digit numeric PIN&amp;gt; above, Open &lt;B&gt;Control Panel | Security | Bitlocker Drive Protection&lt;/B&gt; and choose &lt;B&gt;Manage Bitlocker Keys&lt;/B&gt; for the current Volume, and there should now be a &lt;B&gt;Reset PIN&lt;/B&gt; option.&lt;/P&gt;
&lt;P align=justify&gt;4. Job done. Told you is was even easier (easier being less clicks of the mouse).&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;ISSUE 2 (well not really an issue, but something that might help in sorting out the list of OS’s of the bootloader)&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;So, I installed Vista x64 then Windows 2008 and another Vista (x86 this time); don’t ask me why I just did, and it suits my needs. The bootloader initial screen showed the really Useful choices of&lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Vista&lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Server 2008&lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Vista&lt;/P&gt;
&lt;P align=justify&gt;Which was which Vista, well in time I got used to it and the domain connected one was the default, but due to my installation order it was the third in the list; not very intuitive methinks.&lt;/P&gt;
&lt;P align=justify&gt;What I really wanted was &lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Vista x64&lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Server 2008&lt;/P&gt;
&lt;P align=justify&gt;Microsoft Windows Vista x86&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;Firstly the following can be used to reorder the display list&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;Open a Command prompt as Administrator&lt;/P&gt;
&lt;P align=justify&gt;Before you do anything backup your BCD by using &lt;B&gt;bcdedit /export “c:\bcdbackup1”&lt;/B&gt; (where C: is the volume your working on). If you make any mistakes in the next bits you can restore it by using &lt;B&gt;bcdedit /import “c:\bcdbackup1”&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;This simply changes the order in which bootloader displays the OS’s &lt;B&gt;bcdedit /displayorder {ID1} ID2} {ID3}&lt;/B&gt; where {ID1}, {ID2} and {ID3} can be determined by typing just &lt;B&gt;bcdedit&lt;/B&gt; at the command prompt and noting the entries adjacent to displayorder. Just put them in the order that you want them when creating the command line above e.g. my display order under Windows BootMgr looked like this&amp;nbsp; (where {current} is the primary x64 install of Vista. It will show as {default} if bcdedit is run in any of the other OS’s and {current } will obviously be the current OS you are working in. Be aware of this and use the exact GUID or words that are listed opposite displayorder, otherwise there will be tears)&lt;/P&gt;
&lt;P align=justify&gt;&lt;A href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage001.jpg" mce_href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage001.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=DualBootImage001 border=0 alt=DualBootImage001 src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/DualBootImage001_3.jpg" width=534 height=205 mce_src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/DualBootImage001_3.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P align=justify&gt;But I wanted it to look like this&lt;/P&gt;
&lt;P align=justify&gt;&lt;A href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage002.jpg" mce_href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage002.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image004 border=0 alt=clip_image004 src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/clip_image004_3.jpg" width=533 height=203 mce_src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/clip_image004_3.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=justify&gt;And this is the command line I used &lt;B&gt;bcdedit /displayorder {current} {3bfc9072-594d-11dd-8d96-c955ae3305ea} {cf632714-6411-11dd-95e7-d088af2f2b01}&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;Secondly lets rename the entries in the list (it would be useful if the x64 installation displayed as “Microsoft Windows Vista x64” and the x86 version likewise)&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;Open a Command prompt as Administrator&lt;/P&gt;
&lt;P align=justify&gt;Before you do anything backup your BCD by using &lt;B&gt;bcdedit /export “c:\bcdbackup2”&lt;/B&gt; (where C: is the volume your working on). If you make any mistakes in the next bits you can restore it by using &lt;B&gt;bcdedit /import “c:\bcdbackup2”&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;To change the display name in the bootloader list type the following at the command prompt &lt;B&gt;bcdedit –set {current} DESCRIPTION “Microsoft Windows Vista x64”&lt;/B&gt; (the quotes are needed and {current } is the entry I wanted to change. If the Identifier is a GUID or {default} use that). And this is what you see when you run bcdedit again.&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;A href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage003.jpg" mce_href="http://cid-d4b03bea4f96c806.skydrive.live.com/self.aspx/Blog%20Images/DualBootImage003.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image006 border=0 alt=clip_image006 src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/clip_image006_3.jpg" width=534 height=176 mce_src="http://blogs.technet.com/blogfiles/carlh/WindowsLiveWriter/DualBootingVistaWindows7withWindowsServe_BAA1/clip_image006_3.jpg"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3261509" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/Dual+Boot/">Dual Boot</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/bcdedit/">bcdedit</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Bitlocker/">Bitlocker</category></item><item><title>Active Directory Dynamic Objects</title><link>http://blogs.technet.com/b/carlh/archive/2009/07/06/active-directory-dynamic-objects.aspx</link><pubDate>Mon, 06 Jul 2009 14:05:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3261469</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3261469</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/07/06/active-directory-dynamic-objects.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;What is a dynamic object? A dynamic object is an auxiliary class introduced in Windows Server 2003 that can be linked to most other object classes in Active Directory (as a class extension). Basically, by specifying that an object is of objectClass type dynamicObject (together with its normal class), it will get a number of extra attributes that effectively affect the characteristics of the object. This is detailed in RFC 2589 &lt;A href="http://www.faqs.org/rfcs/rfc2589.html" mce_href="http://www.faqs.org/rfcs/rfc2589.html"&gt;http://www.faqs.org/rfcs/rfc2589.html&lt;/A&gt; . It is useful to note that existing objects cannot be converted to Dynamic Objects and the specification of the dynamicObject extension class should be made at object creation time. The use of dynamicObjects was primarily introduced for use in application development and to be used in Application Partitions (Naming Contexts).&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5874bc3f-ec24-455a-9800-74fbb78a5bc2 class=wlWriterEditableSmartContent&gt;Technorati Tags: &lt;A href="http://technorati.com/tags/dynamicObject" rel=tag mce_href="http://technorati.com/tags/dynamicObject"&gt;dynamicObject&lt;/A&gt;,&lt;A href="http://technorati.com/tags/dynamic+object" rel=tag mce_href="http://technorati.com/tags/dynamic+object"&gt;dynamic object&lt;/A&gt;,&lt;A href="http://technorati.com/tags/entryTTL" rel=tag mce_href="http://technorati.com/tags/entryTTL"&gt;entryTTL&lt;/A&gt;,&lt;A href="http://technorati.com/tags/DynamicObjectMinTTL" rel=tag mce_href="http://technorati.com/tags/DynamicObjectMinTTL"&gt;DynamicObjectMinTTL&lt;/A&gt;,&lt;A href="http://technorati.com/tags/DynamicObjectDefaultTTL" rel=tag mce_href="http://technorati.com/tags/DynamicObjectDefaultTTL"&gt;DynamicObjectDefaultTTL&lt;/A&gt;,&lt;A href="http://technorati.com/tags/msDS-Entry-Time-To-Die" rel=tag mce_href="http://technorati.com/tags/msDS-Entry-Time-To-Die"&gt;msDS-Entry-Time-To-Die&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;When an application creates a dynamicObject, a time-to-live (TTL) value is attached to the object and it is the responsibility of the application (client side or server side) to refresh the TTL if the object is deemed to remain in the Partition. Once the TTL decrements to 0 (zero), the object will be removed, without being Tombstoned. Each domain controller is therefore responsible for deleting local dynamic objects when the TTL expires. If the object is deleted before the TTL reaches 0 (zero) the object is Tombstoned (but the objects TTL is retained and continues to decrement), and it is treated as any other Tombstone (i.e. it can be updated\changed) until the TTL reaches 0 (zero), when it will be removed from the partition (after a short delay).&lt;/P&gt;
&lt;P&gt;The TTL is specified in the constructed attribute entryTTL of a dynamicObject and the value (in seconds) can be 15 minutes (default minimum in AD; CN=DynamicObjectMinTTL, CN=Directory Service,CN=Windows NT, CN=Services, CN=Configuration, DC=&amp;lt;ForestName) to 365 days and 8 hours. If entryTTL is not specified for a newly created dynamicObject then it is assigned a default value of 24 hours (CN=DynamicObjectDefaultTTL, CN=Directory Service,CN=Winodws NT, CN=Services, CN=Configuration, DC=&amp;lt;ForestName). If an object is specified as dynamic at creation time and the entryTTL is less than that specified in Active Directory by DynamicObjectMinTTL, then the object will have an entryTTL as specified by DynamicObjectMinTTL i.e. the lower value will be ignored. The actual value of entryTTL is calculated from the value stored in msDS-Entry-Time-To-Die, which contains the date and time that the object will be deleted.&lt;/P&gt;
&lt;P&gt;It is worth noting that the Dynamic Object Auxiliary Class, although seemingly perfect for objects stored in DNS Application Partitions, are not actually used in the DNS Application Partitions.&lt;/P&gt;
&lt;P&gt;I carried out some rudimentary testing of the characteristics of dynamicObjects (container and objects) and it was interesting to see that dynamic container objects that have an entryTTL that is lower than descendent objects (i.e. child objects of a container have higher entryTTL values), will decrement to 0 (zero), but will then assume the calculated value of entryTTL of the object with the highest calculated entryTTL contained in it. So, a dynamic container object will not be automatically deleted before child dynamic Objects.&lt;/P&gt;
&lt;P&gt;You can do some rudimentary testing of dynamicObjects (containers or objects) by just creating an object and specifying the objectClass of dynamicObject at creation time. You can then monitor what happens to the object (and entryTTL) in certain scenarios using LDP. I found the easiest way to create dynamic container Objects for testing was to use LDIFDE and supplying it with an ldf file named createdynamicobjectcontainer.ldf with the following entries:-&lt;/P&gt;
&lt;P&gt;dn: cn=test,dc=domain,dc=local&lt;/P&gt;
&lt;P&gt;changetype: add&lt;/P&gt;
&lt;P&gt;objectClass: container&lt;/P&gt;
&lt;P&gt;objectClass: dynamicObject&lt;/P&gt;
&lt;P&gt;entryTTL: 900&lt;/P&gt;
&lt;P&gt;The command line to create the container is “&lt;B&gt;ldifde -v -i -f createdynamicobjectcontainer.ldf /j c:\&lt;/B&gt;”&lt;/P&gt;
&lt;P&gt;You can then create a dynamic object under the dynamic container by using an ldf file named createdynamicobject.ldf with the following entries:-&lt;/P&gt;
&lt;P&gt;dn: cn=jsmith,cn=test,dc=domain,dc=local&lt;/P&gt;
&lt;P&gt;changetype: add&lt;/P&gt;
&lt;P&gt;objectClass: user&lt;/P&gt;
&lt;P&gt;objectClass: dynamicObject&lt;/P&gt;
&lt;P&gt;entryTTL: 900&lt;/P&gt;
&lt;P&gt;sAMAccountName: jsmith&lt;/P&gt;
&lt;P&gt;The command line to create the object is “&lt;B&gt;ldifde -v -i -f createdynamicobject.ldf /j c:\&lt;/B&gt;”&lt;/P&gt;
&lt;P&gt;This information was harvested from these links and references&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.faqs.org/rfcs/rfc2589.html" mce_href="http://www.faqs.org/rfcs/rfc2589.html"&gt;http://www.faqs.org/rfcs/rfc2589.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc223463(PROT.10).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc223463(PROT.10).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc223463(PROT.10).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc223446(PROT.10).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc223446(PROT.10).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc223446(PROT.10).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc200600(PROT.10).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc200600(PROT.10).aspx"&gt;http://msdn.microsoft.com/en-us/library/cc200600(PROT.10).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc201014.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc201014.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc201014.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://my.safaribooksonline.com/0596004648/activedckbk-CHP-4-SECT-14#X2ludGVybmFsX1NlY3Rpb25Db250ZW50P3htbGlkPTA1OTYwMDQ2NDgvYWN0aXZlZGNrYmstQ0hQLTQtU0VDVC0xNg" mce_href="http://my.safaribooksonline.com/0596004648/activedckbk-CHP-4-SECT-14#X2ludGVybmFsX1NlY3Rpb25Db250ZW50P3htbGlkPTA1OTYwMDQ2NDgvYWN0aXZlZGNrYmstQ0hQLTQtU0VDVC0xNg"&gt;http://my.safaribooksonline.com/0596004648/activedckbk-CHP-4-SECT-14#X2ludGVybmFsX1NlY3Rpb25Db250ZW50P3htbGlkPTA1OTYwMDQ2NDgvYWN0aXZlZGNrYmstQ0hQLTQtU0VDVC0xNg&lt;/A&gt;==&lt;/P&gt;
&lt;P&gt;Inside Active Directory (Second Edition) – A system Administrators Guide - ISBN-10: 0321228480&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3261469" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/objectClass/">objectClass</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/dynamicObject/">dynamicObject</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/dynamic+object/">dynamic object</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/entryTTL/">entryTTL</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/DynamicObjectMinTTL/">DynamicObjectMinTTL</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/DynamicObjectDefaultTTL/">DynamicObjectDefaultTTL</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/msDS_2D00_Entry_2D00_Time_2D00_To_2D00_Die/">msDS-Entry-Time-To-Die</category></item><item><title>“Squeaky Lobster” - Monitoring Version Store Counters</title><link>http://blogs.technet.com/b/carlh/archive/2009/06/17/squeaky-lobster-monitoring-version-store-counters.aspx</link><pubDate>Wed, 17 Jun 2009 23:06:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3255968</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3255968</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/06/17/squeaky-lobster-monitoring-version-store-counters.aspx#comments</comments><description>&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;If you read nothing else in this blog post take a look at this&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://msexchangeteam.com/archive/2006/06/15/427966.aspx" mce_href="http://msexchangeteam.com/archive/2006/06/15/427966.aspx"&gt;&lt;SPAN style="mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;FONT size=3 face=Calibri&gt;http://msexchangeteam.com/archive/2006/06/15/427966.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Recently I was faced with a situation where a DC was receiving Event ID 623 events in the Directory Services eventlog. I had to quite a bit of searching for information on these events and came to the conclusion that AD guys don’t seem to have as many issues with the AD database as much as the Exchange guys. The reason I came to this conclusion, is that the majority of the information that relates to the JET database (or at least to the Version Store) that services both AD and Exchange is written in an Exchange context. Basically, the event relates to Version Store Exhaustion.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3 face=Calibri&gt;So before we go any further I thought I’d better refresh on what the Version Store is and found a couple of explanations. The official explanation is here &lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://technet.microsoft.com/en-us/library/cc772829.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc772829.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB"&gt;&lt;FONT size=3 face=Calibri&gt;http://technet.microsoft.com/en-us/library/cc772829.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB"&gt; &lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB"&gt;, but I prefer simpler wording (being a simple guy) and think this article helps my understanding better&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; “What is Version Store?” - &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://msexchangeteam.com/archive/2006/04/19/425722.aspx" mce_href="http://msexchangeteam.com/archive/2006/04/19/425722.aspx"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3 face=Calibri&gt;http://msexchangeteam.com/archive/2006/04/19/425722.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; ; yes I know it’s by Exchange guys, but that’s how this research generally panned out and it is still relevant. This is an extract and there is also a pretty good explanation of the event ID 623 in the rest of the article.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The Version Store keeps an in-memory list of modifications made to the database. This list has several uses: &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Rollback - If a transaction needs to rollback it looks in the Version Store to get the list of operations it performed. By performing the inverse of all the operations the transaction can be rolled-back.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Write-conflict detection - If two different sessions try to modify the same record the Version Store will notice and reject the second modification.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Repeatable reads - When a session begins a transaction it always sees the same view of the database, even if other sessions modify the records it is looking at. When a session reads a record the Version Store is consulted to determine what version of the record the session should see.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Deferred before-image logging - A complicated optimization that lets us log less data than "other" database engines.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In simple terms, the Version Store is where transactions are held in memory until they can be written to disk.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If something is preventing us from completing transaction or writing to disk we will consume this cache and the store will stop responding to request until there is room in the cache again.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;By default the maximum amount of memory that can be allocated to the Version Store is the lesser of one fourth the amount of physical memory or 100Mb. This can be increased, but it is advised that this is a temporary solution to ease a specific issue. &lt;I&gt;&lt;SPAN style="mso-ansi-language: EN-US" lang=EN-US&gt;HKLM\&lt;B&gt;SYSTEM\CurrentControlSet\Services\NTDS\Parameters\”EDB max ver pages (increment over the minimum&lt;/B&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="mso-ansi-language: EN-US" lang=EN-US&gt;)” and it is a REG_DWORD. This value represents 16kbyte pages, e.g. a value of 1000 would be 1000 x 16kbytes.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Anyway, back to the reason for this article. I had my suspicions what was causing the 623 events (combination of an automated provisioning solution and\or Garbage Collection of ridiculous amounts of tombstones (another story) and underspec hardware; it was old tin). So, I decided that firstly, we needed to get some performance data, but the performance counters for monitoring the Version Store are not readily available and I needed to do some searching. Once again the majority of the information I found came from Exchange resources, but I found this &lt;/FONT&gt;&lt;A href="http://technet.microsoft.com/en-us/library/cc961947.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc961947.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;http://technet.microsoft.com/en-us/library/cc961947.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; which relates to Windows 2000, but is still valid. The results of the findings I will have to leave for another article.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To be able to view the allocated (16kb) pages of the version store you will need to carry out the following process:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Copy the performance DLL (Esentprf.dll) located in &lt;I&gt;SystemRoot\&lt;/I&gt; System32 to any directory (for example, C:\Perf).&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Run Regedit.exe, and make sure that the following registry subkeys exist: &lt;BR&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ESENT &lt;BR&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ESENT\Performance &lt;BR&gt;If these subkeys do not exist, you need to create them. &lt;BR&gt;For more information about creating registry subkeys, see Windows&amp;nbsp;2000 Server Help. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Make sure that, under the Performance subkey, the registry values that have the following settings exist: &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-add-space: auto; mso-list: l1 level2 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;a.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;Open&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; : data type REG_SZ : &lt;B&gt;OpenPerformanceData&lt;/B&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-add-space: auto; mso-list: l1 level2 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;b.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;Collect&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; : data type REG_SZ : &lt;B&gt;CollectPerformanceData&lt;/B&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-add-space: auto; mso-list: l1 level2 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;c.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;Close&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; : data type REG_SZ : &lt;B&gt;ClosePerformanceData&lt;/B&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-add-space: auto; mso-list: l1 level2 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;d.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;Library&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; : data type REG_SZ : &lt;B&gt;c:\perf\esentprf.dll&lt;/B&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 72pt; mso-add-space: auto; mso-list: l1 level2 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;e.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;Show Advanced Counters&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt; : data type REG_DWORD : &lt;B&gt;1&lt;/B&gt; (This used to be called “&lt;B&gt;Squeaky Lobster”&lt;/B&gt; and is pretty well known in Exchange circles; interesting blog on why it was called this from Brett Shirley here &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://msexchangeteam.com/archive/2006/06/15/427966.aspx" mce_href="http://msexchangeteam.com/archive/2006/06/15/427966.aspx"&gt;&lt;SPAN style="COLOR: windowtext; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3 face=Calibri&gt;http://msexchangeteam.com/archive/2006/06/15/427966.aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; . It still works if you use “Squeaky Lobster” instead of “Show Advanced Counters” J).&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Open a command prompt and change directory to &lt;I&gt;SystemRoot&lt;/I&gt; \Winnt\System32 or to another folder that contains the files Esentperf.ini and Esentprf.hxx generated when Esentprf.dll was compiled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;5.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;(Optional) To verify that previous counter information is not present in the registry, at the command prompt, type &lt;B&gt;unlodctr.exe ESENT&lt;/B&gt; .&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt; mso-list: l1 level1 lfo2" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;6.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To load the counter information into the registry, at the command prompt run &lt;B style="mso-bidi-font-weight: normal"&gt;Lodctr.exe Esentprf.ini&lt;/B&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To view the counters for the Database object, restart Performance Monitor. The counters are under Database and the one you need to monitor the Version store size is “&lt;B style="mso-bidi-font-weight: normal"&gt;Version Buckets Allocated&lt;/B&gt;”. This will show the number of 16kbyte pages allocated in the Version Store.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3255968" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/Squeaky+Lobster/">Squeaky Lobster</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Version+Store/">Version Store</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Allow+Advanced+Counters/">Allow Advanced Counters</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/Version+Buckets+Allocated/">Version Buckets Allocated</category></item><item><title>objectClass attribute in Windows 2008 is now indexed.</title><link>http://blogs.technet.com/b/carlh/archive/2009/06/15/objectclass-attribute-in-windows-2008-is-now-indexed.aspx</link><pubDate>Mon, 15 Jun 2009 15:27:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3254937</guid><dc:creator>carl h2</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3254937</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/06/15/objectclass-attribute-in-windows-2008-is-now-indexed.aspx#comments</comments><description>&lt;P&gt;Did you know that the objectClass attribute in an Active Directory database is not Indexed in pre Windows 2008 Active Directory. This really isn’t an issue with an efficiently formed LDAP query filter such as (&amp;amp;(objectCategory=person)(objectClass=user)) which takes advantage of indexed attributes, but if you were to use a non indexed attribute such as just (objectClass=user) then your query would have to search through every object with objectClass attribute populated to see if there was a match (How many LDAP queries have you seen use this filter?). So, with a database of 100,000 objects and all you were looking for were the User Account objects (say 10,000) you would be parsing all 100,000 objects for a result set; not the most efficient search.&lt;BR&gt;So why wasn’t objectClass indexed? Well these are the reasons that a little research (and trawling through forums and blogs) has provided.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;With Windows 2000 Server the ESE was not very efficient at building indexes over data with large numbers of repeated values. That is, an index over a widely dispersed value such as GUIDs was just fine, even if it was a multi-valued attribute. An index over an attribute that contained only a few possible values (e.g., gender) was not performant, even if it was a single-valued attribute. The performance was worse in updates even more than in searches, so it wasn't an issue of avoiding searching on the attribute, but of avoiding modifying it. With objectClass indexed, object creation rate was not good. This was fixed in the version of ESE that shipped in Server 2003, but indexing on objectClass was not turned on because it would not be good for performance for installations that were upgrading from Windows 2000. With Server 2008 it is thought that the number of&amp;nbsp;environments coexisting with Windows 2000 would be low enough to allow the index on objectClass to be turned on safely and in fact Exchange Server 2007 also indexes objectClass.&lt;/LI&gt;
&lt;LI&gt;When Windows 2000 Server beta was released, Active Directory couldn’t properly Index multi-value non-unique attributes and that is specifically why objectClass isn’t indexed by default. This was changed for Windows 2000 RTM, but didn’t get included probably for the reasons above.&lt;BR&gt;Indexing this attribute can be done by viewing the properties of the attribute in the Active Directory Schema Snap-in (after registering schmmgmt.dll and ensuring you are a member of Schema Admins), and then ensuring the check box adjacent to “Index this attribute in Active Directory” is checked. Alternatively you could use JoeWares’ excellent ADFIND and ADMOD with the following command line “adfind -schema -f name=object-class searchFlags -adcsv | admod searchFlags::{{.:set:1}} –exterr”&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;It is worth being aware that indexing attributes can make queries slower. Consider the query (&amp;amp;(objectClass=user)(samAccountName=[uniquevalue])), which will execute faster if objectClass is not indexed. In both cases the query processor will end up choosing the index over samAccountName to do the enumeration, but in the case where objectClass is indexed it will waste time evaluating how tightly the objectClass index encloses the result set (answer: not very). Doing that evaluation costs time and I/O.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;The above information was harvested from the following sources&lt;BR&gt;&lt;A href="http://blog.joeware.net/2007/03/24/831/" mce_href="http://blog.joeware.net/2007/03/24/831/"&gt;http://blog.joeware.net/2007/03/24/831/&lt;/A&gt;&lt;BR&gt;&lt;A href="http://blog.joeware.net/2005/12/08/147/" mce_href="http://blog.joeware.net/2005/12/08/147/"&gt;http://blog.joeware.net/2005/12/08/147/&lt;/A&gt;&lt;BR&gt;&lt;A href="http://www.activedir.org/ListArchives/tabid/55/forumid/1/tpage/1/view/Topic/postid/31737/Default.aspx" mce_href="http://www.activedir.org/ListArchives/tabid/55/forumid/1/tpage/1/view/Topic/postid/31737/Default.aspx"&gt;http://www.activedir.org/ListArchives/tabid/55/forumid/1/tpage/1/view/Topic/postid/31737/Default.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://www.frickelsoft.net/blog/?p=147" mce_href="http://www.frickelsoft.net/blog/?p=147"&gt;http://www.frickelsoft.net/blog/?p=147&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3254937" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/Index/">Index</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/objectClass/">objectClass</category></item><item><title>After Booting into DSRM DC takes a long time to become available</title><link>http://blogs.technet.com/b/carlh/archive/2009/06/15/after-booting-into-dsrm-dc-takes-a-long-time-to-become-available.aspx</link><pubDate>Mon, 15 Jun 2009 14:50:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3254925</guid><dc:creator>carl h2</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/carlh/rsscomments.aspx?WeblogPostID=3254925</wfw:commentRss><comments>http://blogs.technet.com/b/carlh/archive/2009/06/15/after-booting-into-dsrm-dc-takes-a-long-time-to-become-available.aspx#comments</comments><description>&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;I had an interesting issue recently and I thought it would be useful to share the information. I was working on a test environment was going through some DR scenarios and noticed that the DC’s were taking a long time to boot into normal mode after booting into DSRM. This was true even if I did nothing in DSRM other than logon and restart.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;DC’s were Windows 2003 SP2 x64&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Originally 2 DC’s in the environment, but the test was more pronounced with more DC’s (3 onwards, i.e. more replication partners)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;IPSec was utilized between DC’s (configured via group Policy; using Certificates, but the same issue was seen using Kerberos)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;After rebooting from DSRM the Domain Controller takes an unusual length of time (6-15 minutes from “Applying Network Settings” to the actual logon prompt; dependent on the number of DC’s in the environment) to enable logon at the console. “Applying Network Settings” takes approximately 5-6 minutes and when the logon dialog box appears, this usually does not display the logon domain for about another 5-10 minutes, by which time a user can logon. When carrying out the same procedure on x86 DC’s the timings were considerably reduced and I haven't had time for further investigation.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Testing, Log Analysis and Research found this is an expected behaviour. This is the &lt;U&gt;High Level&lt;/U&gt; theory of what is occurring.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;IPSec is implemented using a Domain Based IPSec Policy using Certificates and this scenario plays the same if Kerberos authentication is used.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;When a DC is booted into DSRM mode the Group Policy is cleared with the exception of IPSec Policy.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;When restarting the DC into normal mode, the server waits for Initial synchronization. In this case, the initial synchronization will fail as IPSec initialises but the configuration is not applied fully, so the DC cannot have comms with partner DC’s.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;As the Certificate details are stored in active directory, the Server can’t read it till the initial synchronization process is completed and the Directory Services have fully initialised locally (same case for Kerberos).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Also DNS cannot load up the Directory integrated zones due to lack of Directory Services availability, and therefore if the DC uses itself for DNS search this will fail.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Once the initial sync process completes (timesout), the domain controller can read the information from the local active directory, load up the DNS zone and get the certificate information.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;IPsec can complete initialisation and the DC applies policy etc and life becomes good again. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;During testing&amp;nbsp;I tried a number of things to resolve the issue, 3 of which worked (listed below), but all except item 2 were not satisfactory fixes for most production environments if you seriously need to IPSec between DC's.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Disable the IPSec Policy.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Use Pre-shared keys in the IPSec policy settings rather than Certificates or Kerberos.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="MARGIN: 0cm 0cm 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: EN-US; mso-bidi-font-weight: bold" lang=EN-US&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Set the registry value "Repl Perform Initial Synchronizations" to zero to prevent Initial Synchronisation &lt;A href="http://support.microsoft.com/kb/305476" mce_href="http://support.microsoft.com/kb/305476"&gt;http://support.microsoft.com/kb/305476&lt;/A&gt;. This obviously is not advised in a production environment, but did prevent the issue from occurring during testing.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3254925" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/carlh/archive/tags/DSRM/">DSRM</category><category domain="http://blogs.technet.com/b/carlh/archive/tags/IPSec/">IPSec</category></item></channel></rss>