Getting Users FullName

G

Guest

The following code works fine on my development pc:
Public Shared Function GetFullName(ByVal userID As String) As String
Dim sQry As String = "WinNT://" & userID.Replace("\", "/") & ",user"
Dim oUser As DirectoryEntry = New DirectoryEntry(sQry)

Return oUser.Properties("FullName").Value.ToString
End Function

how ever it fails on the production server. It throws a Unknown Error
0x80005000, and Exception String is:

System.Runtime.InteropServices.COMException (0x80005000): Unknown error
(0x80005000) at System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at
System.DirectoryServices.DirectoryEntry.get_AdsObject() at
System.DirectoryServices.PropertyValueCollection.PopulateList() at
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry,
String propertyName) at
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) at
_Default.Page_Load(Object sender, EventArgs e)

Both machines are identical in all respects with the only difference being
the Production Server has 2 processors.

Does anyone know how to fix?
 
G

Guest

I have resolved this issue. For those of you who need to know, I changed the
<processModel> element in the machine.config file.

The one on our production serverr read
<processModel autoConfig="true"/>
I changed it to
<processModel userName="SYSTEM" password="AutoGenerate"/>

I also add <identity impersonate="true" /> to the web.config file. I do not
believe this made as much of a difference as the <processModel> did.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top