N
Novice
Hi all, I'm trying to display the full name of a windows user (not
their login name) using System.DiretoryServices.
However, I keep getting the following error:
Exception Details: System.Runtime.InteropServices.COMException: The
network path was not found
I'm using Windows 2000.
I'm assigning the DirectoryEntry object Path variable:
WinNT://myDomain/myUserName
Note: I've replaced my actual domain and user name with myDomain and
myUserName. But in my source code they are the actual domain and user
name that I use to log into my machine.
However, when I make the myDomain portion of the above equal to my
machine's domain name, a different error message appears:
Exception Details: System.Runtime.InteropServices.COMException: The
group name could not be found
The code I'm using is fairly simple.
I have the following at the top of my aspx page:
<%@ Assembly name="System.DirectoryServices, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"%>
<%@ Import Namespace="System.DirectoryServices" %>
Then I have the following function:
Private Function GetUserName() as String
Dim FullName as string
Dim objUser as new DirectoryEntry
objUser.Path = "WinNT://myDomain/myUserName"
FullName = ObjUser.Name
Return FullName
End Function
Once I get the above working, I would like to start making use of:
User.Identity.Name
so that any user coming to my webpage will get their full name
appearing on the webpage.
Thanks,
Novice
their login name) using System.DiretoryServices.
However, I keep getting the following error:
Exception Details: System.Runtime.InteropServices.COMException: The
network path was not found
I'm using Windows 2000.
I'm assigning the DirectoryEntry object Path variable:
WinNT://myDomain/myUserName
Note: I've replaced my actual domain and user name with myDomain and
myUserName. But in my source code they are the actual domain and user
name that I use to log into my machine.
However, when I make the myDomain portion of the above equal to my
machine's domain name, a different error message appears:
Exception Details: System.Runtime.InteropServices.COMException: The
group name could not be found
The code I'm using is fairly simple.
I have the following at the top of my aspx page:
<%@ Assembly name="System.DirectoryServices, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"%>
<%@ Import Namespace="System.DirectoryServices" %>
Then I have the following function:
Private Function GetUserName() as String
Dim FullName as string
Dim objUser as new DirectoryEntry
objUser.Path = "WinNT://myDomain/myUserName"
FullName = ObjUser.Name
Return FullName
End Function
Once I get the above working, I would like to start making use of:
User.Identity.Name
so that any user coming to my webpage will get their full name
appearing on the webpage.
Thanks,
Novice