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
**********************
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