Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


PowerShell ACL question

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,50703
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> PowerShell ACL question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 PowerShell ACL question - 8/13/2007 11:45:44 PM   
  Doc83

 

Posts: 2
Score: 0
Joined: 8/13/2007
Status: offline
'm trying to recurse a drive on a server of mine and want to find what out there I don't have access to move(as an admin). Right now I have
get-childitem "\\server\Share" –recurse | get-acl |
select-object path,owner,accesstostring,group | export-csv c:\ACL.csv

but I just want to list what I DON'T have access to not everything (that would be one really big CSV) I assume there is some kind of foreach statement saying if I can access the folder/file then move on IF I can't (don't know the argument) then log.  Any help would be great 
 
 
Post #: 1
 
 RE: PowerShell ACL question - 8/14/2007 12:10:59 AM   
  ebgreen


Posts: 4411
Score: 29
Joined: 7/12/2005
Status: offline
I have not played around with the Get-Acl cmdlet very much, but I would say that you would want to use Where-Object and built a test based on the Access property.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Doc83)
 
 
Post #: 2
 
 RE: PowerShell ACL question - 8/14/2007 12:16:31 AM   
  Doc83

 

Posts: 2
Score: 0
Joined: 8/13/2007
Status: offline
I'll try that thanks for the reply

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: PowerShell ACL question - 8/14/2007 11:06:01 PM   
  SAPIENScripter


Posts: 261
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
Use the Where object and the -notmach operator to check the credential against the acesstoString property.  See if something like this works for you:


      

One potential downfall is that if the account has explicitly been given "deny access rights" it will show up in the ACL and thus not be detected by this method. This also doesn't take into account access you might have through some other group membership.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

(in reply to Doc83)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> PowerShell ACL question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts