Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view folder permission in windows using command line for particular user?

I want to do this using command prompt, sometimes we need to check users permission, so can you please suggest how to view permission using command line in windows, Thanks.

like image 676
Rahul R Avatar asked Mar 20 '19 06:03

Rahul R


1 Answers

You can use the icacls command in cmd. Like this:

icacls folder/file name

eg:

>>> C:\Users\Username> icacls Desktop

Desktop NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(OI)(CI)(F)
ComputerName\Username:(I)(OI)(CI)(F)


While in powershell you can use the command Get-Acl

eg:

PS C:\Users\Username> Get-Acl


    Directory: C:\Users


Path       Owner               Access
----       -----               ------
Username   NT AUTHORITY\SYSTEM NT AUTHORITY\SYSTEM Allow  FullControl...

Or to get the info of all files and folder inside that directory:

PS C:\Users\Username> Dir | Get-Acl


    Directory: C:\Users\Username


Path                     Owner                  Access
----                     -----                  ------
.anaconda                Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.android                 Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.atom                    Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.aws                     Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.conda                   Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.config                  Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.DataGrip2018.2          Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.dotnet                  NT AUTHORITY\SYSTEM    NT AUTHORITY\SYSTEM Allow  FullControl...
.elasticbeanstalk        Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.idlerc                  Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.ipython                 Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.keras                   Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
... List goes on ....
like image 61
Vaibhav Vishal Avatar answered Oct 18 '22 00:10

Vaibhav Vishal