Solved

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

Posted on 2014-10-10
6
208 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

911 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