Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 5:09 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
PostPosted: Mon Feb 28, 2011 10:43 am 
Offline
Newbie

Joined: Tue Feb 22, 2011 3:25 am
Posts: 7
On some Windows systems, the ConnectServer() reports an invalid parameter
error if wbemConnectFlagUseMaxWait is used. A workaround is to retry the
ConnectServer() operation without the parameter when an error occurs.

In Audit.vbs, I would suggest changing code like this:
[code]
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer, "root\cimv2", strUser, strPass, "", "", wbemConnectFlagUseMaxWait)
[/code]
To this:
[code]
Const wbemErrInvalidParameter = &H80041008
[...]
On Error Resume Next
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer, "root\cimv2", strUser, strPass, "", "", wbemConnectFlagUseMaxWait)
If Err.Number = wbemErrInvalidParameter Then
' The flag wbemConnectFlagUseMaxWait apparently is not supported on all systems...
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer, "root\cimv2", strUser, strPass, "", "", 0)
End If
[/code]
Steve


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group