Re: WMI EnableStatic Method hangs vb app



Thanks for the reply. The problem occurs when executing the method.
The call happens and the change is implemented, however the WMI
connection to the host is lost since the IP is no longer set to what it
was when the initial connection was made. When I execute the method on
a local machine the enablestatic method works as expected with the
return values you linked in your reply, but making the changes remotely
cause the app to hang.

Here is the code for the EnableStatic Method. The app hangs where I've
drawn the arrow on the dim outparams line.

If (isEmbedded = False) Then
Dim inParams As System.Management.ManagementBaseObject
= Nothing
inParams =
NetAdapter.GetMethodParameters("EnableStatic")
inParams("IPAddress") = CType(IPAddress, String())
inParams("SubnetMask") = CType(SubnetMask, String())
------>>> Dim outParams As System.Management.ManagementBaseObject =
NetAdapter.InvokeMethod("EnableStatic", inParams, Nothing)
Return
System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
Else
Return System.Convert.ToUInt32(0)
End If

Thanks
Nick


Manbinder Pal Singh [MSFT] wrote:
It shouldn't hang. You shuold be getting one of the return codes as
mentioned in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/enablestatic_method_in_class_win32_networkadapterconfiguration.asp.

You should see what exactly is hanging. Is this some following call? Can you
also try the same on other box.

Thank You,
Manbinder Pal Singh

This posting is provided "AS IS" with no warranties, and confers no rights.
"Nick" <nporelle@xxxxxxxxx> wrote in message
news:1162490005.323014.325510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm currently working on a program in VB.Net 2005 to remotely change
the IP/Subnet Mask of a specified host. The problem occurs when I
change the IP address/Subnet Mask using the EnableStatic method, the
WMI connection to the remote host is lost since the IP address has
changed and the app is waiting for a return value indicating the
success or failure of the change.

Is there somewhere I can lower the timeout value or indicate that I do
not want the return value from the method so that I can re-initiate the
WMI connection with the new IP?

I've got it working using psexec and Netsh, but I'd like to avoid using
this procedure if at all possible.
Thanks
Nick


.



Relevant Pages

  • understanding chkrootkit: sshd section
    ... Rhosts Authentication disabled, originating port will not be trusted. ... Secure connection to %.100s on port %hu refused%.100s. ... Warning: Remote host refused compression. ... Received RSA challenge from server. ...
    (comp.os.linux.security)
  • understanding chkrootkit: sshd section
    ... Rhosts Authentication disabled, originating port will not be trusted. ... Secure connection to %.100s on port %hu refused%.100s. ... Warning: Remote host refused compression. ... Received RSA challenge from server. ...
    (comp.security.unix)
  • Re: ICS and FS trouble
    ... >>>client for ms networks, service advertising protocol, file and printer ... >>>execept that the MS beta AntiSpyware connects to the internet and recognises ... >> Microsoft doesn't support changing the ICS host computer's LAN ... >> Internet connection has a 192.168.0.x address that can't be changed to ...
    (microsoft.public.windowsxp.network_web)
  • Re: understanding chkrootkit: sshd section
    ... Connection will not be encrypted. ... > Rhosts Authentication disabled, originating port will not be trusted. ... > Could not request local forwarding. ... Remote host failed or refused to allocate a pseudo tty. ...
    (comp.os.linux.security)
  • Re: understanding chkrootkit: sshd section
    ... Connection will not be encrypted. ... > Rhosts Authentication disabled, originating port will not be trusted. ... > Could not request local forwarding. ... Remote host failed or refused to allocate a pseudo tty. ...
    (comp.security.unix)