OS: XP pro
IDE VS 2005 .NET
ASP.NET 2.0
System.Security.AccessControl.SecurityInfos.Owner.ToString() returns
domain\username...if the domain is named "TEST" and username is "per" then
this statement returns TEST\per...
But what code must I do if I went to the fullname of the user?
JeffAsk the user to put it into a form. ;-)
Seriously, though, if the user is logged in to Active Directory, you should
be able to use the System.DirectoryServices namespace and classes to query
the Active Directory for this information.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
> OS: XP pro
> IDE VS 2005 .NET
> ASP.NET 2.0
> System.Security.AccessControl.SecurityInfos.Owner.ToString() returns
> domain\username...if the domain is named "TEST" and username is "per" then
> this statement returns TEST\per...
> But what code must I do if I went to the fullname of the user?
> Jeff
>
Thanks, I'm looking into it now:
System.DirectoryServices.DirectoryEntry de = new
System.DirectoryServices.DirectoryEntry();
string fullname = de.Properties["displayName"].Value.ToString();
This code isn't working because I need to set the de.Path property before
executing the last line.. I'm not sure how to get the domain name the user
is logged into...Any tips would be great...
I've tryed, with out luck using this statment:
string domain = de.Properties["defaultNamingContext"][0];
This statement gives me an error message saying "This domain do not exist"
(or something like that, the error message I get on my computer is in
Norwegian and I translated it into English... I'm a native Norwegian)
What am I doing wrong here?
Any tips would be received with great appreciation!
Jeff
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
> Ask the user to put it into a form. ;-)
> Seriously, though, if the user is logged in to Active Directory, you
> should be able to use the System.DirectoryServices namespace and classes
> to query the Active Directory for this information.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
> Hard work is a medication for which
> there is no placebo.
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
>
Your app will only be able to get AD information about the domain it belongs
to.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23hChlzaeGHA.3888@.TK2MSFTNGP02.phx.gbl...
> Thanks, I'm looking into it now:
> System.DirectoryServices.DirectoryEntry de = new
> System.DirectoryServices.DirectoryEntry();
> string fullname = de.Properties["displayName"].Value.ToString();
> This code isn't working because I need to set the de.Path property before
> executing the last line.. I'm not sure how to get the domain name the user
> is logged into...Any tips would be great...
> I've tryed, with out luck using this statment:
> string domain = de.Properties["defaultNamingContext"][0];
> This statement gives me an error message saying "This domain do not exist"
> (or something like that, the error message I get on my computer is in
> Norwegian and I translated it into English... I'm a native Norwegian)
> What am I doing wrong here?
> Any tips would be received with great appreciation!
> Jeff
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment