|
Well the actual script DOES work when run manually.
I may indeed need to put some sort of sleep/wait command before actually running
the task delete. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darren Mar-Elia When the Scripts CSE
runs, it processes each GPO's scripts in the order of GP processing (LSDOU).
Scripts are run asynchronously to the logon process by default. That means that
they are running at the same time that the user logon process is occurring. For
some types of script operations, this is ok. For others, its not. I think what
you need to do is figure out if this script is failing and on which line its
failing. After each operation, I would put the following: If Err <> 0 Then Wscript.echo err.description End If And then set GP to tell
the script to run visibly so you can see the errors. Or put pauses in the
script after the error is printed. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of I have other GPO’s
with logon scripts and they work fine. In what order are GPO’s run? From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Darren Mar-Elia Hmm. You
might want to trap for errors after each operation to see where its failing. It
could be a timing issue, I suppose, but that shouldn't matter for querying WMI.
Assuming your scripts are running asynchronously (the default) maybe try
putting a sleep into the script at the beginning to see if it is a timing issue
where the user environment is not available when the script is running. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of The
script works with the non-privileged user logged in. Just not through the
GPO. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darren Mar-Elia Does the
user running the job have the privileges to create and modify AT jobs? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of When I run this script manually, it
works and deletes system created At jobs. But when I place this in
a logon script in GPO, it doesn’t run. Any reason why? On Error Resume Next strComputer = "." Set objWMIService =
GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2") Set colScheduledTasks =
objWMIService.ExecQuery _ ("Select *
from Win32_ScheduledJob") For Each objTask in
colScheduledTasks intJobID =
objTask.JobID Set objInstance =
objWMIService.Get _
("Win32_ScheduledJob.JobID=" & intJobID)
objInstance.Delete Next Windows
Systems Engineer Southern
Wine & Spirits - BSG 954-602-2469 __________________________________ |
- RE: [ActiveDir] Schedueled Tasks script in GPO Harding, Devon
- RE: [ActiveDir] Schedueled Tasks script in GPO Harding, Devon
- RE: [ActiveDir] Schedueled Tasks script in GPO Darren Mar-Elia
