I know how to map a network drive using net use
and psexec
. Out of convenience for my users, I don't want to make them do anything, really. Just request the share and that's it. I want to do the rest without inconveniencing their work at all - in the background. I don't want to change their password to use net use x: \\server\where\share\is\ -u username -p password
. I don't really want to make them download a BAT file. I could transfer a BAT file to their Desktop using psexec -s. However, That still requires them to click on a file and interact with technology I love, but they hate LOL.
How do I map a network drive to another user on the computer if I am logged in as an admin with SYSTEM
permissions because of psexec -s
?
I know the Registry is a database of configurations, I researched and read so many articles about it and blogs, but cannot find anything that discusses copying or moving registry configurations from one folder to another one. I researched the web about this, and need to find out if it can be done manually, which I can then script. But, I don't know how. Do I just do that with Windows Explorer or use move
to move its supporting files.
Here is what I have in mind:
- net use x: \share\name /persistent:yes (makes the drive available to my profile)
- Read
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
However using reg query /v "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
I get ERROR: Invalid key name.
and if done without /ve
or /v
, I get ERROR: The system was unable to find the specified registry key or value.
; however, using regedit.exe
, I can browse to it.
- Parse the target username and find its user ID under
HKEY_USERS
- Move the drive letter information from my profile because using psexec -s used my admin profile on the computer,
HKEY_USERS\{S-S-WHATEVER}\Blah\Network\X
to the target user's registry folder inHKEY_USERS\S-S-WHATEVER2\blah\Network\
Technet does not explain this and neither does any article I found in the last 3 hours.
Thank you for your help! If you help me get the commands right, that would be amazing, and I will give you a $ tip if that is legal on SOF.