Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-10-10
6
Medium Priority
?
228 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
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
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…

927 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