Getting Users FullName

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Daly

    Getting Users FullName

    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?

  • John Daly

    #2
    RE: Getting Users FullName

    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="tru e"/>
    I changed it to
    <processModel userName="SYSTE M" password="AutoG enerate"/>

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


    "John Daly" wrote:
    [color=blue]
    > 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?
    >[/color]

    Comment

    Working...