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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event 1524 when Scheduled Task runs script

Status
Not open for further replies.

BenChristian

IS-IT--Management
Jan 11, 2004
193
AU
I have created a scheduled task that runs a script (vbscript) that checks disk space on a Windows server 2003 member server each hour. When the scheduled task completes I get the following Event in the Application log:

Event Type: Warning
Event Source: Userenv
Event Category: None
Event ID: 1524
Date: 29/07/2005
Time: 9:45:45 AM
User: SYD01AV\Administrator
Computer: SYD01AV
Description:
Windows cannot unload your classes registry file - it is still in use by other applications or services. The file will be unloaded when it is no longer in use.



For more information, see Help and Support Center at

After a few minutes another event is generated informing me that the profile was successfully unloaded:

Event Type: Information
Event Source: Userenv
Event Category: None
Event ID: 1516
Date: 29/07/2005
Time: 9:50:43 AM
User: NT AUTHORITY\SYSTEM
Computer: SYD01AV
Description:
Windows unloaded user S-1-5-21-248014780-2965674001-1819737653-500_Classes registry when it received a notification that no other applications or services were using the profile.

For more information, see Help and Support Center at

This only happens on Windows Server 2003. For the purpose od testing, the account used to run the scheduled task has local admin rights on the server.

Any ideas?
Thanks.
 
More specifically, it appears to be the winmgmts moniker that is causing the problem. If I use another script without connecting to WMI it doesn't produce the event. So the piece of code causing the problem is:

Code:
Set objWMIService = GetObject("winmgmts:" _
	    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top