Labb 11: Grupper

Följande grupper ska skapas med hjälp av en Batch script. Administratören kommer att ge svar till frågorna som ska visas på skärmen.

f4-01-ou-structure-1Gruppen skapas i: ou=Communication Specialists,ou=Telecom Services,ou=ABC IT,dc=digiskola,dc=local

Group name? WAN Technicians
Security group? yes
Group scope? g
Group samid? wantechnicians
Description: WAN connections Sweden – USA

Gruppen skapas i: ou=Engineers,ou=Network Services,ou=ABC IT,dc=digiskola,dc=local

Group name? Test Team
Security group? yes
Group scope? g
Group samid? testteam
Description: Testing WAN connections

Gruppen skapas i: ou=Coordinators,ou=Network Services,ou=ABC IT,dc=digiskola,dc=local

Group name? Telecom Coordinators
Security group? yes
Group scope? g
Group samid? telcoordinators
Description: Coordination Coorporate Projects

Gruppen skapas i: ou=Administrators,ou=Network Services,ou=ABC IT,dc=digiskola,dc=local

Group name? Telco Administrators
Security group? yes
Group scope? g
Group samid? telcoadmins
Description: Teleconnections Sweden – USA

Gruppen skapas i: ou=System Analysts,ou=Information Services,ou=ABC IT,dc=digiskola,dc=local

Group name? System Experts
Security group? yes
Group scope? g
Group samid? sysexperts
Description: WAN connections Sweden – USA

Gruppen skapas i: ou=Programmer Analysts,ou=Information Services,ou=ABC IT,dc=digiskola,dc=local

Group name? Developers
Security group? yes
Group scope? g
Group samid? developtechs
Description: WAN connections Sweden – USA

Gruppen skapas i: ou=Help Desk,ou=Information Services,ou=ABC IT,dc=digiskola,dc=local

Group name? Support Technicians
Security group? yes
Group scope? g
Group samid? supporttechs
Description: Department IT Sweden

Nu öppnar vi Notepad och skriver koden nedan:

@echo off
echo.
echo ****************************
echo *                                                   *
echo *    Creating AD groups           *
echo *                                                   *
echo ****************************
echo.
title Creating Groups
:: ———————————
:: Getting information
echo.
:begin
echo Groups in Communication Specialists OU
echo.
set /p comsp1a=What is the name of the new group?:
set /p comsp1b=Is this group a security group?:
set /p comsp1c=What is the scope? (l for local, g for global, u for universal):
set /p comsp1d=What is the group samid?:
set /p comsp1e=Enter a description:
echo.
echo Creating %comsp1a% group in Communication Specialists OU
echo.
goto comsp
:: Creating the group
:comsp
dsadd group ”cn=%comsp1a%,ou=Communication Specialists,ou=Telecom services,ou=ABC IT,dc=diginto,dc=se” -secgrp %comsp1b% -scope %comsp1c% -samid %comsp1d% -desc ”%comsp1e%”
echo.
pause
goto engi
:: ———————————
:: Getting information
echo.
:engi
echo Groups in Engineers OU
echo.
set /p engi1a=What is the name of the new group?:
set /p engi1b=Is this group a security group?:
set /p engi1c=What is the scope? (l for local, g for global, u for universal):
set /p engi1d=What is the group samid?:
set /p engi1e=Enter a description:
echo.
echo Creating %engi1a% group in Engineers OU
echo.
goto engiop
:: Creating the group
:engiop
dsadd group ”cn=%engi1a%,ou=Engineers,ou=Network Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %engi1b% -scope %engi1c% -samid %engi1d% -desc ”%engi1e%”
echo.
pause
goto coord
:: ———————————-
:: Getting information
echo.
:coord
echo Groups in Coordinators OU
echo.
set /p coord1a=What is the name of the new group?:
set /p coord1b=Is this group a security group?:
set /p coord1c=What is the scope? (l for local, g for global, u for universal):
set /p coord1d=What is the group samid?:
set /p coord1e=Enter a description:
echo.
echo Creating %coord1a% group in Coordinators OU
echo.
goto coordop
:: Creating the group
:coordop
dsadd group ”cn=%coord1a%,ou=Coordinators,ou=Network Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %coord1b% -scope %coord1c% -samid %coord1d% -desc ”%coord1e%”
echo.
pause
goto admi
:: ———————————-
:: Getting information
echo.
:admi
echo Groups in Administrators OU
echo.
set /p admi1a=What is the name of the new group?:
set /p admi1b=Is this group a security group?:
set /p admi1c=What is the scope? (l for local, g for global, u for universal):
set /p admi1d=What is the group samid?:
set /p admi1e=Enter a description:
echo.
echo Creating %admi1a% group in Administrators OU
echo.
goto admiop
:: Creating the group
:admiop
dsadd group ”cn=%admi1a%,ou=Administrators,ou=Network Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %admi1b% -scope %admi1c% -samid %admi1d% -desc ”%admi1e%”
echo.
pause
goto sysan
:: ———————————-
:: Getting information
echo.
:sysan
echo Groups in System Analysts OU
echo.
set /p sysan1a=What is the name of the new group?:
set /p sysan1b=Is this group a security group?:
set /p sysan1c=What is the scope? (l for local, g for global, u for universal):
set /p sysan1d=What is the group samid?:
set /p sysan1e=Enter a description:
echo.
echo Creating %sysan1a% group in System Analysts OU
echo.
goto sysanop
:: Creating the group
:sysanop
dsadd group ”cn=%sysan1a%,ou=System Analysts,ou=information Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %sysan1b% -scope %sysan1c% -samid %sysan1d% -desc ”%sysan1e%”
echo.
pause
goto proan
:: ———————————-
:: Getting information
echo.
:proan
echo Groups in Programmer Analysts OU
echo.
set /p proan1a=What is the name of the new group?:
set /p proan1b=Is this group a security group?:
set /p proan1c=What is the scope? (l for local, g for global, u for universal):
set /p proan1d=What is the group samid?:
set /p proan1e=Enter a description:
echo.
echo Creating %proan1a% group in Programmer Analysts OU
echo.
goto proanop
:: Creating the group
:proanop
dsadd group ”cn=%proan1a%,ou=Programmer Analysts,ou=information Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %proan1b% -scope %proan1c% -samid %proan1d% -desc ”%proan1e%”
echo.
pause
goto helpd
:: ———————————-
:: Getting information
echo.
:helpd
echo Groups in Help Desk OU
echo.
set /p helpd1a=What is the name of the new group?:
set /p helpd1b=Is this group a security group?:
set /p helpd1c=What is the scope? (l for local, g for global, u for universal):
set /p helpd1d=What is the group samid?:
set /p helpd1e=Enter a description:
echo.
echo Creating %helpd1a% group in Help Desk OU
echo.
goto helpdop
:: Creating the group
:helpdop
dsadd group ”cn=%helpd1a%,ou=Help Desk,ou=Information Services,ou=ABC IT,dc=diginto,dc=se” -secgrp %helpd1b% -scope %helpd1c% -samid %helpd1d% -desc ”%helpd1e%”
echo.
pause
goto end
echo.
echo.
:end

Verifiera att alla konto har skapats på rätt sätt och om det behovs ändra så att allting stämmer.