How can I mount network drive on azure vm by using run command?

165 Views Asked by At
  1. I use this PowerShell script on Run Command in azure VM page. Image1

Test-NetConnection -ComputerName [name] -Port 445

Invoke-Expression -Command "cmdkey /add:[path] /user:[username] /pass:[password]

net use Y: \[path] /u:[username]

  1. Return success
  2. But when I enter the VM and found that error as below: Image2

I have no idea what wrong with that. Does anyone encounter that problem, too?

1

There are 1 best solutions below

1
Hannel On

You mount drive using net use this has been an on going thing with Windows for a while.

Check the drive letter in Command Prompt or Powershell, if the mount command was successful it should be there.