This method assumes the file server is setup with permissions using the method described on the JumpCloud Engineering blog here.
Note: This method will create a g: drive upon user login, put the login script in c:\scripts\ and name the registry key 'mapdrive'. These are all variables that can easily be changed to accommodate different use cases and environments.
1. Create a batch file containing the following, replacing the net use path as necessary:
echo off reg add hklm\software\microsoft\windows\currentversion\run /v mapdrive /t REG_SZ /d c:\scripts\netuse.bat /f mkdir c:\scripts echo net use * /delete /yes > c:\scripts\netuse.bat echo net use g: "\\fileserver\share" /user:%%username%% >> c:\scripts\netuse.batFor this example, name it setnetdrive.bat
2. Create a Command in the JumpCloud admin console, deselect powershell. The contents of the command as follows:
cmd.exe /c c:\windows\temp\setnetdrive.batGo to the file upload section and upload your setnetdrive.bat to c:\windows\temp and run it on any target system where drives need to be mapped.
*If running a 32-bit operating system modify the command in Step 2 to:
%windir%\sysnative\cmd.exe /c c:\windows\temp\setnetdrive.bat