ManagementScope.Connect is slow -
10-11-2007
, 04:58 PM
When I issue a call to connect to the WMI scope using
ManagementScope.Connect method, it takes about 10 seconds to complete.
Subsequent requests are much quicker. Our network does not seem to be the
problem, atleast that's what I have been told. What could be causing this
long pause while it is trying to connect to the server.
Below is a snippet of my code:
oConn = new ConnectionOptions();
oConn.Username = ServerName + @"\" + UserName;
oConn.Password = Password;
oConn.Impersonation = ImpersonationLevel.Impersonate;
mScope = new ManagementScope((@"\\" + ServerName + @"\root\cimv2"), oConn);
try
{
mScope.Connect(); // Takes a while to complete
}
....... |