Mapping Accessible Network Shares via Powershell
Posted: 2023-Feb-22, 5:34 pm
I have written the following script: line 1: cmdkey /add:pcname /user:network\username /pass:password
line 2: New-PSDrive -Name "E" -Root "\\vm-beta\ShareOne" -Persist -PSProvider "FileSystem".
I want to rewrite this script in that once the login credentials to the NAS have been entered into and saved in Credential Manager, only the network shares that the given user has access to (On the NAS) will be mapped in Windows Explorer instead of having to manually type in those network shares in the script.
Is this doable in Powershell?
line 2: New-PSDrive -Name "E" -Root "\\vm-beta\ShareOne" -Persist -PSProvider "FileSystem".
I want to rewrite this script in that once the login credentials to the NAS have been entered into and saved in Credential Manager, only the network shares that the given user has access to (On the NAS) will be mapped in Windows Explorer instead of having to manually type in those network shares in the script.
Is this doable in Powershell?