创建用户-映射网络驱动器CMD

我有一个自动执行的管道(可能是一个bat文件),而无需在Windows 10机器上手动执行所有步骤。

管道步骤:

  1. Create a normal user account e.g userA. I know this can be done using this net user userA passuserA /add
  2. 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?