Hello,
I have a script that runs faultlessly until it attempts to access a server on
which my admin account has no access privileges. The script stops cold. On
Error Resume Next does not work. How do I get past this - short of changing my
admin account's access privileges - an impossibility in my environment.
All suggestions will be greatly appreciated.
Thanks,
Bill Burke
bill@2burkes.com
'**************************************************************
'************************** SNIP ****************************
For Each strComputer In arrTargetComputer
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTimeZone = objWMIService.ExecQuery ("Select * from Win32_TimeZone")
For Each objTimeZone In colTimeZone
If objTimeZone.DayLightBias = 0 Then
If objTimeZone.Bias >= 0 Then
objTZoffsetMinutes = "+" & objTimeZone.Bias
Elseif objTimeZone.Bias < 0 Then
objTZoffsetMinutes = objTimeZone.Bias
End If
Else
If objTimeZone.Bias = 0 Then
objTZoffsetMinutes = "+" & (objTimeZone.Bias)
Elseif objTimeZone.Bias >0 Then
objTZoffsetMinutes = "+" & (objTimeZone.Bias - 60)
Elseif objTimeZone.Bias < 0 Then
objTZoffsetMinutes = (objTimeZone.Bias + 60)
End If
End If
Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")_
Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
patchJobCreated = objScheduledJob.Create_
& ("D:\Windows2000-KB824146-x86-ENU.exe", arrTimeToPatchValue(strPatchTime)_
& objTZoffsetMinutes, False , , , , JobID)
ShutdownJobCreated = objScheduledJob.Create_
& ("D:\Shutdown.exe /L /R /Y /C", arrTimeToRebootValue(strRebootTime) _
& objTZoffsetMinutes, False , , , , JobID)
Next
'**************************************************************
'************************** SNIP ****************************