Solved

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

Posted on 2014-10-10
6
203 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
  • 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now