Net Use Batch File Deployment

Comments

4 comments

  • SelfMan

    The reason for this is that the share mapping is user context based. What thaht mean is, that on one computer any user can have different network share mappings. If you map the drive as admin, it will be available only for the admin. If you have a Windows Server and Active Directory, you should utilize the group policy to map drives. (or the logon script).

    http://blog.zwiegnet.com/windows-server/map-network-shared-drive-in-group-policy/

    BTW, the question has already been asked.

    http://support.adminarsenal.com/entries/238692-Remote-net-use

    You can use this command in the batch:

    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" /v NetDriveMap /t REG_SZ /d "net use X: \\ServerName\ShareName /persistent:yes"

    What it does, it creates a new entry at the RUN key, which is the net use command including parameters and maps the network drive az X:\ when user loggs in.

     

     

    0
    Comment actions Permalink
  • Chris Gintz

    Thank you SelfMan. I have successfully deployed my drive mapping via group policy using a login.bat file.

    I appreciate the assistance.

    0
    Comment actions Permalink
  • SelfMan

    You are welcome.

    0
    Comment actions Permalink
  • Espen Dykesteen

    I realize this post is marked answered, but it might be worth mentioning that it can be done the way OP wants. But it requires that the user needing the mapped drive is logged on. Then you set the package/step to run as logged on user. The user needs to have access to the share to make it work. Either reffer to a bat / cmd file in a install step, or just create a cmd step and add the command there. 

    net use X: \\Server\Share /persistent:yes

    0
    Comment actions Permalink

Please sign in to leave a comment.