I need to list remote shares with a NON-admin user.
The user has the NTFS ReadAndExecute permission on folders and the SMB Read permission on shares.
I tried 3 methods:
Get-CimInstance -ClassName Win32_Share
Get-CimInstance : Access denied
+ CategoryInfo : PermissionDenied: (root\cimv2:Win32_Share:String) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041003,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
Get-SmbShare
Name ScopeName Path Description
---- --------- ---- -----------
ADMIN$ * Remote Admin
C$ * Default share
D$ * Default share
home.User1$ *
home.User2$ *
home.User3$ *
As you can notice, the Path property is empty.
Net Share
Net : System error 5 has occurred.
+ CategoryInfo : NotSpecified: (System error 5 has occurred.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Access is denied.
How can I make this NON-Admin user able to list all shares with their path property.
User contributions licensed under CC BY-SA 3.0