Solved

VBScript on 2008 Server that uses plink to ssh runs manually but will not run at startup

Posted on 2014-10-10
6
218 Views
Last Modified: 2014-11-03
Thanks to the assistance of experts on Experts Exchange, I finally have a script that will do the following:

1. SSH to a Linux server without login prompt.
2. Run a command and collect the result.
3. Copy files (links) to a specific folder based on the results of the command.

 It beautifully when I run it manually; problem is that it will not run at startup and there is not a single error message anywhere in any log.  I've done the following:

1.  Ensured that local\system has full privileges to all folders/files.
2. Created a scheduled task and had it run the script using the System account to try and get error messages - none.
3. used the -batch option with the plink command in the script but that did nothing - except get rid of the CMD blip when I run it manually.
4. set the scheduled task to run the script as the local administrator account and it still didn't work.

5. Set the scheduled task to run the script as my account and it worked fine!!

Anyone have any other suggestions?  It is obviously a permissions issue but both System and local admin have full permission to all the folders files involved.  Can't seem to figure out why it will only run under my account.
0
Comment
Question by:yccdadmins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 

Author Comment

by:yccdadmins
ID: 40374229
Code is attached...
Working-code.txt
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 40374748
there is another permission... The account needs "Log on as a batch job" permissions via either local or group policy.

I create a special account under which to run scheulded tasks. Makes it easy to change permissions withoiut upsetting the System or Administrator accounts.
0
 

Author Comment

by:yccdadmins
ID: 40380931
Excellent.  I'll try that with a local account and see how it goes....
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:yccdadmins
ID: 40394767
So far permissions were not the issue but I've tried just about everything else.  At this time I'm trying to run the script as a scheduled task that runs at startup.  Adding the script to local policy as a startup script did not work and there were no errors in any logs to figure out why.

For the scheduled task:

1.  Set local policy to "always wait for the network at computer startup.
2.  Set a delay of one minute.
3.  In the task scheduler - I configure the task to start only if network connection is available.

For number 1 - no difference.  I still received the "no logon server available" error from the scheduled task.
For number 2 - it did nothing.
Number 3 - I get an error when I set the task to start "only if network connection is available" stating that the task could not start because of the restriction I set.

I can set the scheduled task to run after an event in the logs so next, I'm going to try and find out what event tells me that the logon server is available and have the script run after that.

Any other suggestions are appreciated.
0
 

Accepted Solution

by:
yccdadmins earned 0 total points
ID: 40411594
This issue has been resolved. The only thing stopping the script from running at startup was the following check box:

"Do not store password.  The task will only have access to local computer resources."

I had to select "Run whether user is logged on or not" because the script runs on an hourly scheduled task.  The "Do not store password..." selection was checked by default.

Through trial and error I unselected the "Do not store password" selection and the script ran at startup without the logon server errors etc.

Tried to upload the image but could not seem to get it under 59 MB.

Guess I get the points.....
0
 

Author Closing Comment

by:yccdadmins
ID: 40419051
I found the solution myself using trial and error within the scheduled task properties after determining that there were no permissions issues.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OfficeMate Freezes on login or does not load after login credentials are input.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question