I'm trying to clean up a big mess of random mapped network drives. All our network drives have been mapped on a per-user basis (causing gwmi win32_mappedlogicaldisk
to come up empty).
I'm trying to remotely access the registry of each workstation and list the contents of HKCU:\Network
, but when I run this:
$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("CurrentUser", $computername)
$Reg.GetSubKeyNames()
I get only the following output:
AppEvents
Console
Control Panel
Environment
Identities
Keyboard Layout
Printers
Software
UNICODE Program Groups
More than a few subkeys are missing. If I run the same command on my local machine all subkeys are displayed.
Why can't I access these subkeys, and how can I work around it?