Friday 16 May 2014

COMMAND TO LIST ALL SHARED FOLDERS ON WINDOWS SERVER

How to List down shared folders on a windows server?

Below are the powershell commands to list the shared folders and access rights of shared folders.

open powershell with Administrator privileges and paste below command in it.
//To list the shared folders on localhost
gwmi -Class Win32_Share -ComputerName localhost | sort name

//To list the shared folders on remote server
gwmi -Class Win32_Share -ComputerName 10.10.1.x | sort name

//To save shared folders list to a file
gwmi -Class Win32_Share -ComputerName localhost | sort name | out-file C:\TS1.txt

//To list the access rights of a shared folder
Get-Acl D:\TestShare | select -exp Access | out-file C:\TS1\TS1permissions.txt

//To list the access rights of a shared folder and save it to a file.
Get-Acl D:\TestShare | select -exp Access | out-file C:\TS1\TS1permissions.txt


TO LIST DOWN SHARE FOLDERS AND ACCESS RIGHTS IN WINDOWS SERVER 2003

Open command prompt with "Run as" administrator
//To list all the share folders on a server
wmic /output:filename.txt share get caption,name,path

//To list Access rights of a share folder
icacls  sharefoldername /save ts21share.txt

//To list the Access rights of a share folder
cacls sharename 

No comments:

Post a Comment