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?
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?