- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to view folder NTFS permission with PowerShell?
To view the NTFS permission with PowerShell, we use the Get-ACL command. This command is supported in PowerShell version 5.1 or later. Generally how we get the security permission of the folder in the Windows OS using GUI,
To get the same permissions shown above using PowerShell, use the below command.
Get-Acl C:\Shared
PS C:\> Get-Acl C:\Shared Directory: C:\ Path Owner Access ---- ----- ------ Shared BUILTIN\Administrators NT AUTHORITY\SYSTEM Allow FullControl...
You can compare the first image with the above output. You can compare the Owner of the folder and it is Administrator, second part is the Access, to get all the users who have access on this folder by expanding property.
Get-Acl C:\Shared | Select -ExpandProperty Access
Let convert the above output in the table format to get a clear understanding of the output as shown in the first image.
Get-Acl C:\Shared | Select -ExpandProperty Access | ft -AutoSize
So you have everything that you can see in the first image of the folder security property like User rights, File System rights, Inherited or not, etc.
To view the specific user rights, you can filter with the username. For example,
Get-Acl C:\Shared | Select -ExpandProperty Access | where {$_.IdentityReference -like "*user*"} | ft -AutoSize
Similarly, you can also filter other properties like AccessControlType, IsInherited, etc.
- Related Articles
- How to change SMB shared folder access permission using PowerShell?
- How to Copy NTFS permissions using PowerShell?
- How to get the Shared folder permissions with PowerShell?
- How to copy folder contents in PowerShell with –Recurse parameter?
- Grant a user permission to only view a MySQL view?
- How to share a windows folder using PowerShell?
- How to remove windows folder sharing using PowerShell?
- How to get the folder size using PowerShell?
- How to set the Android permission on a folder/file on SD Card to be able to write to it?
- Redirect Output to location with Permission denied Error?
- How to list files from SD card with runtime permission in android?
- How to play videos in Android from assets folder or raw folder?
- How to use MySQL VIEW with WHERE clause?
- Difference Between FAT32 and NTFS
- How to create new alias with PowerShell?
