How can I programatically determine my Active Directory domain using just my User Principal Name in C? -


my current c program authenticates across multiple active directory domains using samaccountname/domain. uses config file map domain correct vip (virtual ip) server bind , query to. modifying use userprincipalname, email address. domain portion of userprincipalname not same domain maps vip servers.

using account, able bind 1 of vip servers, since not active directory member on server, unable query. right now, have iterate through each server until find 1 member of. not ideal approach.

my question is, there way retrieve active directory domain member of using userprincipalname? have read there may way achieve accessing global catalog. correct approach, , if how done using openldap ldap api? if isn't correct approach, there way query first vip server i'm bound to ask active directory domain is?

any appreciated.

you can use system.secutiry principal , name returned in domain\usename format first bit being domain , dont need go ad

mystring= system.security.principal.windowsidentity.getcurrent().name; 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -