Solved

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

Posted on 2014-10-10
6
211 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

808 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