c# - ActiveDirectoryServerDownException when getting the current Domain on a Wireless network -


i have problem regarding active directory classes in c#. @ 1 moment in program, trying current domain user logged in using following command:

domain.getcurrentdomain(); 

most of times, works. when executing wireless laptop, gives me following error:

system.directoryservices.activedirectory.activedirectoryserverdownexception: server not operational.      name: "domain.ca"      ---> system.runtime.interopservices.comexception: server not operational.         @ system.directoryservices.directoryentry.bind(boolean throwiffail)        @ system.directoryservices.directoryentry.bind()        @ system.directoryservices.directoryentry.get_adsobject()        @ system.directoryservices.propertyvaluecollection.populatelist()    @ system.directoryservices.propertyvaluecollection..ctor(directoryentry entry, string propertyname)    @ system.directoryservices.propertycollection.get_item(string propertyname)    @ system.directoryservices.activedirectory.propertymanager.getpropertyvalue(directorycontext context, directoryentry directoryentry, string propertyname)    --- end of inner exception stack trace ---    @ system.directoryservices.activedirectory.propertymanager.getpropertyvalue(directorycontext context, directoryentry directoryentry, string propertyname)    @ system.directoryservices.activedirectory.domain.getdomain(directorycontext context)    @ system.directoryservices.activedirectory.domain.getcurrentdomain()    @ adt.adtools.computerisindomain() 

in particular case, piece of code should work on account logged in active directory account, regardless of computer it's being ran on or if computer connected domain using wireless or wired connection.

does of knows answer problem or workarounds make work?

i solved problem. source of problem internal our business network. did couple of things :

  • set third dns address on main router points ad dns server.
  • on wireless network card, put prefered dns server ip of ad dns server , alternative dns server, ip of main router.

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -