Closed Alufolie303 closed 4 years ago
I just implemented the Level parameter to Get-NetShares and am now able to get the share list of a Windows 10 Home Edition, where I was previously not able to do so. @Alufolie303 : Could you manually install this version and test it out before I push it to the PowerShell Gallery ?
I released and published version 1.0.22 that solves this issue.
The Get-NetShares function uses the NetShareEnum with 502 level hardcoded to request share information from the smb server. This information level requires the executing user to be a admin on the server. So default user gets the following error:
Sadly the microsoft docs doesn't cover the required priviledges for the information levels. Some short tests showed the following: 0/1 - user (or anonymous?) 2 / 502 / 502 - admin
For i.e. filer and share discovery use cases the user usually doesn't have this rights. So a parameter to control the level would be a helpful feature.
The quick and dirty fix to get arround this is to change the information level in the following lines of the FileShareUtils Powershell module: C:\Program Files\WindowsPowerShell\Modules\FileShareUtils\1.0.19\FileShareUtils.psm1