directoryservices - How to avoid WMI DirectoryEntry caching failed connections -
when making wmi call using directoryentry in c# appears failure cached retries fail without retrying.
here's i've done reproduce this:
directoryentry directoryentry = new directoryentry(); directoryentry.authenticationtype = authenticationtypes.secure; directoryentry.username = connectusername; directoryentry.password = connectpassword; directoryentry.path = "winnt://" + connectservername + ",computer"; newuser = directoryentry.children.add(username, "user");
- make call vm has firewall blocking connection.
- it take while , fail "the network path not found"
- however, if enable firewall rule , try again, wmi throw same network path error.
- it's after wait (i'm unsure long, few minutes) can retry , notice network working.
the code in wcf service every call should fresh new instances of everything.
any ideas on caching occurring , how can ensure new directoryentry makes fresh call?
update: tried iisreset (both site , web service) , caching still occurring. restarted windows management instrumentation service , made fresh un-cached call. lets me realize issue isn't c#/wcf code, or network, it's wmi. ideas how force wmi make fresh un-cached call?
Comments
Post a Comment