Hi Friends,
I need powershell script to dump all the shared folder and thier permission from serverlist.txt. the below code just giving me the shares but not the permissions.
$strComputer = gc C:\ps-test\serverlist.txt
foreach ($computer in $strComputer) {
$colItems = get-wmiobject -class "Win32_Share" -namespace "root\CIMV2" -computername $computer
foreach ($colItem in $colItems) {
$sharename = $colItem.Name
$share = "\\" + $computer + "\" + $sharename | Out-File C:\ps-test\result.txt -NoClobber -Append
$share
}
}