RunAs /savecred Expiring!
I'm having to use a batch file to resolve a program starting with the correct profile setting. The batch file uses the RunAs command and specifiys the profile to use, and by adding the /savecred switch I only have to provide the password once and then it can be schedule to run un-aided there after. C:\Windows\System32\Runas.exe /profile /savecred /user:{domain}\{user} "My Program.exe" Well that was the plan, but after about a week of it working fine, it failed because I needed to re-enter the password again. Even though the password hasn't changed or expired. Does anybody know if a setting or group policy that affects the RunAs /Savedcred switch? Many thanks Steve
July 4th, 2011 12:01pm

1. This account should be set without expiration time (... before starting your script and forever) 2. What have you obtained from resulting policy for this account? 3. Reformulate your script into something like (.... and have some more output from the script execution) @echo off echo %date% %time% %username% >> c:\temp\test.txt C:\Windows\System32\Runas.exe /profile /savecred /user:{domain}\{user} "My Program.exe" 1>>c:\temp\test.txt 2>>&1 echo %date% %time% >> c:\temp\test.txt Regards Milos
Free Windows Admin Tool Kit Click here and download it now
July 4th, 2011 10:50pm

Hi, It seems that when you run the batch file, you were prompted to re-enter the password. How about running the command directly via CMD? Any differences? After we use runas /savecred to use credentials previously saved by the user, a new entry is stored on the computer, you can check it by clicking Start > Run > control userpasswords2 > Advanced > Manage Passwords. If you are using Windows 7, launch Run by pressing Windows key + R. Can you find the relative entry to run the program? Also, any errors in the Event Log? Please also run “gpresult /v > C:\policy.txt” on a problematic client and paste the output here for research. Thanks. NinaPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
July 5th, 2011 12:46pm

Thanks for the feedback. Let me explain a little further what is going on (or not), and how I am using the RunAs service. I'm starting a Dynamics (GP) Integration job via SQL Integeration Services (ssis). I use ssis to launch a batch file that contains the macros and commands needed to start GP, log into the correct company and then start the importation of invoices. This is something I have been doing for almost 10 years. However, since the later versions of GP have been adapated to make them internet friendly I've experienced problems with this approach. The key one is that although I have specified a user to run the job, when it does run as a service it seems to use the default profile which causes sporadic problems with GP starting. The answer seems to be in using a batch file with RunAs in it and launching the primary batch file this way. I know the profile switch resolves this issue as I've monitored the job with procman. Because its a job that needs to run each weekday it needs to run without human intervention. I though I was on to a winner with the /savecred switch, as once specified initially, all repeated attemts would not required the password again. For the first week it ran fine, then on the Monday (one week later) I noticed the job had failed. In the windows task manager the user account used for the job was stuck on the RunAs.exe (waiting for a password). About a week later the same thing happended again, and then it happend a third time after only 3 days. In all this time the password has not expired or been changed, in fact to get it going again all I have to do is log on as the account and re-confirm the password. For an automatted job this is not a solution. I've run the gpresult command and studied the output, but can find nothing out of the oridinary or justification for the cached credentials expiring. What could be happening on the server for it not to use the cached credentials? Many thanks Steve
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2011 3:59pm

I am afraid it is difficult to help. Partly it is by lack of basic information about system used and configuration. Do not expect we could give you advice for Windows 2000, 2003, 2003 R2, 2008 and 2008 R2. TEN years from now is 2001, which means Windows 2000. Is this true? Are you using this operating system now? Please attach files as requested - this may make the problem solved sooner. I am pretty sure that Dynamics has its own forum. Try to submit well defined question there. To Nina: This is a Server Forum and Windows 7 is NOT server operating system.
July 9th, 2011 2:07pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics