The following code works fine on my development pc:
Public Shared Function GetFullName(ByV al userID As String) As String
Dim sQry As String = "WinNT://" & userID.Replace( "\", "/") & ",user"
Dim oUser As DirectoryEntry = New DirectoryEntry( sQry)
Return oUser.Propertie s("FullName").V alue.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.Director yServices.Direc toryEntry.Bind( Boolean
throwIfFail) at System.Director yServices.Direc toryEntry.Bind( ) at
System.Director yServices.Direc toryEntry.get_A dsObject() at
System.Director yServices.Prope rtyValueCollect ion.PopulateLis t() at
System.Director yServices.Prope rtyValueCollect ion..ctor(Direc toryEntry entry,
String propertyName) at
System.Director yServices.Prope rtyCollection.g et_Item(String propertyName) at
_Default.Page_L oad(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(ByV al userID As String) As String
Dim sQry As String = "WinNT://" & userID.Replace( "\", "/") & ",user"
Dim oUser As DirectoryEntry = New DirectoryEntry( sQry)
Return oUser.Propertie s("FullName").V alue.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.Director yServices.Direc toryEntry.Bind( Boolean
throwIfFail) at System.Director yServices.Direc toryEntry.Bind( ) at
System.Director yServices.Direc toryEntry.get_A dsObject() at
System.Director yServices.Prope rtyValueCollect ion.PopulateLis t() at
System.Director yServices.Prope rtyValueCollect ion..ctor(Direc toryEntry entry,
String propertyName) at
System.Director yServices.Prope rtyCollection.g et_Item(String propertyName) at
_Default.Page_L oad(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?
Comment