Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Task Scheduler vbscript - User authentication?

Status
Not open for further replies.

dunnse

IS-IT--Management
Aug 10, 2004
2
US
Along the same lines of using a vbscript to schedule a task, I am trying to schedule a task to run an inventory application from across the network by using a vbscript. I can schedule the task to run, both on my local computer or pushed out to a remote computer, but it always fails due to the fact that it is using the SYSTEM account. Is there anyway to schedule a task and force it to use a specific user account & password, utilizing the Run As in Task Scheduler? The following is what I have thus far:

**********************
strComputer = "."
strApp = "\\10.135.10.18\appl1\trackit\audit32.exe"
strTime = "********165000.000000-420"

Set objService = GetObject("winmgmts:\\" & strComputer)
Set objNewJob = objService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
(strApp, strTime, _
False , 0, , True , JobID)
If Err.Number = 0 Then
Wscript.Echo "New Job ID: " & JobID
Else
Wscript.Echo "An error occurred: " & errJobCreated
End If
**********************

Any help on this would be greatly appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top