Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Automaticly create users and assign to groups batch script  (Read 7394 times)

0 Members and 1 Guest are viewing this topic.

thmoses

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 7
    Automaticly create users and assign to groups batch script
    « on: June 29, 2015, 01:25:52 AM »
    For my GCSE Computing I need to find out how to automate the task of creating users and assigning them to groups. I will be using command prompt running on Windows XP (running through virtual box on windows 7).
    I would like help with how to create, edit, save and run a windows batch script in cmd please.

    The code should be mainly inside a loop which allows the user to repeat the process of creating and naming a user and assigning them to an existing group or a new group.

    Any help/advice is much appreciated

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Automaticly create users and assign to groups batch script
    « Reply #1 on: June 29, 2015, 02:13:13 AM »
    For my GCSE Computing I need to find out

    It would help you to read about the subject, and try to automate some tasks - then come and
    ask specific questions about things you find difficult.


    thmoses

      Topic Starter


      Starter

      • Experience: Experienced
      • OS: Windows 7
      Re: Automaticly create users and assign to groups batch script
      « Reply #2 on: June 29, 2015, 05:37:12 AM »
      Here is the Linux task I need to change to work on MS-DOS:

      "13. Linux enables tasks which are regularly carried out to be automated through the use of shell scripts. Plan write and test a shell script that could automate the task of creating new users and assigning them to groups."

      This is the task I am currently on:

      "14. Discuss how some of these tasks could have been done in a computer system running Windows or another operating system."
      For this task I need to do some primary research, which is why I am here.

      Here is the pseudo code for the task that I wrote:

      Repeat = 1 #This initializes the repeat variable
      Counter = 0 #This initializes the count variable
      WHILE repeat = 1 #This starts an iteration of something while the repeat variable is 1
         OUTPUT “Please enter the username for the new user”
         INPUT = username
         Add the user username
         Counter = counter + 1
         WHILE repeat = 1
            OUTPUT “Please enter the name of the group for the new user”
            INPUT = group
            IF the group already exists THEN
               Add username to group
               Repeat = 0
            ELSE
               OUTPUT “The group group does not exist.”
      OUTPUT “Do you want to create it as a new group (Y)”
      OUTPUT “Or enter another group to add the user username to (N)?”
               IF INPUT = Y THEN
                  Create group called group
                  Add username to group
                  Repeat = 0
               ENDIF
            ENDIF
         ENDWHILE
      OUTPUT “username has been added to the group group”
      OUTPUT “Do you want to create another user? Y or N”
      IF INPUT = N THEN
            Repeat = 0
      ELSE
         Repeat = 1
      ENDIF
      ENDWHILE
      OUTPUT “You have successfully created counter more users and added them all to groups.”


      Here is the linux code:




      ----------------------

      I would like to know some starting tips on how to write something like this using the MS-DOS please.

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: Automaticly create users and assign to groups batch script
      « Reply #3 on: June 29, 2015, 07:07:58 AM »
      The thread may be closed if you want someone to do your course work for you.

      Asking specific questions is probably fine.

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Re: Automaticly create users and assign to groups batch script
      « Reply #4 on: June 30, 2015, 06:58:29 AM »
      Sorry, we won't do your homework for you.