\n Hi, and welcome to the PowerShell forum! \n\n\nDon’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need – nobody will think you’re stupid, and the forums are all about asking questions. Just ask! \n\n\nUse a descriptive subject. Don’t say “Need help” or “PowerShell Help”, actually summarize what the problem is. It helps the rest of us keep track of which problem is which. \n\n\nDon’t post massive scripts. We’re all volunteers and we don’t have time to read all that, nor will we copy…\n <\/blockquote>\n<\/aside>\n\n
<\/p>","upvoteCount":0,"datePublished":"2018-11-19T06:43:50.000Z","url":"https://community.spiceworks.com/t/list-all-shared-folders-and-users/684477/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Thank You Neally for your prompt response. I am trying to use below code which was shared by one of spice works member but are not getting the expected result,<\/p>\n
$Header = @\"\n<style>\nTABLE {border-width: 1px;border-style: solid;border-color: blue;border-collapse: separate;}\nTH {border-width: 1px;padding: 3px;border-style: solid;border-color: lightblue;background-color: #CEE3F6;}\nTD {border-width: 1px;padding: 3px;border-style: solid;border-color: lightblue;}\n</style>\n\"@\n\nfunction Get-ShareACL {\n param(\n [String]$Name = \"%\",\n [String]$Computer = $Env:ComputerName\n )\n \n $server = Get-Content C:\\temp\\test.txt\nForeach-Object {\n \n $Shares = @()\n Get-WMIObject Win32_Share -Computer $server -Filter \"Name LIKE '$Name'\" |\n ForEach-Object {\n $Access = @()\n if ($_.Type -eq 0) {\n $SD = (Get-WMIObject Win32_LogicalShareSecuritySetting `\n -Computer $server `\n -Filter \"Name='$($_.Name)'\").GetSecurityDescriptor().Descriptor\n $SD.DACL | ForEach-Object {\n $Trustee = $_.Trustee.Name\n if ($_.Trustee.Domain -ne $null) {\n $Trustee = \"$($_.Trustee.Domain)$Trustee\"\n }\n $Access += New-Object Security.AccessControl.FileSystemAccessRule(\n $Trustee, $_.AccessMask, $_.AceType)\n }\n }\n $_ | Select-Object Name, Path, Description, Caption,\n @{n='Type';e={\n switch ($_.Type) {\n 0 { \"Disk Drive\" }\n 1 { \"Print Queue\" }\n 2 { \"Device\" }\n 2147483648 { \"Disk Drive Admin\" }\n 2147483649 { \"Print Queue Admin\" }\n 2147483650 { \"Device Admin\" }\n 2147483651 { \"IPC Admin\" }\n }\n }},\n MaximumAllowed, AllowMaximum, Status, InstallDate,\n @{n='Access';e={ $Access }}\n }\n}|\n\nConvertTo-HTML -Fragment\n\n}\n$GGG = Get-ShareACL\n\nConvertTo-HTML -Head $Header -Title \"SERVER STATUS\" -Body \"$GGG\" | \nOut-File C:\\temp\\html.htm\n<\/code><\/pre>\n#Scorched-Head<\/span> was able to achieve the above requirement but that topic has been locked by an administrator and is no longer open for commenting.<\/p>\nThanks You in Advance.<\/p>","upvoteCount":0,"datePublished":"2018-11-19T06:56:32.000Z","url":"https://community.spiceworks.com/t/list-all-shared-folders-and-users/684477/3","author":{"@type":"Person","name":"spiceuser-69t2a","url":"https://community.spiceworks.com/u/spiceuser-69t2a"}}]}}