The task completed with an exit code of (1)
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 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.
Re: The task completed with an exit code of (1)
Ikram - if you are looking for help regarding a batch file that throws an
error, then you might want to include it as part of your post...
Marcin
"Ikram" <Ikram@discussions.microsoft.com> wrote in message
news:60E1E092-A8CE-4084-980F-CD52AC2BB976@microsoft.com...
>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 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.
Re: The task completed with an exit code of (1)
Marcin:
The batch file is running the dsadd command to create 1000's of users, let
me show you one of the users command as shown below:
dsadd user cn=abbat810001,ou=students,ou=bghs,ou=schools,dc=d214,dc=org -upn
abbat810001@d214.org -fn "ALEXANDER" -mi P -ln "ABBATIELLO" -display
"ALEXANDER P. ABBATIELLO" -pwd 035692 -desc "BGHS-Student" -canchpwd no
-memberof cn=BGHS-Students,ou=groups,ou=bghs,ou=schools,dc=d214,dc=org
-pwdneverexpires yes
So it has 1000's of those lines.
The batch file runs fine, normally and in the schedule task if and only the
member is part of the Administrators group. For security reasons I thought I
would only use the Account Operator group, and then tried to schedule the
task but it fails with that exit code of (1). But if add the user into the
Administrators group and schedule the task it runs successfully.
"Marcin" wrote:
> Ikram - if you are looking for help regarding a batch file that throws an
> error, then you might want to include it as part of your post...
>
> Marcin
>
> "Ikram" <Ikram@discussions.microsoft.com> wrote in message
> news:60E1E092-A8CE-4084-980F-CD52AC2BB976@microsoft.com...
> >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 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.
>
>
>
Re: The task completed with an exit code of (1)
Enclose the distinguished name of the group name in double quotes...
hth
Marcin
"Ikram" <Ikram@discussions.microsoft.com> wrote in message
news:328E9A96-079E-446F-B27D-145E393B01C7@microsoft.com...
> Marcin:
>
> The batch file is running the dsadd command to create 1000's of users, let
> me show you one of the users command as shown below:
>
> dsadd user
> cn=abbat810001,ou=students,ou=bghs,ou=schools,dc=d214,dc=org -upn
> abbat810001@d214.org -fn "ALEXANDER" -mi P -ln "ABBATIELLO" -display
> "ALEXANDER P. ABBATIELLO" -pwd 035692 -desc "BGHS-Student" -canchpwd no
> -memberof cn=BGHS-Students,ou=groups,ou=bghs,ou=schools,dc=d214,dc=org
> -pwdneverexpires yes
>
> So it has 1000's of those lines.
>
> The batch file runs fine, normally and in the schedule task if and only
> the
> member is part of the Administrators group. For security reasons I thought
> I
> would only use the Account Operator group, and then tried to schedule the
> task but it fails with that exit code of (1). But if add the user into the
> Administrators group and schedule the task it runs successfully.
>
>
>
> "Marcin" wrote:
>
>> Ikram - if you are looking for help regarding a batch file that throws an
>> error, then you might want to include it as part of your post...
>>
>> Marcin
>>
>> "Ikram" <Ikram@discussions.microsoft.com> wrote in message
>> news:60E1E092-A8CE-4084-980F-CD52AC2BB976@microsoft.com...
>> >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 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.
>>
>>
>>