I want to be able to get the physical path (C:\somepath...
) corresponding to an UNC path to a network share on the local computer (\\mycomputer\somepath...
).
I've tried doing this using ManagementObjectSearcher as described here. This works fine when running as an Adminstrator, but fails when running from a non-privileged account.
No exception is thrown, the SelectQuery
simply returns a ManagementObject whose path
property is null.
I would like to be able to get this information from a non-privileged account, without adding the account to privileged groups such as Administrators or Power Users.
Can anyone indicate how to do this - what are the minimum privileges needed to execute this query successfully?
I've tried giving permission to the account as described here using Computer Management / WMI Control / Security but this makes no difference - even if I give all permissions to the Root node with Apply onto "this namespace and subnamespaces".