1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

I am running a batch file for creating new users in the Active Dir

Discussion in 'Windows Home Server' started by Ikram, Sep 1, 2009.

  1. Ikram

    Ikram Guest

    I am running a batch file for creating new users in the Active Directory
    using dsadd command, as a schedule task and it gives an error in the log file
    as "The task completed with an exit code of (1), and the users are not
    created. I am running on a Domain Controller

    I have a user created as NSUser and made it a member of Domain Users and
    Account Operators, and using this account to run the schedule task.

    But when I make the NSUser a member of Administrators group the task runs
    successfull without any errors and the user accounts are created using the
    batch file.
     
  2. I'm not sure if Account Operators group is allowed to log on locally on a
    Domain Controller. But Server Operators group and Backup Operators group is.
    You can make NSUser a member of both Account Operators and Server Operators
    and try to run your scheduled task.

    "Ikram" <Ikram@discussions.microsoft.com> wrote in message
    news:80C723DC-28AF-4F02-A13A-E259E1DD084D@microsoft.com...<!--coloro:blue--><span style="color:blue <!--/coloro-->
    > I am running a batch file for creating new users in the Active Directory
    > using dsadd command, as a schedule task and it gives an error in the log
    > file
    > as "The task completed with an exit code of (1), and the users are not
    > created. I am running on a Domain Controller
    >
    > I have a user created as NSUser and made it a member of Domain Users and
    > Account Operators, and using this account to run the schedule task.
    >
    > But when I make the NSUser a member of Administrators group the task runs
    > successfull without any errors and the user accounts are created using the
    > batch file.
    > <!--colorc--><!--/colorc-->
     
  3. Ikram

    Ikram Guest

    Re: I am running a batch file for creating new users in the Active

    Dusko:

    I tried adding Server Operators it didn't work then I added Backup Operators
    it didn't work.
    Then I remove both of them and added the Administrators group and then it
    worked as before.

    I running this schedule task on Domain Controller, and the settings on the
    schedule task are as shown below:

    Run: C:\Data\UDist.bat
    Start in: C:\Data
    Run as: D214\NSUser





    "Dusko Savatovic" wrote:
    <!--coloro:blue--><span style="color:blue <!--/coloro-->
    > I'm not sure if Account Operators group is allowed to log on locally on a
    > Domain Controller. But Server Operators group and Backup Operators group is.
    > You can make NSUser a member of both Account Operators and Server Operators
    > and try to run your scheduled task.
    >
    > "Ikram" <Ikram@discussions.microsoft.com> wrote in message
    > news:80C723DC-28AF-4F02-A13A-E259E1DD084D@microsoft.com...<!--coloro:green--><span style="color:green <!--/coloro-->
    > > I am running a batch file for creating new users in the Active Directory
    > > using dsadd command, as a schedule task and it gives an error in the log
    > > file
    > > as "The task completed with an exit code of (1), and the users are not
    > > created. I am running on a Domain Controller
    > >
    > > I have a user created as NSUser and made it a member of Domain Users and
    > > Account Operators, and using this account to run the schedule task.
    > >
    > > But when I make the NSUser a member of Administrators group the task runs
    > > successfull without any errors and the user accounts are created using the
    > > batch file.
    > > <!--colorc--><!--/colorc-->
    > <!--colorc--><!--/colorc-->
     
  4. Re: I am running a batch file for creating new users in the Active

    Ikram,

    Is D214 the name of your server (DC) or the name of your domain?
    If it's server name then this may be the problem.

    Let's try to recap:
    1. You created domain user NSUser.
    2. You added NSUser to 'Account Operators'
    3. You log on locally to your domain controller using NSUser account.
    4. You create a new user account using 'dsadd' command. The command runs
    successfully.

    If all the steps run successfully, then the scheduled task should also run
    successfuly.



    "Ikram" <Ikram@discussions.microsoft.com> wrote in message
    news:DCCA464A-3A72-456C-8D27-4FBBEBDA0A86@microsoft.com...<!--coloro:blue--><span style="color:blue <!--/coloro-->
    > Dusko:
    >
    > I tried adding Server Operators it didn't work then I added Backup
    > Operators
    > it didn't work.
    > Then I remove both of them and added the Administrators group and then it
    > worked as before.
    >
    > I running this schedule task on Domain Controller, and the settings on the
    > schedule task are as shown below:
    >
    > Run: C:DataUDist.bat
    > Start in: C:Data
    > Run as: D214NSUser
    >
    >
    >
    >
    >
    > "Dusko Savatovic" wrote:
    ><!--coloro:green--><span style="color:green <!--/coloro-->
    >> I'm not sure if Account Operators group is allowed to log on locally on a
    >> Domain Controller. But Server Operators group and Backup Operators group
    >> is.
    >> You can make NSUser a member of both Account Operators and Server
    >> Operators
    >> and try to run your scheduled task.
    >>
    >> "Ikram" <Ikram@discussions.microsoft.com> wrote in message
    >> news:80C723DC-28AF-4F02-A13A-E259E1DD084D@microsoft.com...<!--coloro:darkred--><span style="color:darkred <!--/coloro-->
    >> > I am running a batch file for creating new users in the Active
    >> > Directory
    >> > using dsadd command, as a schedule task and it gives an error in the
    >> > log
    >> > file
    >> > as "The task completed with an exit code of (1), and the users are not
    >> > created. I am running on a Domain Controller
    >> >
    >> > I have a user created as NSUser and made it a member of Domain Users
    >> > and
    >> > Account Operators, and using this account to run the schedule task.
    >> >
    >> > But when I make the NSUser a member of Administrators group the task
    >> > runs
    >> > successfull without any errors and the user accounts are created using
    >> > the
    >> > batch file.
    >> ><!--colorc--><!--/colorc-->
    >> <!--colorc--><!--/colorc--><!--colorc--><!--/colorc-->
     

Share This Page