Power shell script to list all files and folder permissions recursively

Hi All,
I am looking for a powershell script to perform the following operations.
1) To list the folder and file permissions(Allow,Deny both) recursively in a given folder.
2) List out all the files and folders which are having the deny permission or having only the read access (or) only the write access. Basically the folder should have Read,Execute,Write permissions. Else we have to flag that file/folder name.
I had written a batch script for the same which does this task using icacls.exe output, but this script takes lot of time to recursively parse all the files ( ~1 lakh files).
Please help me with the powershell script for the same.
Thanks
Sambasiva

Try this module: http://gallery.technet.microsoft.com/scriptcenter/PowerShellAccessControl-d3be7b83
After importing the module, you can run something like this:
dir c:\folder -recurse | Get-AccessControlEntry
That output can be exported to a CSV for later viewing. You can also provide some parameters to Get-AccessControlEntry to limit the results:
dir c:\folder -recurse | Get-AccessControlEntry -FileRights Write
dir c:\folder -recurse | Get-AccessControlEntry -AceType AccessDenied
dir c:\folder -recurse | Get-AccessControlEntry -AceType AccessAllowed -FileRights Write

Similar Messages

  • File and folder permissions for Adobe Photoshop CS5

    Good day,
    I am an IT specialist and I work for a Canadian governement agency and we are having an issue with Photoshop CS5. After successfully installing Photoshop CS5 from the Adobe Creative Suite 5 Design Premium set(using a local machine administrator account), Photoshop crashes immidiatly after launching it(even with the local administrator account). The exact error message is as follows:
    The instruction at "0x230dad8dc" referenced memory at "0x00000000". The memory could not be "read".
    Click on OK to terminate the program
    Click on CANCEL to debug the program
    I know this is an environement issue and not an application or hardware issue since I was able to successfully install and run Adobe Photoshop CS5 on a plain vanilla install of Windows SP3 XP on the same model of workstation(HP DC7800). This later also confirms it is not a RAM or video adapter issue either. My experience tells me it would be more related to file/folder permissions on the workstation(although I'm open to other suggestions).  Because we are a governement agency, our workstations have machine and user policies and desktop configurations that get applied to the workstations automatically upon joining our domain via GPOs and SMS. Certain system files and folder permissions may be locked down for security reasons therefor I was wondering is someone has a list of files and folders that Adobe CS5 needs access to upon startup in order to properly function?
    If anyone would like more details or information please let me know and I'll try to be more specific.
    Thanks in advance to all who take the time to read and help out!

    I appreciate that you're trying to surmise what's different, and it's good that you have had success with similar/identical hardware.  At least you know it can work.
    However, I wouldn't bet just yet that it's a permissions issue.  I'd think you should get a specific error if a locked-down file needed to be accessed, not a null pointer crash.  The Photoshop installer should be setting up the proper permissions on its own files for it to run.
    Is it exactly the same video card as the other computer, on which Photoshop works?
    Are you sure the video drivers are up to date with the same version as on the other computer?
    At exactly what point during startup does the failure occur (i.e., is the splash screen showing, and what does the status line in the splash screen say it's doing)?
    -Noel

  • QTSS file and folder permissions

    I am having a lot of problems getting QTSS and QTSS Publisher working correctly. I think this may be due to file and folder permissions. Does anyone know what the correct ownership and access settings should be for the folders containing my quicktime files?
    Thanks.

    Try setting the ownership and permissions of those files to the ones mentioned on the end of this page, which are: owner: qtss, group: admin, permissions for owner and group: Read & Write, and Read only for others.
    (13414)

  • Would like to create a script for list all elements and structure of an indesign document

    Hello everybody,
    I'm a very beginner in indesign scripting.
    I would like to create a script in order to list all elements and the inner structure of a n indesign document.
    The aim for me is to understand how elements are sorted and arranged into indesign, and be able to find an specific element by its item name.
    The output document could be an xml or txt document with a treeview structure.
    I would like have a rough idea of which kind of javascript code I should use for that.
    Thanks for answers.

    Hi Ossydoc,
    You can use Muse to create such a website. All you need to do is, create links in Muse for the sermons and select  " link to File " in the hyperlink option and link to those Mp3 files.
    Please refer to this screenshot :- http://prntscr.com/4xvdup
    Now, when you publish your site,  Muse would automatically upload those files onto the server and the users would then be able to listen as well as download those sermons using the links on your site.
    Hope this helps
    Regards,
    Rohit Nair 

  • How to list all files and directories in another directory

    I need to be able to list all the directories and files in a directory. I need to write a servlet that allows me to create an html page that has a list of files in that directory and also list all the directories. That list of files will be put into an applet tag as a parameter for an applet that I have already written. I am assuming that reading directories/files recursively on a web server will be the same as reading directories/files on a local system, but I don't know how to do that either.

    Hi,
    Here is a method to rotate through a directory and put all the files into a Vector (files).
          * Iterates throught the files in the root file / directory that is passed
          * as a parameter. The files are loaded into a <code>Vector</code> for
          * processing later.
          * @param file the root directory or the file
          *         that you wish to have inspected.
         public void loadFiles(File file) {
              if (file.isDirectory()) {
                   File[] entry= file.listFiles();
                   for (int i= 0; i < entry.length; i++) {
                        if (entry.isFile()) {
                             //Add the file to the list
                             files.add(entry[i]);
                        } else {
                             if (entry[i].isDirectory()) {
                                  //Iterate over the entries again
                                  loadFiles(entry[i]);
              } else {
                   if (file.isFile()) {
                        //Add the file
                        files.add(file);
    See ya
    Michael

  • Listing all files in folder as document file

    How can I import all file names in a folder into a document file?
    With DOS I used the DIR-command for example "dir c: > filename.doc"

    Hi and welcome to Discussions,
    have a look at PrintFinder http://www.macupdate.com/info.php/id/16935/printfinder
    Hope it helps
    Stefan

  • How do I ensure permissions I set apply to all files and folder below

    Hi Everyone,
    I dont know if you will be able to help but Im sure someone will know the answer to this one.
    OK, so, I run my MAC with a VMWare Fusion Windows Virtual Machine running Windows 7  and I manage my time machine and some other backups using a Netgear ReadyNAS NV+.
    What I am finding irritating is that say I use the Apple+CTRL+i command to change the permissions on the 'Pictures' folder to give the account I use for the Windows access and ReadyNAS access to have 'Read + Write' permissions, then 'apply to enclosed items', this works fine.
    However, should I move files, create new ones or the system creates new ones, it does not apply the permissions I set. This is irritating because it is preventing the NAS box from completing a sucessful backup and I often find that if I try and open an image for example on my Windows VM, I will get a messaging informing me that I don't have permission to open that file.
    What I then have to do is repeat the permissions setting process, then I can open the file and work on it.
    This is becomming extraordinarily irritating and Im sure there is something I can do but I dont know what that may be.
    PLEASE can someone help me from going insane!?
    Thanks,
    Ross

    When you create an action, the first step is the "Start with" step where you can select a folder. Just to the right of that there's an icon that you can click to select other file types. Just deselect them all.
    An alternative it to temporarily move the PDFs to another folder.

  • File and folder permissions

    I just updated to Snow Leopard and created a new account. I moved my files to the new account and many but not all now require permission to do anything. I know how to change a file but the option to unlock, change a permission and "apply to enclosed items" is working for only enclosed folders but enclosed files. In the past I've sent files to my co-workers and self at work and worked with them with no problem. Now I can't use them on the same computer. What a pain. Please advise.
    Thanks

    I made a new account the normal way in System Prefs - Accounts then moved the files to a folder in the HD root directory. That was easy and many but not all files are problematic

  • Default File and Folder Permissions

    Hello everyone,
    Is there anyway to set a default file/folder permissions for a parent folder and then if any new files or folders get created within that folder that files use 0644 and folder use 0755? I'm running MAMP for a localhost test site to run Joomla CMS, I have the parent folder set to 0755 but when ever I install a new extension in to Joomla the files are not writable. Is there a way I can set the main parant plublic_html / www folder to work like this for new child files and folders?
    Thanks guys.

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • How to create power shell script to upload all termset csv files into the SharePoint2013 local taxonomy ?

    Hi Everyone,
    I want to create a powershell script file
    1) Check a directory and upload all termset csv files into the SharePoint local taxonomy.
    2) Input paramaters - directory that containss termset csv files, Local Termstore to import to,
    3) Prior to updating get a backup of the existing termstore (for rollback/recovery purposes)
    4) Parameters should be passed in via XML file.
    Please let me know how to do it.
    Regards,
    Srinivas

    Hi,
    Please check this link
    http://termsetimporter.codeplex.com/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Power Shell Script to pull all deactivated users

    Has anyone written a script to pull a list of deactivated users?
    my goal is to validate sharepoint administrators in AD to see if they are active or deactivated. Any insight would be appreciated.

    yes. sorry for not making that clear. I found a few examples to enter in a user name to check AD, but i need to do that with a list of names instead rather than one by one.
    Hi,
    Here's a few possibilities:
    Returns all disabled AD accounts -
    Search-ADAccount -AccountDisabled
    Checks each username listed -
    $usersToCheck = 'tester1','tester2','tester3','tester4'
    foreach ($user in $usersToCheck) {
    If (((Get-ADUser $user).Enabled) -eq $true) { Write-Host "$user is enabled in AD" -ForegroundColor Green }
    Else { Write-Host "$user is disabled in AD" -ForegroundColor Red }
    Reads a text file of usernames and checks those -
    Get-Content .\userList.txt | ForEach {
    If (((Get-ADUser $_).Enabled) -eq $true) { Write-Host "$_ is enabled in AD" -ForegroundColor Green }
    Else { Write-Host "$_ is disabled in AD" -ForegroundColor Red }
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Modifying my script to list all folders and their lastwritetime on remote computers

    Hello,
    I've got the following script that is trying to report on a list of computers (in computerlist.txt) the contents of the C:\Users folder and list in the resulting CSV File the Name of the computer, the Folder Name and the Date it was last changed (sort by
    most recent first).
    $servers = GC C:\Powershell_Scripts\computerlist.txt
    ForEach($server in $servers) {
    If (Test-Connection -comp $server -count 1 -quiet) {
    Get-Childitem ("\\$server\c$\Users") | Where-Object { $_.mode -like 'd*' } | Select-Object $server, Name, LastWriteTime | Export-Csv C:\Apps\Powershell_Scripts\LastLogin\Reports\directoryFile.csv
    I'm part way there but my script is not showing each computer..only the last computer in the list.
    Please assist with making the necessary changes to this script.
    Thank you.

    Thanks for the reply Mike.
    I am running version 3.  I've added the -Append to my script but it doesn't seem to like it.  Here's the error I get:
    Export-Csv : Cannot append CSV content to the following file: C:\Powershell_Scripts\Reports\directoryFile.csv. The appended object does not have a property that corresponds to the following column: ServerABC. To proceed with mismatched
    properties, add the -Force switch and retry.
    Where ServerABC is the name of the first server in computerlist.txt. 
    Here is how I added the -Append:
    $servers = GC C:\Powershell_Scripts\computerlist.txt
    ForEach($server in $servers) {
    If (Test-Connection -comp $server -count 1 -quiet) {
    Get-Childitem ("\\$server\c$\Users") | Where-Object { $_.mode -like 'd*' } | Select-Object $server, Name, LastWriteTime | Export-Csv -Append C:\Apps\Powershell_Scripts\LastLogin\Reports\directoryFile.csv
    The report being written out also isn't in the format I need.
    ServerABC Name LastWriteTime
    User1 5/12/2014 16:11
    ADMINI~1 7/30/2012 13:37
    User2 4/1/2014 18:23
    How do I modify this to show the following output instead:
    Computer Name LastWriteTime
    ServerABC User1 5/12/2014 16:11
    ADMINI~1 7/30/2012 13:37
    User2 4/1/2014 18:23
    ServerDEF User1 6/14/2014 14:12
    ADMINI~1 6/24/2012 15:38
    User2 5/1/2014 20:25
    Thank you.

  • File and folder permissions for specific AD groups

    Having a special folder over multiple servers that certain user groups can access with specific permissions I'd like to audit the security mappings using get-acl commandlet. It's easy for a single folder but I would need subfolders and files too. I know
    I can assign a variable say $object = dir c:\MyShare -recurse  and then would need to somehow pipe each object to get-acl and filter for the AD groups I'm interested in. Ideally if the results were then passed on to csv. Can someone help with getting
    this to work?
    yaro

    Hi Yaro,
    I checked your script, and found you haven't defined the variable $folder before use, please refer to the script below:
    $folders = dir D:\TEST1 -recurse | where {$_.psiscontainer -eq $true}
    foreach($folder IN $folders){
    $folder|Get-Acl | Select-Object -ExpandProperty Access | where {$_.identityreference -match "sys|Adm"}
    Get-Acl $folder.fullname | Select-Object -ExpandProperty Access | where {$_.identityreference -match "sys|Adm"} |
    Select-Object @{n="object";e={ $folder.fullname }},
    @{n="security_principal";e={ $_.identityreference }},
    @{n="type";e={ $_.accesscontroltype }},
    @{n="rights";e={ $_.filesystemrights }}
    And to list the nested groups on local computer, please check this function writed by Boe Prox, which will also list the property "isGroup":
    Get-LocalGroupMembership
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Upgraded to Mavericks and now I can't compress files, move files, preview files or open files outside of their native application. Ran disk utilities multiple times and checked file and folder permissions. Any ideas?

    For example, I'm trying ot move a group of jpgs from one folder ot another and it throws an 8058 error every time. PSD's won't open fromt he finder, it throws an application not found error even though I can open the same files from within the application.

    Yep, same here. Cannot drag and drop copy with Mavericks. A copy paste throws a 8058 error.

  • How do I Get File and Folder Permissions using VBscript?

    I need a mechanism in Vbscript that will allow me to get a file's or a bunch of files permission in a folder. for example: lets say I have a file named something.dll now i need to retrieve what kind of permission it has i.e. Read, Write, Read & Execute,
    Modify or Full Control. Any kind of help will be appreciated. Thanks in Advance.

    Have you tried this >  AssistiveWare - How can I prevent apps from being deleted?
    Unfortunatley, restrictions may be the only way to prevent the app from being deleted 

Maybe you are looking for