Ninja,

I've got a weird issue that I haven't been able to find much help on. I'm working on a package for Microsoft Dynamics SL 2011 (Which supposing I get it working I will be putting into the Software section here). But I'm having a strange problem. When I run the install from the computer, it's perfect, no problems. However, when I run it from the KACE Deployment the .bat file uses a net use command, and while it maps the letter drive, it appears as disconnected and even though you have full access to it, it doesn't act like it's there. Oh, and to make it even stranger, it only happens on Windows 7 64bit! The 32bit install works like a champ!

This causes issues with the rest of the install. I've tried changing the line to Net use S: \\<Server>\ /user:%username% but that just results in the script running with the computer name instead of the current logged in user. My former co-worker I talked to said he ran into this as well, but he couldn't quite remember what he did to fix it. I was hoping I wasn't alone out there with this problem and that somebody else had had this issue.

Thanks for reading!

Answer Summary:
Basically we have to trick the program into running as the current user rather than the one that the KACE Deployment uses. First I had to download the "RunAsCurrentUser.exe" utility located HERE: http://support.bigfix.com/download/bes/util/RunAsCurrentUser.exe. Then I took part of my script from my install.bat that mapped the drive and created a file called netmap.bat. I turned that into an executable using iexpress.exe (default on windows 7). and then in my install.bat file I started with "RunAsCurrentUser.exe --w "netmap.exe"" which ran the program and successfully mapped the network drive even through deployment with KACE.
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

2

are you using the /persistent:yes switch? If you are running this with a logged in user (online kscript) leave out the user and password switch and it will use the current users credentials to try to attach

 

Answered 01/22/2013 by: SMal.tmcc
Red Belt

  • I haven't been using the persistent switch. It's running through the software deployment, not a script, so to my knowledge there's not a place to change the user like there is when you run a script. Thanks for the fast answer!
    • The Mi runs as system so you will need the user and password switches. you may also have to use /savecred switch for it stick
      • I see. I'll give that a try and report back. Thanks for the advice.
      • Sure enough, even with the username and password, and it saying the command completed, it still gave me a disconnected network drive.
  • try running this on the machine acting up at the command prompt and then see if your mappings stay
    net config server /autodisconnect:-1
Please log in to comment
2

I finally found a solution! It took some serious Shenanigans, but I did it!

Basically we have to trick the program into running as the current user rather than the one that the KACE Deployment uses. First I had to download the "RunAsCurrentUser.exe" utility located HERE: http://support.bigfix.com/download/bes/util/RunAsCurrentUser.exe.

Then I took part of my script from my install.bat that mapped the drive and created a file called netmap.bat. I turned that into an executable using iexpress.exe (default on windows 7). and then in my install.bat file I started with "RunAsCurrentUser.exe --w "netmap.exe"" which ran the program and successfully mapped the network drive even through deployment with KACE.

I had to do the same for the SL install as well, but I'll go even more in depth when I create the software record for my install. Hopefully I'll be finished and can create it tomorrow!

 

 

Answered 01/22/2013 by: samzeeco
Tenth Degree Black Belt

  • Be a good item to post to put in the software area or create a blog about. You could create a run entry to map the drive
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v mapdrive /d "net use \\server\share" or push the mapping with a GPO if member of that software group
    • Here it is! http://www.itninja.com/software/microsoft-corporation/microsoft-dynamics-sl-2011-fp1-client/8-235

      I'll also be creating a blog post soon about the difficulty of figuring out how to get the bat file I needed to run as the current user in managed installations.
  • I certainly will be. I'm most certainly going to create a software entry, and was thinking about turning it into a blog. I've just got to get the uninstall of the previous version working before the MI is 100% working.
Please log in to comment
Answer this question or Comment on this question for clarity