Re: creating a new user in Active Directory

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mario Rodriguez (mrodriguez_at_avantica.net)
Date: 03/12/04


Date: Fri, 12 Mar 2004 15:36:24 -0600

Thanks Richard. Consider my comments between lines:

 1. can you perform the same operation from the same box under the account
 you are trying to impersonate using e.g. "AD Users & Computers" snap-in
[Yes, it works perfecty because I'm trying to impersonate with an
administrator's group member]

 2. what happens if you don't try to impersonate - does it still fail
 silently?
[My user is a simple Domain Users's member, so I have no rights to create
users in Active Directory]

 3. Is there anything in the event log (security) on either the box you are
 running on or box running AD? If not check the "Local Security Policy"
audit
 settings and ensure that logon failures are enabled under local audit
 policy.
[the Local Security Policy is Ok and the event log is empty]

 4. Does the impersonating account have kerberos delegation enabled?
 (configuration depends on whether this is on Win2K or Win2003)
[I'm using Win2K as development box and Active Directory server (different
machines), How do I enable kerberos delegation for impersonating account ?]

thanks

"richlm" <rich_lm@h0tmai1.com> wrote in message
news:uxFrSZHCEHA.2060@TK2MSFTNGP12.phx.gbl...
> Just a few thoughts/ideas to try:
>
> 1. can you perform the same operation from the same box under the account
> you are trying to impersonate using e.g. "AD Users & Computers" snap-in
> 2. what happens if you don't try to impersonate - does it still fail
> silently?
> 3. Is there anything in the event log (security) on either the box you are
> running on or box running AD? If not check the "Local Security Policy"
audit
> settings and ensure that logon failures are enabled under local audit
> policy.
> 4. Does the impersonating account have kerberos delegation enabled?
> (configuration depends on whether this is on Win2K or Win2003)
>
> Hopefully something here might lead you to a solution, or at least narrow
> down a bit. Let us know how it goes.
>
> Richard.
>
> "Mario Rodriguez" <mrodriguez@avantica.net> wrote in message
> news:etqqP0GCEHA.2256@TK2MSFTNGP12.phx.gbl...
> > Hi, I'm trying to add a new user to my active directory, but the problem
> is
> > that the following snippet doesn't throws any exception or error, but
> never
> > adds the users to the active directory
> >
> >
> > public DirectoryEntry addUser(UserContainer v_objUserContainer) {
> >
> > if(impersonateUser(this.LoginUsername, this.DomainName,
> > this.strPassword)) { // make the operation with an privileged user
> >
> > DirectoryEntry entry =
> > objRootActiveDirectory.Children.Add(v_objUserContainer.getLogin(),
> "user");
> >
> > /* solamente modifica el password si esta definido */
> >
> > if(v_objUserContainer.getPassword() != "" &&
> > v_objUserContainer.getPassword() != null) {
> >
> > entry.Invoke("SetPassword", new object[]
> > {v_objUserContainer.getPassword() });
> >
> > }
> >
> > invokeProperty(ref entry, "FullName"
> > ,v_objUserContainer.getFullName());
> >
> > objRootActiveDirectory.CommitChanges();
> >
> > undoImpersonification();
> >
> > return entry;
> >
> > } else {
> >
> > return null;
> >
> > }
> >
> > }
> >
> >
> >
> > Any idea ?
> >
> >
> >
> > thanks
> >
> >
>
>



Relevant Pages

  • Re: Impersonating Users
    ... After impersonating the user, ... CertOpenStore(), I make the call to LoadUserProfile(). ... >> I can successfully impersonate any local user account ...
    (microsoft.public.platformsdk.security)
  • Re: problem writing a file
    ... if you are impersonating depends on the impersonate=true/false switch in web.config. ... trust for delegation is a active directory setting. ... Dominick Baier - DevelopMentor ... The local ASPNET account has no network credentials on another ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: User.IsInRole is always FALSE
    ... > account the thread is running under. ... > the client. ... By default this would be ASPNET on IIS 5.0. ... If you are impersonating - WindowsIdentity.GetCurrent ...
    (microsoft.public.dotnet.security)
  • Re: problem writing a file
    ... > Your asp.net app runs under the ASPNET account or Network Server ... > if you are impersonating you are doing a second hop with the client ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: trying to bild network betw. 98 & XP
    ... With XP Pro, ... With XP Pro, if SFS is disabled, check the Local Security Policy (Control Panel ... that the Guest account is enabled, thru Local User Manager (Start - Run - ... For XP Pro with Simple File Sharing enabled, make sure that the Guest account is ...
    (microsoft.public.windowsxp.network_web)