I have a pipeline which I want to do automatically (probably with a bat file) without the need to do all steps manually on my windows 10 machine.
Pipeline steps:
- Create a normal user account e.g userA. I know this can be done using this
net user userA passuserA /add
- Map network drive using cmd, I know this can be done using
net use * \\myshared\directory /u:domainname\domuserA password
but I wonder if this will work without being logged in the machine? which brings me to my question is there a way Login to the computer using userA remotely once it's created then mount the drive to the user. My goal is that to put all this in a batch file and run it so that I don't have to repeat these steps but I am not sure how it can be done?