Re: ADSI - Adding a user and enabling them (can add can't enable)

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 11/24/05

  • Next message: Willy Denoyette [MVP]: "Re: A service's threads outgoing security:how to manage?"
    Date: Wed, 23 Nov 2005 21:21:44 -0600
    
    

    You multi-posted. I answered in a different group.

    Joe K.

    "Jeremie Legault" <JeremieLegault@discussions.microsoft.com> wrote in
    message news:14E9C7A9-4F4B-4429-AD18-395D3B75F365@microsoft.com...
    > Hi,
    >
    > I have written an ASP.NET 2.0 application that uses Active Directory or
    > ADAM
    > to manage account users - the site has a page that allows people to create
    > an
    > account (much like any site). The page populates the AD with all the
    > information and the user account but I am unable to enable the account.
    > Microsoft has information on how to do that here -->
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/example_code_for_creating_a_user.asp
    > (the sample is for Visual Basic) - and I am unable to complete the bottom
    > portion of the script. Can some one point me in the right direction - or
    > can
    > you tell me how I can add a snippet of VBscript code to an ASP.NET page.
    >
    > I am using the Active DS Type library - not sure why there are multiple
    > ones
    > (System.DirectoryServices) but it is rather confusing - I seem to
    > accomplish
    > one thing with one and another with the other (they did have trouble
    > co-existing however). Anyway my script works very well but I am not able
    > to
    > access the properties required to enable the account.
    >
    > Here is a simple version (no error checking) of the code
    > Sub BTSub_Click(ByVal sender As Object, ByVal e As EventArgs)
    > Dim objUsers As ActiveDs.IADsContainer
    > Dim objNewUser As ActiveDs.IADsUser
    > objUsers = GetObject("LDAP://OU=Pickupfootball,DC=systemfix,DC=ca")
    > objNewUser = objUsers.Create("user", "CN=" & txtFName.Text &
    > txtLName.Text)
    > objNewUser.Put("sAMAccountName", txtFName.Text & txtLName.Text)
    > objNewUser.Put("givenName", txtFName.Text)
    > objNewUser.Put("sn", txtLName.Text)
    > objNewUser.Put("streetAddress", txtEADDR.Text)
    > objNewUser.Put("mail", txtEADDR.Text)
    > objNewUser.Put("title", txtOCC.Text)
    > objNewUser.Put("displayName", txtFName.Text & "." & txtLName.Text)
    > objNewUser.Put("description", GNDList.Text & ";" & txtAge.Text)
    > objNewUser.SetInfo()
    > objNewUser.ChangePassword("", "j1r1mi1")
    >
    > End Sub
    >
    > One other thought I had is maybe I can run a VBscript from within the page
    > after the user is added - is that possible? If so how can I do that?
    >
    > Thanks
    > Jeremie Legault
    > jlegault@systemfix.ca


  • Next message: Willy Denoyette [MVP]: "Re: A service's threads outgoing security:how to manage?"

    Relevant Pages

    • Re: Does anyone know how to fix this??
      ... > Inside the Active Directory Users and Computers in the folder of SYSTEM I ... Give the site's SMS Service account full control rights to the ... MP encountered an error when connecting to SQL Server. ...
      (microsoft.public.sms.setup)
    • Re: Cross-Domain question (Parent - Child)
      ... computer accounts unless logged in directly to the server? ... different DC so the DC you are looking at doesn't get the audit entries. ... Author of O'Reilly Active Directory Third Edition ... User Account Created: ...
      (microsoft.public.win2000.active_directory)
    • Re: Domain troubles
      ... Workgroup administrative environment and the machine account in Active ... Another possiblity is that the Active Directory DNS cannot resolve the ... For example if you built a network segment and abitrarily choose ...
      (microsoft.public.windows.server.general)
    • Re: NTDS Replication Event ID 1083/1955 and account lockouts
      ... Active Directory could not update the following object with changes received ... from the domain controller at the following network address because Active ... Not sure if the event is ocurring after the account has been locked or the ...
      (microsoft.public.windows.server.active_directory)
    • Re: Does anyone know how to fix this??
      ... Inside the Active Directory Users and Computers in the folder of SYSTEM I ... > Basically sms secondary site reports me 3 kind of error.... ... > account may not have full control rights for the "System Management" ... > "System Management" container, and all child objects in Active Directory. ...
      (microsoft.public.sms.setup)

  • Quantcast