Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Seeing specific FileSystemAccessRule properties...

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-17-2007   #1 (permalink)
Matt
Guest


 

Seeing specific FileSystemAccessRule properties...

I'm just trying to get a list of ACL permissions on a folder... Similar to
when I do:
>get-acl c:\ | format-list


Path : Microsoft.PowerShell.Core\FileSystem::C:\
Owner : BUILTIN\Administrators
Group : NT AUTHORITY\SYSTEM
Access : Everyone Allow ReadAndExecute, Synchronize
CREATOR OWNER Allow 268435456
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow AppendData
BUILTIN\Users Allow CreateFiles
BUILTIN\Users Allow ReadAndExecute, Synchronize
Audit :
Sddl : O:BAG:SYDA;;0x1200a9;;;WD)(A;OICIIO;GA;;;CO)(A;OICI;F...

However, I just want the same list, except ONLY see the text from Parth and
Access.

But, when I do,
>get-acl c:\ | select-object path,access | format-list


I get...

Path : Microsoft.PowerShell.Core\FileSystem::C:\
Access : {System.Security.AccessControl.FileSystemAccessRule,
System.Security.AccessControl.FileSystemAccessRule, System.Security.AccessCon
trol.FileSystemAccessRule,
System.Security.AccessControl.FileSystemAccessRule...}

It seems that before I 'filter' out the objects, PS knows exactly what
'default' properties to show, but after the filter, it just gets lazy and
throws the whole object at me.

How do I manuipulate the object to get the following output?

Path : Microsoft.PowerShell.Core\FileSystem::C:\
Access : Everyone Allow ReadAndExecute, Synchronize
CREATOR OWNER Allow 268435456
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow AppendData
BUILTIN\Users Allow CreateFiles
BUILTIN\Users Allow ReadAndExecute, Synchronize

Thanks Much!!


My System SpecsSystem Spec
Old 01-17-2007   #2 (permalink)
Brandon Shell
Guest


 

Re: Seeing specific FileSystemAccessRule properties...

I will let Jeffrey and party explain why this happens, but heres a quick
script that does what you want:

Function Display-Acl {
Param([string]$path)
$acls = get-Acl $path | Sort-Object IdentityReference
Write-Host "Path: $($acls.Path)"
Write-Host "Access:"
foreach($acl in $acls.Access){
Write-Host `t $acl.IdentityReference $acl.AccessControlType
$acl.FileSystemRights
}
}
"Matt" <Matt@discussions.microsoft.com> wrote in message
news:A2C06EA8-941B-457F-8F15-19E89171997D@microsoft.com...
> I'm just trying to get a list of ACL permissions on a folder... Similar
> to
> when I do:
>>get-acl c:\ | format-list

>
> Path : Microsoft.PowerShell.Core\FileSystem::C:\
> Owner : BUILTIN\Administrators
> Group : NT AUTHORITY\SYSTEM
> Access : Everyone Allow ReadAndExecute, Synchronize
> CREATOR OWNER Allow 268435456
> NT AUTHORITY\SYSTEM Allow FullControl
> BUILTIN\Administrators Allow FullControl
> BUILTIN\Users Allow AppendData
> BUILTIN\Users Allow CreateFiles
> BUILTIN\Users Allow ReadAndExecute, Synchronize
> Audit :
> Sddl : O:BAG:SYDA;;0x1200a9;;;WD)(A;OICIIO;GA;;;CO)(A;OICI;F...
>
> However, I just want the same list, except ONLY see the text from Parth
> and
> Access.
>
> But, when I do,
>>get-acl c:\ | select-object path,access | format-list

>
> I get...
>
> Path : Microsoft.PowerShell.Core\FileSystem::C:\
> Access : {System.Security.AccessControl.FileSystemAccessRule,
> System.Security.AccessControl.FileSystemAccessRule,
> System.Security.AccessCon
> trol.FileSystemAccessRule,
> System.Security.AccessControl.FileSystemAccessRule...}
>
> It seems that before I 'filter' out the objects, PS knows exactly what
> 'default' properties to show, but after the filter, it just gets lazy and
> throws the whole object at me.
>
> How do I manuipulate the object to get the following output?
>
> Path : Microsoft.PowerShell.Core\FileSystem::C:\
> Access : Everyone Allow ReadAndExecute, Synchronize
> CREATOR OWNER Allow 268435456
> NT AUTHORITY\SYSTEM Allow FullControl
> BUILTIN\Administrators Allow FullControl
> BUILTIN\Users Allow AppendData
> BUILTIN\Users Allow CreateFiles
> BUILTIN\Users Allow ReadAndExecute, Synchronize
>
> Thanks Much!!
>


My System SpecsSystem Spec
Old 01-18-2007   #3 (permalink)
/\/\o\/\/ [MVP]
Guest


 

Re: Seeing specific FileSystemAccessRule properties...

2 other options, that are close

get-acl c:\ | select Path -Expand Access

get-acl c:\ | select Path -Expand Access | fl
path,IdentityReference,AccessControlType,FileSystemRights

gr /\/\o\/\/

"Brandon Shell" wrote:

> I will let Jeffrey and party explain why this happens, but heres a quick
> script that does what you want:
>
> Function Display-Acl {
> Param([string]$path)
> $acls = get-Acl $path | Sort-Object IdentityReference
> Write-Host "Path: $($acls.Path)"
> Write-Host "Access:"
> foreach($acl in $acls.Access){
> Write-Host `t $acl.IdentityReference $acl.AccessControlType
> $acl.FileSystemRights
> }
> }
> "Matt" <Matt@discussions.microsoft.com> wrote in message
> news:A2C06EA8-941B-457F-8F15-19E89171997D@microsoft.com...
> > I'm just trying to get a list of ACL permissions on a folder... Similar
> > to
> > when I do:
> >>get-acl c:\ | format-list

> >
> > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > Owner : BUILTIN\Administrators
> > Group : NT AUTHORITY\SYSTEM
> > Access : Everyone Allow ReadAndExecute, Synchronize
> > CREATOR OWNER Allow 268435456
> > NT AUTHORITY\SYSTEM Allow FullControl
> > BUILTIN\Administrators Allow FullControl
> > BUILTIN\Users Allow AppendData
> > BUILTIN\Users Allow CreateFiles
> > BUILTIN\Users Allow ReadAndExecute, Synchronize
> > Audit :
> > Sddl : O:BAG:SYDA;;0x1200a9;;;WD)(A;OICIIO;GA;;;CO)(A;OICI;F...
> >
> > However, I just want the same list, except ONLY see the text from Parth
> > and
> > Access.
> >
> > But, when I do,
> >>get-acl c:\ | select-object path,access | format-list

> >
> > I get...
> >
> > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > Access : {System.Security.AccessControl.FileSystemAccessRule,
> > System.Security.AccessControl.FileSystemAccessRule,
> > System.Security.AccessCon
> > trol.FileSystemAccessRule,
> > System.Security.AccessControl.FileSystemAccessRule...}
> >
> > It seems that before I 'filter' out the objects, PS knows exactly what
> > 'default' properties to show, but after the filter, it just gets lazy and
> > throws the whole object at me.
> >
> > How do I manuipulate the object to get the following output?
> >
> > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > Access : Everyone Allow ReadAndExecute, Synchronize
> > CREATOR OWNER Allow 268435456
> > NT AUTHORITY\SYSTEM Allow FullControl
> > BUILTIN\Administrators Allow FullControl
> > BUILTIN\Users Allow AppendData
> > BUILTIN\Users Allow CreateFiles
> > BUILTIN\Users Allow ReadAndExecute, Synchronize
> >
> > Thanks Much!!
> >

>
>

My System SpecsSystem Spec
Old 01-18-2007   #4 (permalink)
Matt
Guest


 

Re: Seeing specific FileSystemAccessRule properties...

Thanks Brandon and MOW, both of your replies got me past a big hurdle up the
learning curve!

"/\/\o\/\/ [MVP]" wrote:

> 2 other options, that are close
>
> get-acl c:\ | select Path -Expand Access
>
> get-acl c:\ | select Path -Expand Access | fl
> path,IdentityReference,AccessControlType,FileSystemRights
>
> gr /\/\o\/\/
>
> "Brandon Shell" wrote:
>
> > I will let Jeffrey and party explain why this happens, but heres a quick
> > script that does what you want:
> >
> > Function Display-Acl {
> > Param([string]$path)
> > $acls = get-Acl $path | Sort-Object IdentityReference
> > Write-Host "Path: $($acls.Path)"
> > Write-Host "Access:"
> > foreach($acl in $acls.Access){
> > Write-Host `t $acl.IdentityReference $acl.AccessControlType
> > $acl.FileSystemRights
> > }
> > }
> > "Matt" <Matt@discussions.microsoft.com> wrote in message
> > news:A2C06EA8-941B-457F-8F15-19E89171997D@microsoft.com...
> > > I'm just trying to get a list of ACL permissions on a folder... Similar
> > > to
> > > when I do:
> > >>get-acl c:\ | format-list
> > >
> > > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > > Owner : BUILTIN\Administrators
> > > Group : NT AUTHORITY\SYSTEM
> > > Access : Everyone Allow ReadAndExecute, Synchronize
> > > CREATOR OWNER Allow 268435456
> > > NT AUTHORITY\SYSTEM Allow FullControl
> > > BUILTIN\Administrators Allow FullControl
> > > BUILTIN\Users Allow AppendData
> > > BUILTIN\Users Allow CreateFiles
> > > BUILTIN\Users Allow ReadAndExecute, Synchronize
> > > Audit :
> > > Sddl : O:BAG:SYDA;;0x1200a9;;;WD)(A;OICIIO;GA;;;CO)(A;OICI;F...
> > >
> > > However, I just want the same list, except ONLY see the text from Parth
> > > and
> > > Access.
> > >
> > > But, when I do,
> > >>get-acl c:\ | select-object path,access | format-list
> > >
> > > I get...
> > >
> > > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > > Access : {System.Security.AccessControl.FileSystemAccessRule,
> > > System.Security.AccessControl.FileSystemAccessRule,
> > > System.Security.AccessCon
> > > trol.FileSystemAccessRule,
> > > System.Security.AccessControl.FileSystemAccessRule...}
> > >
> > > It seems that before I 'filter' out the objects, PS knows exactly what
> > > 'default' properties to show, but after the filter, it just gets lazy and
> > > throws the whole object at me.
> > >
> > > How do I manuipulate the object to get the following output?
> > >
> > > Path : Microsoft.PowerShell.Core\FileSystem::C:\
> > > Access : Everyone Allow ReadAndExecute, Synchronize
> > > CREATOR OWNER Allow 268435456
> > > NT AUTHORITY\SYSTEM Allow FullControl
> > > BUILTIN\Administrators Allow FullControl
> > > BUILTIN\Users Allow AppendData
> > > BUILTIN\Users Allow CreateFiles
> > > BUILTIN\Users Allow ReadAndExecute, Synchronize
> > >
> > > Thanks Much!!
> > >

> >
> >

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 Blocking one specific URL only Jo-Ann .NET General 1 06-09-2008 06:46 AM
Where specific files are kept? AndreaB Vista file management 0 12-14-2007 03:31 PM
Cannot access properties in "local area connection properties" win Samzabrus Vista networking & sharing 2 10-09-2007 10:00 AM
I need help-- Can't delete one specific e-mail ! Marita Vista mail 3 09-08-2007 07:49 AM
How to setup an specific sound card to work with specific programs Stuserver Vista installation & setup 4 01-06-2007 07:01 PM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008