Just trying out the new System.DirectoryServices.AccountManagement with Visual Studio 2008 Express Edition.
My scenario:
-Client Windows XP joined to domain
-One Windows Server 2003 domain controller / IIS
I want to get the full name of the logged in user. This works if I specify the domain controller name. Specifying the domain name (either fully qualified or NETBIOS) does not work. Any suggestions ? Am I doing something wrong here.
My working code is like this:
Dim domainContext As New System.DirectoryServices.AccountManagement.PrincipalContect(DirectoryServices.AccountManagement.ContextType.Domain,"testiisdc01")
I was wondering if you were ever able to identify a solution to this issue. I am currently experiencing the same. Thank you for any assistance you can provide.
chentiangema...
Member
1 Points
7 Posts
ContextType.Domain gets PrincipalServerDownException unless specify domain controller by name
Feb 11, 2008 04:43 AM|LINK
Hi There
Just trying out the new System.DirectoryServices.AccountManagement with Visual Studio 2008 Express Edition.
My scenario:
-Client Windows XP joined to domain
-One Windows Server 2003 domain controller / IIS
I want to get the full name of the logged in user. This works if I specify the domain controller name. Specifying the domain name (either fully qualified or NETBIOS) does not work. Any suggestions ? Am I doing something wrong here.
My working code is like this:
Dim domainContext As New System.DirectoryServices.AccountManagement.PrincipalContect(DirectoryServices.AccountManagement.ContextType.Domain,"testiisdc01")
Response.Write ("Welcome " & System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(domainContext, User.Identity.Name).DisplayName)
The output is something like:
Welcome Bob Smith.
However if I replace the DC server name testiisdc01 with domain name i.e. testdomain.priv or testdomain, or "testdomain","DC=testdomain,DC=priv"
I get the PrincipalServerDownException error .
I want this code to just use the domain that the current user is logged in under. Any idea how to get this to work?
JonesEJ20
Member
2 Points
1 Post
Re: ContextType.Domain gets PrincipalServerDownException unless specify domain controller by name
Jul 28, 2011 11:17 PM|LINK
I was wondering if you were ever able to identify a solution to this issue. I am currently experiencing the same. Thank you for any assistance you can provide.