/build/static/layout/Breadcrumb_cap_w.png

Net Use Command in KACE Deployment isn't working

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!


0 Comments   [ + ] Show comments

Answers (2)

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.
Posted by: SMal.tmcc 11 years ago
Red Belt
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

 


Comments:
  • 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! - samzeeco 11 years ago
    • 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 - SMal.tmcc 11 years ago
      • I see. I'll give that a try and report back. Thanks for the advice. - samzeeco 11 years ago
      • Sure enough, even with the username and password, and it saying the command completed, it still gave me a disconnected network drive. - samzeeco 11 years ago
  • try running this on the machine acting up at the command prompt and then see if your mappings stay
    net config server /autodisconnect:-1 - SMal.tmcc 11 years ago
Posted by: samzeeco 11 years ago
10th Degree Black Belt
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!

 

 


Comments:
  • 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 - SMal.tmcc 11 years ago
    • 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. - samzeeco 11 years ago
      • the info post looks good - SMal.tmcc 11 years ago
  • 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. - samzeeco 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ