Forum Discussion
ondeso666
Dec 23, 2021Copper Contributor
net use in system context and global SMB mount option cannot be removed
Hi folks, I am using the current psexec.exe on my Windows Server 2022 to run Powershell in system context. Then I mount a drive like this: net use X: \\192.168.2.2\X /USER:user password /GL...
- Dec 29, 2021C:\WINDOWS\system32>net use x: \\localhost\admin$ /global
The command completed successfully.
C:\WINDOWS\system32>net use x: /global /delete
x: was deleted successfully.
That does work?
ondeso666
Dec 29, 2021Copper Contributor
You are totally right. Also your purposed solution would fit.
With Powershell it will work fine, my question was regarding the aspect that I can use net.exe to create (seems to be up-to-date) but not to delete (missing feature?) the GLOBAL mapping.
With Powershell it will work fine, my question was regarding the aspect that I can use net.exe to create (seems to be up-to-date) but not to delete (missing feature?) the GLOBAL mapping.
Dec 29, 2021
C:\WINDOWS\system32>net use x: \\localhost\admin$ /global
The command completed successfully.
C:\WINDOWS\system32>net use x: /global /delete
x: was deleted successfully.
That does work?
The command completed successfully.
C:\WINDOWS\system32>net use x: /global /delete
x: was deleted successfully.
That does work?
- ondeso666Dec 29, 2021Copper Contributorto delete a global mapped drive one has to add the global parameter again, thanks for your help
- Dec 29, 2021No problem, didn't use the "Net use" commands like that before so learned something myself too 😉