How to Get the Time When IIS Started With Classic ASP?
+3
A:
' This works on my machine... '
Option Explicit
Dim objWMIService, procs, proc, creationDate
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set procs = objWMIService.ExecQuery ("Select * from Win32_Process where name='inetinfo.exe'")
For Each proc In procs
creationDate = creationDate & vbCr & proc.CreationDate
Next
Jonas Elfström
2009-06-15 18:36:32
Seems to throw "error '80041003'" on my machine unless I disable anonymous access in IIS for the ASP page that executes the above script.
Saul Dolgin
2009-06-16 13:57:26
Sounds like the user that your ASP application runs as does not have enough privileges, maybe temporarily impersonating another user could help: http://support.microsoft.com/kb/248187
Jonas Elfström
2009-06-16 14:31:45
Cool... Works for me!
Daniel Silveira
2009-06-16 18:16:38