<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LeVeilleur.net &#187; linkedin</title>
	<atom:link href="http://www.leveilleur.net/index.php/tag/linkedin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leveilleur.net</link>
	<description></description>
	<lastBuildDate>Thu, 03 Jun 2010 21:21:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PowerShell : Upload file to WebDav Server</title>
		<link>http://www.leveilleur.net/index.php/2009/08/14/powershell-upload-file-to-webdav-server/</link>
		<comments>http://www.leveilleur.net/index.php/2009/08/14/powershell-upload-file-to-webdav-server/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:04:10 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=231</guid>
		<description><![CDATA[A new PowerShell for upload one file to a WebDav Server
1234567891011121314151617181920212223242526272829303132333435363738########################################
#Webdav Access with PowerShell
########################################

#Put the complete path of your file
$file = &#34;D:\test.txt&#34;

#Put the url without the last &#34;/&#34;
$url &#160;= &#34;http://mywebSite/webdav&#34; &#160;

#Provide User and Pwd for Webdav Access
$user = &#34;user&#34;
$pass = &#34;pwd&#34;

########################################
#Script
#######################################

#Adding the name of the file at the end of the URL
$url += &#34;/&#34; + [...]]]></description>
			<content:encoded><![CDATA[<p>A new PowerShell for upload one file to a WebDav Server</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:460px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">########################################</span><br />
<span style="color: #008000;">#Webdav Access with PowerShell</span><br />
<span style="color: #008000;">########################################</span><br />
<br />
<span style="color: #008000;">#Put the complete path of your file</span><br />
<span style="color: #800080;">$file</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\test.txt&quot;</span><br />
<br />
<span style="color: #008000;">#Put the url without the last &quot;/&quot;</span><br />
<span style="color: #800080;">$url</span> &nbsp;<span style="color: pink;">=</span> <span style="color: #800000;">&quot;http://mywebSite/webdav&quot;</span> &nbsp;<br />
<br />
<span style="color: #008000;">#Provide User and Pwd for Webdav Access</span><br />
<span style="color: #800080;">$user</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;user&quot;</span><br />
<span style="color: #800080;">$pass</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;pwd&quot;</span><br />
<br />
<span style="color: #008000;">########################################</span><br />
<span style="color: #008000;">#Script</span><br />
<span style="color: #008000;">#######################################</span><br />
<br />
<span style="color: #008000;">#Adding the name of the file at the end of the URL</span><br />
<span style="color: #800080;">$url</span> <span style="color: pink;">+=</span> <span style="color: #800000;">&quot;/&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$file</span>.split<span style="color: #000000;">&#40;</span><span style="color: #800000;">'\'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$file</span>.split<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.count <span style="color: pink;">-</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<br />
<span style="color: #008000;">#Connecting to WebDav</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;File upload started&quot;</span><br />
<br />
<span style="color: #008000;"># Set binary file type</span><br />
<span style="color: #008080; font-weight: bold;">Set-Variable</span> <span style="color: #008080; font-style: italic;">-name</span> adFileTypeBinary <span style="color: #008080; font-style: italic;">-value</span> 1 <span style="color: #008080; font-style: italic;">-option</span> Constant <br />
<br />
<span style="color: #800080;">$objADOStream</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> ADODB.Stream<br />
<span style="color: #800080;">$objADOStream</span>.Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$objADOStream</span>.<span style="color: #008080; font-weight: bold;">Type</span> <span style="color: pink;">=</span> <span style="color: #800080;">$adFileTypeBinary</span><br />
<span style="color: #800080;">$objADOStream</span>.LoadFromFile<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;$file&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$arrbuffer</span> <span style="color: pink;">=</span> <span style="color: #800080;">$objADOStream</span>.Read<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$objXMLHTTP</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> MSXML2.ServerXMLHTTP<br />
<span style="color: #800080;">$objXMLHTTP</span>.Open<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;PUT&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$url</span><span style="color: pink;">,</span> <span style="color: #800080;">$False</span><span style="color: pink;">,</span> <span style="color: #800080;">$user</span><span style="color: pink;">,</span> <span style="color: #800080;">$pass</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$objXMLHTTP</span>.send<span style="color: #000000;">&#40;</span><span style="color: #800080;">$arrbuffer</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;File upload finished&quot;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/08/14/powershell-upload-file-to-webdav-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell : List Users from AD Groups</title>
		<link>http://www.leveilleur.net/index.php/2009/06/10/powershell-list-users-from-ad-groups/</link>
		<comments>http://www.leveilleur.net/index.php/2009/06/10/powershell-list-users-from-ad-groups/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 07:23:11 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=181</guid>
		<description><![CDATA[
############################
#Param
############################
$lists= "Group1", "Group2"
$ExportCsv = "D:\test.csv"

############################
#Functions
############################
Add-pssnapin Quest.ActiveRoles.ADManagement
Function Get-MemberName()
	{
	Process
		{
		ForEach($Member In $_)
			{
			Get-QADUser –ObjectAttributes @{distinguishedName=$Member}
			}
		}
	}
#########################
# Script
#########################
$MyArray = @()
foreach($group in $lists)
	{
	$Ret = $null
	$Ret = (Get-QADGroup $group).members &#124; Get-MemberName
	foreach($line in $Ret)
		{
		$obj = New-Object PSObject
		$obj &#124; Add-Member NoteProperty -Name "Group" -Value ($Group).ToUpper()
		$obj &#124; Add-Member NoteProperty -Name "FirstName" -Value $line.FirstName
		$obj &#124; Add-Member NoteProperty -Name "LastName" -Value $line.LastName
		$obj &#124; Add-Member NoteProperty -Name "LogonName" -Value [...]]]></description>
			<content:encoded><![CDATA[<pre>
############################
#Param
############################
$lists= "Group1", "Group2"
$ExportCsv = "D:\test.csv"

############################
#Functions
############################
Add-pssnapin Quest.ActiveRoles.ADManagement
Function Get-MemberName()
	{
	Process
		{
		ForEach($Member In $_)
			{
			Get-QADUser –ObjectAttributes @{distinguishedName=$Member}
			}
		}
	}
#########################
# Script
#########################
$MyArray = @()
foreach($group in $lists)
	{
	$Ret = $null
	$Ret = (Get-QADGroup $group).members | Get-MemberName
	foreach($line in $Ret)
		{
		$obj = New-Object PSObject
		$obj | Add-Member NoteProperty -Name "Group" -Value ($Group).ToUpper()
		$obj | Add-Member NoteProperty -Name "FirstName" -Value $line.FirstName
		$obj | Add-Member NoteProperty -Name "LastName" -Value $line.LastName
		$obj | Add-Member NoteProperty -Name "LogonName" -Value ($line.LogonName).ToUpper()
		$MyArray += $obj
		}
	}
$MyArray | Export-Csv $ExportCsv
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/06/10/powershell-list-users-from-ad-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : Users, Groups, Services, Shares</title>
		<link>http://www.leveilleur.net/index.php/2009/04/16/174/</link>
		<comments>http://www.leveilleur.net/index.php/2009/04/16/174/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 12:54:38 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[local group]]></category>
		<category><![CDATA[local user]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=174</guid>
		<description><![CDATA[Hello tout monde,
Voici un nouveau script permettant de récupérer :
-Local Users
-Local Groups
-Local Services
-Shares (With Shares Permissions and Ntfs Security)
-Testing the existing of a particular reg Key
Bonne journée
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338########################
#Functions
########################
$arrExclude = &#34;NT AUTHORITY\LocalService&#34;,
&#160; &#160; &#160; &#160; &#160; &#160; &#34;NT AUTHORITY\Local Service&#34;,
&#160; &#160; &#160; &#160; &#160; &#160; &#34;NT AUTHORITY\NETWORK SERVICE&#34;,
&#160; &#160; &#160; &#160; &#160; &#160; &#34;NT AUTHORITY\NetworkService&#34;,
&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Hello tout monde,</p>
<p>Voici un nouveau script permettant de récupérer :</p>
<p>-Local Users<br />
-Local Groups<br />
-Local Services<br />
-Shares (With Shares Permissions and Ntfs Security)<br />
-Testing the existing of a particular reg Key</p>
<p>Bonne journée</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:460px;height:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br />210<br />211<br />212<br />213<br />214<br />215<br />216<br />217<br />218<br />219<br />220<br />221<br />222<br />223<br />224<br />225<br />226<br />227<br />228<br />229<br />230<br />231<br />232<br />233<br />234<br />235<br />236<br />237<br />238<br />239<br />240<br />241<br />242<br />243<br />244<br />245<br />246<br />247<br />248<br />249<br />250<br />251<br />252<br />253<br />254<br />255<br />256<br />257<br />258<br />259<br />260<br />261<br />262<br />263<br />264<br />265<br />266<br />267<br />268<br />269<br />270<br />271<br />272<br />273<br />274<br />275<br />276<br />277<br />278<br />279<br />280<br />281<br />282<br />283<br />284<br />285<br />286<br />287<br />288<br />289<br />290<br />291<br />292<br />293<br />294<br />295<br />296<br />297<br />298<br />299<br />300<br />301<br />302<br />303<br />304<br />305<br />306<br />307<br />308<br />309<br />310<br />311<br />312<br />313<br />314<br />315<br />316<br />317<br />318<br />319<br />320<br />321<br />322<br />323<br />324<br />325<br />326<br />327<br />328<br />329<br />330<br />331<br />332<br />333<br />334<br />335<br />336<br />337<br />338<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">########################</span><br />
<span style="color: #008000;">#Functions</span><br />
<span style="color: #008000;">########################</span><br />
<span style="color: #800080;">$arrExclude</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;NT AUTHORITY\LocalService&quot;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;NT AUTHORITY\Local Service&quot;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;NT AUTHORITY\NETWORK SERVICE&quot;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;NT AUTHORITY\NetworkService&quot;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;LocalSystem&quot;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;.\ASPNET&quot;</span> <br />
<br />
<span style="color: #0000FF;">function</span> checkExclusions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$strval</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$val</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$arrExclude</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$val</span>.ToLower<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$strval</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #0000FF;">return</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#125;</span>&nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$false</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>MySharePermissions<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$computername</span><span style="color: pink;">,</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$sharename</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$ShareSec</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> <span style="color: #008080; font-style: italic;">-Class</span> Win32_LogicalShareSecuritySetting <span style="color: #008080; font-style: italic;">-ComputerName</span> <span style="color: #800080;">$computername</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ShareS</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ShareSec</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.Name <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$sharename</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$SecurityDescriptor</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ShareS</span>.GetSecurityDescriptor<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myCol</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$DACL</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$SecurityDescriptor</span>.Descriptor.DACL<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObj</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select</span> Domain<span style="color: pink;">,</span> ID<span style="color: pink;">,</span> AccessMask<span style="color: pink;">,</span> AceType<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.Domain <span style="color: pink;">=</span> <span style="color: #800080;">$DACL</span>.Trustee.Domain<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.ID <span style="color: pink;">=</span> <span style="color: #800080;">$DACL</span>.Trustee.Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">Switch</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$DACL</span>.AccessMask<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2032127 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;FullControl&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1179785 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Read&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1180063 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Read, Write&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1179817 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;ReadAndExecute&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: pink;">-</span>1610612736 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;ReadAndExecuteExtended&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1245631 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;ReadAndExecute, Modify, Write&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1180095 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;ReadAndExecute, Write&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 268435456 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;FullControl (Sub Only)&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AccessMask</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DACL</span>.AccessMask<span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.AccessMask <span style="color: pink;">=</span> <span style="color: #800080;">$AccessMask</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">Switch</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$DACL</span>.AceType<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AceType</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Allow&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AceType</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Deny&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 <span style="color: #000000;">&#123;</span><span style="color: #800080;">$AceType</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Audit&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.AceType <span style="color: pink;">=</span> <span style="color: #800080;">$AceType</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Clear-Variable</span> AccessMask <span style="color: #008080; font-style: italic;">-ErrorAction</span> SilentlyContinue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Clear-Variable</span> AceType <span style="color: #008080; font-style: italic;">-ErrorAction</span> SilentlyContinue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myCol</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$myObj</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">Return</span> <span style="color: #800080;">$myCol</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">function</span> Ping <span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$strComputer</span> <span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800080;">$timeout</span><span style="color: pink;">=</span><span style="color: #804000;">120</span>;<br />
&nbsp; <span style="color: #0000FF;">trap</span> <span style="color: #000000;">&#123;</span> <span style="color: #0000FF;">continue</span>; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; <span style="color: #800080;">$ping</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> System.Net.NetworkInformation.Ping<br />
&nbsp; <span style="color: #800080;">$reply</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> System.Net.NetworkInformation.PingReply<br />
<br />
&nbsp; <span style="color: #800080;">$reply</span> <span style="color: pink;">=</span> <span style="color: #800080;">$ping</span>.Send<span style="color: #000000;">&#40;</span><span style="color: #800080;">$strComputer</span><span style="color: pink;">,</span> <span style="color: #800080;">$timeout</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #800080;">$reply</span>.Status <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;Success&quot;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />
&nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">return</span> <span style="color: #800080;">$true</span>;<br />
&nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; <span style="color: #0000FF;">return</span> <span style="color: #800080;">$false</span>;<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">########################</span><br />
<span style="color: #008000;">#Script</span><br />
<span style="color: #008000;">########################</span><br />
<span style="color: #800080;">$pathFolder</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\Reporting\ComputerPerm&quot;</span><br />
<span style="color: #800080;">$computersList</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">get-content</span> <span style="color: #800000;">&quot;$pathFolder\list.txt&quot;</span><br />
<span style="color: #800080;">$ArrayUser</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$ArrayGroup</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$ArrayKey</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$ArrayService</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$ArrayShare</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$ArrayAccess</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />
<br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$computersList</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #800080;">$retPing</span> <span style="color: pink;">=</span> Ping <span style="color: #800080;">$computer</span><br />
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$retPing</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Disabling the error on the screen</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$errorActionPreference</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;SilentlyContinue&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$testAccss</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">get-wmiobject</span> Win32_OperatingSystem <span style="color: #008080; font-style: italic;">-computername</span> <span style="color: #800080;">$computer</span> <span style="color: #008080; font-style: italic;">-ErrorVariable</span> ERR<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">If</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$ERR</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #800080;">$Access</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><span style="color: #800080;">$Access</span> <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><span style="color: #800080;">$Access</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Access</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Srv not ping or denied</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Server : &quot;</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #800000;">&quot; - Ping : $retPing - Access : $Access&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;PING&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$retPing</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ACCESS&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$Access</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$ArrayAccess</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Working on it</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-host</span> <span style="color: #800000;">&quot;ServerName : $computer&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;***********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;List local user account&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;***********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
<span style="color: #800080;">$namespace</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;root\CIMV2&quot;</span><br />
<span style="color: #800080;">$usersList</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> <span style="color: #008080; font-style: italic;">-class</span> Win32_UserAccount <span style="color: #008080; font-style: italic;">-computername</span> <span style="color: #800080;">$computer</span> <span style="color: #008080; font-style: italic;">-namespace</span> <span style="color: #800080;">$namespace</span> <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #800000;">&quot;localaccount=true&quot;</span><br />
<br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$user</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$usersList</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-host</span> <span style="color: #800000;">&quot;Account Name : &quot;</span> <span style="color: #800080;">$user</span>.name<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Account Description : &quot;</span> <span style="color: #800080;">$user</span>.description<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-host</span> <span style="color: #800000;">&quot;Disabled : &quot;</span> <span style="color: #800080;">$user</span>.disabled<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AccountName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$user</span>.name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AccountDescription&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$user</span>.description<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Disabled&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$user</span>.disabled<br />
&nbsp; &nbsp; <span style="color: #800080;">$ArrayUser</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;***********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;List local Group&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;***********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
<span style="color: #800080;">$results</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> <span style="color: #008080; font-style: italic;">-class</span> Win32_Group <span style="color: #008080; font-style: italic;">-computername</span> <span style="color: #800080;">$computer</span> <span style="color: #008080; font-style: italic;">-namespace</span> <span style="color: #800080;">$namespace</span> <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #800000;">&quot;localaccount=true&quot;</span><br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$results</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Group Name : &quot;</span> <span style="color: #800080;">$result</span>.name<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Group Description : &quot;</span> <span style="color: #800080;">$result</span>.description<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #800080;">$GroupName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$result</span>.name<br />
&nbsp; &nbsp; <span style="color: #800080;">$group</span> <span style="color: pink;">=</span><span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;WinNT://./$GroupName&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$members</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$group</span>.psbase.Invoke<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Members&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$list</span> <span style="color: pink;">=</span> <span style="color: #800080;">$members</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#123;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.GetType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.InvokeMember<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Name&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">'GetProperty'</span><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: pink;">,</span> <a href="about:blank"><span style="color: #000080;">$_</span></a><span style="color: pink;">,</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$list</span> <span style="color: #FF0000;">-ne</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$member</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$list</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-host</span> <span style="color: #800000;">&quot;Account Name : &quot;</span> <span style="color: #800080;">$member</span>.toupper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;GroupName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;GroupDescription&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.description<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Member&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$member</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ArrayGroup</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;GroupName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;GroupDescription&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.description<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Member&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ArrayGroup</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Testing Registry Key&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;********************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
<span style="color: #008000;">#Just for testing purpose</span><br />
<span style="color: #008000;">#$key = &quot;SYSTEM\CurrentControlSet\Services\W32Time\Parameters&quot;</span><br />
<span style="color: #800080;">$key</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer&quot;</span><br />
<span style="color: #800080;">$type</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryHive<span style="color: #000000;">&#93;</span>::LocalMachine<br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$type</span><span style="color: pink;">,</span> <span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$regKey</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$key</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Key : $key&quot;</span><br />
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$regKey</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Key Present : false&quot;</span>;<br />
&nbsp; &nbsp; <span style="color: #800080;">$keyVal</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span><span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Key Present : true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$keyVal</span> <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
<span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Key&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$key</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;KeyVal&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$keyVal</span><br />
<span style="color: #800080;">$ArrayKey</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span> &nbsp; <br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;**************************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Service with local account&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;**************************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
<span style="color: #800080;">$results</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">gwmi</span> win32_service <span style="color: pink;">-</span>computer <span style="color: #800080;">$Computer</span> <span style="color: #008080; font-style: italic;">-property</span> name<span style="color: pink;">,</span> startname<span style="color: pink;">,</span> caption<br />
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$results</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$account</span> <span style="color: pink;">=</span> <span style="color: #800080;">$result</span>.StartName.ToLower<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>checkExclusions <span style="color: #800080;">$account</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Service : &quot;</span> <span style="color: #800080;">$result</span>.Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Caption : &quot;</span> <span style="color: #800080;">$result</span>.Caption<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Account : &quot;</span> <span style="color: #800080;">$account</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Service&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.Name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Caption&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$result</span>.Caption<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Account&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$account</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ArrayService</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span> &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#################################################################################################</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;**************************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Share on the computer&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;**************************&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<span style="color: #800080;">$results</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">get-WmiObject</span> Win32_Share <span style="color: pink;">-</span>computer <span style="color: #800080;">$Computer</span><br />
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$results</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;---------------&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Share Name : &quot;</span> <span style="color: #800080;">$result</span>.name<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Share Path : &quot;</span> <span style="color: #800080;">$result</span>.path<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Share Description : &quot;</span> <span style="color: #800080;">$result</span>.description<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;/!\Share Persmissions /!\&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$shareInfos</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>MySharePermissions <span style="color: #800080;">$Computer</span> <span style="color: #800080;">$result</span>.name<br />
&nbsp; &nbsp; <span style="color: #800080;">$cpt</span><span style="color: pink;">=</span> 1<br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$shareInfo</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$shareInfos</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$cpt-Domain : &quot;</span> <span style="color: #800080;">$shareInfo</span>.domain<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$cpt-User : &quot;</span> <span style="color: #800080;">$shareInfo</span>.id<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$cpt-AccessMask : &quot;</span> <span style="color: #800080;">$shareInfo</span>.accessMask<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$cpt-AceType : &quot;</span> <span style="color: #800080;">$shareInfo</span>.AceType<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;/!\Ntfs Persmissions /!\&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$path</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;\\$computer\&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$result</span>.name<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.name <span style="color: #FF0000;">-ne</span> <span style="color: #800000;">&quot;IPC$&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$values</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Acl</span> <span style="color: #800080;">$path</span> &nbsp;<span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">select-object</span> path<span style="color: pink;">,</span>owner<span style="color: pink;">,</span>accesstostring<span style="color: pink;">,</span><span style="color: #008080; font-weight: bold;">group</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$values</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$value</span>.path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$value</span>.owner<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$value</span>.accesstostring<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$value</span>.<span style="color: #008080; font-weight: bold;">group</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ShareName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;SharePath&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.path<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ShareDescription&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$result</span>.description<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Domain&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.domain<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;User&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AccessMask&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.accessMask<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AceType&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.AceType<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSPath&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span>.path<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSOwner&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$value</span>.owner<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSAccesstoString&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$value</span>.accesstostring<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSGroup&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$value</span>.<span style="color: #008080; font-weight: bold;">group</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ArrayShare</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">New-Object</span> PSObject<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ServerName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$computer</span><span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ShareName&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.name<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;SharePath&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$result</span>.path<span style="color: #000000;">&#41;</span>.trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;ShareDescription&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$result</span>.description<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Domain&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.domain<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;User&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AccessMask&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.accessMask<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;AceType&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800080;">$shareInfo</span>.AceType<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSPath&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSOwner&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSAccesstoString&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Add-Member</span> Noteproperty <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;NTFSGroup&quot;</span> <span style="color: #008080; font-style: italic;">-Value</span> <span style="color: #800000;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$ArrayShare</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$obj</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$cpt</span><span style="color: pink;">+=</span> <span style="color: #804000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #008000;">#################################################################################################</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;">#End test Access</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #800080;">$ArrayUser</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\1-user.csv&quot;</span><br />
<span style="color: #800080;">$ArrayGroup</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\2-group.csv&quot;</span><br />
<span style="color: #800080;">$ArrayKey</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\3-RegKey.csv&quot;</span><br />
<span style="color: #800080;">$ArrayService</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\4-Service.csv&quot;</span><br />
<span style="color: #800080;">$ArrayShare</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\5-Share.csv&quot;</span><br />
<span style="color: #800080;">$ArrayAccess</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Csv</span> <span style="color: #800000;">&quot;$pathFolder\Access.csv&quot;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/04/16/174/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell :  List Cluster&#8217;s Resources</title>
		<link>http://www.leveilleur.net/index.php/2009/03/30/powershell-list-clusters-resources/</link>
		<comments>http://www.leveilleur.net/index.php/2009/03/30/powershell-list-clusters-resources/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 12:31:26 +0000</pubDate>
		<dc:creator>Christopher Keyaert</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.leveilleur.net/?p=171</guid>
		<description><![CDATA[Voici un petit script PowerShell permettant de lister toutes les ressources disks des clusters.
123456789101112131415161718192021222324252627282930313233343536373839$logFilePath = &#34;D:\DashBoard\Inventory\source\Cluster\mylog.log&#34;
$listFile = &#34;D:\DashBoard\Inventory\source\Cluster\list.txt&#34;
Start-Transcript -Path $logFilePath -Append &#38;gt;$null
$list = Get-Content $listFile
foreach&#40;$srv in $list&#41;
&#160; &#160; &#123;
&#160; &#160; $SrvName = $srv
&#160; &#160; $c = new-object -comobject MSCLuster.Cluster
&#160; &#160; $c.open&#40;$SrvName&#41;
&#160; &#160; #Cluster Name
&#160; &#160; Write-Host &#34;Cluster Name : &#34; $c.name &#34;`r&#34;
&#160; &#160; #Cluster Nodes
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Voici un petit script PowerShell permettant de lister toutes les ressources disks des clusters.</p>
<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:460px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$logFilePath</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\DashBoard\Inventory\source\Cluster\mylog.log&quot;</span><br />
<span style="color: #800080;">$listFile</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\DashBoard\Inventory\source\Cluster\list.txt&quot;</span><br />
<span style="color: #008080; font-weight: bold;">Start-Transcript</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$logFilePath</span> <span style="color: #008080; font-style: italic;">-Append</span> <span style="color: pink;">&amp;</span>gt;$null<br />
<span style="color: #800080;">$list</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Content</span> <span style="color: #800080;">$listFile</span><br />
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$srv</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$list</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$SrvName</span> <span style="color: pink;">=</span> <span style="color: #800080;">$srv</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$c</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> <span style="color: #008080; font-style: italic;">-comobject</span> MSCLuster.Cluster<br />
&nbsp; &nbsp; <span style="color: #800080;">$c</span>.open<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SrvName</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Cluster Name</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Cluster Name : &quot;</span> <span style="color: #800080;">$c</span>.name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Cluster Nodes</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$node</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$c</span>.nodes<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Cluster Nodes : &quot;</span> <span style="color: #800080;">$node</span>.name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;-----&quot;</span>&nbsp; <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Resources Groups</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$resourceG</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$c</span>.resourceGroups<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Resource Group : &quot;</span> <span style="color: #800080;">$resourceG</span>.name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$r</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$resourceG</span>.Resources<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$r</span>.TypeName <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*Physical Disk*&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Resource Name Disk Name : &quot;</span> <span style="color: #800080;">$r</span>.name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$r</span>.TypeName <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*Network Name*&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Resource Name NetWork Name : &quot;</span> <span style="color: #800080;">$r</span>.name <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;-----&quot;</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;***************************&quot;</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Stop-Transcript</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.leveilleur.net/index.php/2009/03/30/powershell-list-clusters-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
