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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -