cannot map a network drive using snapin
-
Server
- FOG Version: 1.3.3
- OS: centos 6.4
Client
- Service Version: sp1
- OS: windows 7
Description
hi
i have a simple script that map a network drive, this is the script:
net use r: \ph.ph.biu.ac.il\Programs MYPASSWORD /user:DOMAIN\MYUSERNAME
when i double click it, it work perfect
when i try to use fog to deploy it with a simple snapin, it map it with a red X and when i try to access it, i get a message “r: is not accessiable, login failure unknown username or bad password”
this is the fog log:----------------------------------------------------------------------------- ---------------------------------SnapinClient--------------------------------- ------------------------------------------------------------------------------ 28/03/2017 16:04 Client-Info Client Version: 0.11.8 28/03/2017 16:04 Client-Info Client OS: Windows 28/03/2017 16:04 Client-Info Server Version: 1.3.3 28/03/2017 16:04 Middleware::Response Success 28/03/2017 16:04 SnapinClient Snapin Found: 28/03/2017 16:04 SnapinClient ID: 88 28/03/2017 16:04 SnapinClient Name: amapdrive 28/03/2017 16:04 SnapinClient Created: 2017-03-28 13:41:31 28/03/2017 16:04 SnapinClient Action: 28/03/2017 16:04 SnapinClient Pack: False 28/03/2017 16:04 SnapinClient Hide: False 28/03/2017 16:04 SnapinClient Server: 28/03/2017 16:04 SnapinClient TimeOut: 0 28/03/2017 16:04 SnapinClient RunWith: cmd.exe 28/03/2017 16:04 SnapinClient RunWithArgs: /c 28/03/2017 16:04 SnapinClient Args: 28/03/2017 16:04 SnapinClient File: amapdrive.cmd 28/03/2017 16:04 Middleware::Communication Download: http://132.70.33.80/fog/service/snapins.file.php?mac=5C:F9:DD:75:0D:C2||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&taskid=88
-
@oraniko you need to keep in mind the client runs as Windows service, which gets run as SYSTEM (that is, a non-interactive user). This means you’ll need to take non-supported approach to get this working. Change
net use r: \ph.ph.biu.ac.il\Programs MYPASSWORD /user:DOMAIN\MYUSERNAME
to
net use r: \ph.ph.biu.ac.il\Programs MYPASSWORD /user:DOMAIN\MYUSERNAME /persistent:yes
Now, you need to keep in mind SYSTEM now owns this network mapping, and so only SYSTEM can remove it. In addition, Microsoft doesn’t really support this, so its likely the drive will show as disconnected for all users, but it should still be accessible if they try to open it.
Perhaps a better approach would be to make a GPO logon script to auto mount these network shares.