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 Harding, Devon
Sent: Monday, January 09, 2006 10:15 AM
To: [email protected]
Subject: RE: [ActiveDir] Schedueled Tasks script in GPO

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
Sent: Monday, January 09, 2006 12:21 PM
To: [email protected]
Subject: RE: [ActiveDir] Schedueled Tasks script in GPO

 

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 Harding, Devon
Sent: Monday, January 09, 2006 9:08 AM
To: [email protected]
Subject: RE: [ActiveDir] Schedueled Tasks script in GPO

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
Sent: Monday, January 09, 2006 11:55 AM
To: [email protected]
Subject: RE: [ActiveDir] Schedueled Tasks script in GPO

 

Does the user running the job have the privileges to create and modify AT jobs?

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Harding, Devon
Sent: Monday, January 09, 2006 8:25 AM
To: [email protected]
Subject: [ActiveDir] Schedueled Tasks script in GPO

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

 

Devon Harding

Windows Systems Engineer

Southern Wine & Spirits - BSG

954-602-2469

 


__________________________________
This message and any attachments are solely for the intended
recipient and may contain confidential or privileged information.
If you are not the intended recipient, any disclosure, copying, use
or distribution of the information included in the message and any
attachments is prohibited. If you have received this communication
in error, please notify us by reply e-mail and immediately and
permanently delete this message and any attachments. Thank You.

Reply via email to