Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts 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

how to list out ntfs permissions

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 11-15-2007   #1 (permalink)
Frank
Guest


 

how to list out ntfs permissions

Hi,

I would like to write a script to list out ntfs permissions. I tried with:

(get-acl -path \\testserver\d$\testdir).accesstostring

I get:

BUILTIN\Administrators Allow FullControl
REDMOND\testuser Allow Write, ReadAndExecute, Synchronize
S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute,
Synchronize
BUILTIN\Administrators Allow FullControl
NT AUTHORITY\SYSTEM Allow FullControl

When I do this from the gui, the
"S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute"
resolves correctly but now from PS. Doe anyone know how I can get around
this?

Thanks in advance,



My System SpecsSystem Spec
Old 11-15-2007   #2 (permalink)
Marco Shaw [MVP]
Guest


 

Re: how to list out ntfs permissions

Frank wrote:
Quote:

> Hi,
>
> I would like to write a script to list out ntfs permissions. I tried with:
>
> (get-acl -path \\testserver\d$\testdir).accesstostring
>
> I get:
>
> BUILTIN\Administrators Allow FullControl
> REDMOND\testuser Allow Write, ReadAndExecute, Synchronize
> S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute,
> Synchronize
> BUILTIN\Administrators Allow FullControl
> NT AUTHORITY\SYSTEM Allow FullControl
>
> When I do this from the gui, the
> "S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute"
> resolves correctly but now from PS. Doe anyone know how I can get around
> this?
>
> Thanks in advance,
>
>
http://www.comptechdoc.org/os/window...rmissions.html

A bit of an assumption here... Since Read and Write each come with the
synchronize permission, it would seem 'Read and Execute' would also have
synchronize (since Read is there).

Synchronize seems to be a hidden permission so PowerShell is actually
more accurate.

You could likely drop the Synchronize when applying the permissions
elsewhere.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 11-16-2007   #3 (permalink)
Oisin Grehan
Guest


 

Re: how to list out ntfs permissions

On Nov 15, 2:14 pm, Frank <Fr...@xxxxxx> wrote:
Quote:

> Hi,
>
> I would like to write a script to list out ntfs permissions. I tried with:
>
> (get-acl -path \\testserver\d$\testdir).accesstostring
>
> I get:
>
> BUILTIN\Administrators Allow FullControl
> REDMOND\testuser Allow Write, ReadAndExecute, Synchronize
> S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute,
> Synchronize
> BUILTIN\Administrators Allow FullControl
> NT AUTHORITY\SYSTEM Allow FullControl
>
> When I do this from the gui, the
> "S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute"
> resolves correctly but now from PS. Doe anyone know how I can get around
> this?
>
> Thanks in advance,
Hi Frank,

I presume you're talking about the SID not resolving to a domain
\username pair. Just for kicks, try explicitly resolving it in
Powershell:

PS> $sid = new-object security.principal.securityidentifier `
"S-1-5-21-2146773085-903363285-719344707-241418"
PS> $securityidentifier.translate( [security.principal.ntaccount] )

For more on this kind of thing, check out:

http://www.nivot.org/2007/08/20/Conv...owerShell.aspx

Hope this helps,

- Oisin / x0n

p.s. security tip: try to keep your actual SIDs secret in future ;-)




My System SpecsSystem Spec
Old 11-16-2007   #4 (permalink)
Marco Shaw [MVP]
Guest


 

Re: how to list out ntfs permissions

Quote:
Quote:

>> When I do this from the gui, the
>> "S-1-5-21-2146773085-903363285-719344707-241418 Allow ReadAndExecute"
>> resolves correctly but now from PS. Doe anyone know how I can get
>> around this?
>> Thanks in advance,
Oops! I read this too quickly. Oisin has the answer...

Marco
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove all NTFS Permissions from Folder Gregor PowerShell 2 03-13-2008 08:46 AM
Copy NTFS permissions BMC PowerShell 1 08-01-2007 02:02 PM
NTFS permissions for a domain user RedParanoid Vista networking & sharing 0 04-28-2007 02:04 AM
NTFS/registry permissions for a service-specific SID Sharon2323 Vista security 3 08-05-2006 02:31 PM
NTFS Security Permissions (HOW TO RESET?) Mike (Bryett Enterprise LTD) Vista security 4 06-14-2006 12:54 PM


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51