Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I want to scan a list of computers and find any directories that DO NOT have local Administrators ACL'ed.
I found the code on technet that describes how to recurse through a drive and get the ACL's and modified it a little to suit my needs. The issue I am having is that I want the recursion to continue after the error is trapped. I do not want to change permissions, just generate a list of problem folders. My script just stops at the first folder it can't access with the error: Attempted to perform an unauthoized operation.
I want to scan a list of computers and find any directories that DO NOT have local Administrators ACL'ed.
I found the code on technet that describes how to recurse through a drive and get the ACL's and modified it a little to suit my needs. The issue I am having is that I want the recursion to continue after the error is trapped. I do not want to change permissions, just generate a list of problem folders. My script just stops at the first folder it can't access with the error: Attempted to perform an unauthoized operation.
The trap in a function does not override the pipeline handling. Any error will terminate teh pipeline unless you use "-EA" to override deafult behavior. In that case you cannot run into the custom trap.
This topic is 15 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.