EnableStatic on a disconnected media



Hi,

I'm having some trouble setting a network adapter in static adressing
mode. When I call the EnableStatic method I get an error code 94 (Path,
files or object not found.). However, when I check the configuration of
my local area connection, I notice that it was configured properly. I'm
working with local wmi call.

Here are my connection options:
this.connectionOptions.EnablePrivileges = true;
this.connectionOptions.Authentication =
AuthenticationLevel.PacketPrivacy;
this.connectionOptions.Impersonation =
ImpersonationLevel.Impersonate;

Here is my WMI method call:
ManagementBaseObject inParams =
target.GetMethodParameters("EnableStatic");
if (parameters != null)
{
inParams["IPAddress"] = new string[] {
value.IPAddress.ToString() };
inParams["SubnetMask"] = new string[] {
value.SubnetMask.ToString() };
}
uint result = (uint)target.InvokeMethod("EnableStatic",
inParams, this.methodOptions).GetPropertyValue("ReturnValue");

NOTE:IPAddress and SubnetMask are of type System.Net.IPAddress

Also, EnableDHCP seem to have the same behavior. Any idea how should I
solver my problem?

Regards,
Alexis Héon

.


Loading