1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Import-Module ActiveDirectory
Import-Module 'Microsoft.PowerShell.Security'
#*****************************création des O U général*******************************************************
New-ADOrganizationalUnit -Name "Services" -Path "dc=test,dc=lan"
#*****************************création des O U par service***************************************************
New-ADOrganizationalUnit -Name "DIR" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "RESP" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "ADM" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "APN" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "BE" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "CAQ" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "COMM" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "COMPTA" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "DEVECO" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "EEA" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "Elu" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "JEU" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "JUR" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "MP" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "OM" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "OT" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "PAT" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "PE" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "PROT" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "RH" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "RJ" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "THE" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "TIC" -Path "ou=services,dc=test,dc=lan"
New-ADOrganizationalUnit -Name "URBA" -Path "ou=services,dc=test,dc=lan"
******************************Création groupe****************************************************************
New-ADGroup -Name DIRECTION -GroupScope Global -GroupCategory Security -Path "ou=DIR,ou=services,dc=test,dc=lan"
New-ADGroup -Name RESPONSABLE -GroupScope Global -GroupCategory Security -Path "ou=RESP,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_ADM -GroupScope Global -GroupCategory Security -Path "ou=ADM,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_ADM -GroupScope Global -GroupCategory Security -Path "ou=ADM,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_APN -GroupScope Global -GroupCategory Security -Path "ou=APN,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_APN -GroupScope Global -GroupCategory Security -Path "ou=APN,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_BE -GroupScope Global -GroupCategory Security -Path "ou=BE,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_BE -GroupScope Global -GroupCategory Security -Path "ou=BE,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_CAQ -GroupScope Global -GroupCategory Security -Path "ou=CAQ,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_CAQ -GroupScope Global -GroupCategory Security -Path "ou=CAQ,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_COMM -GroupScope Global -GroupCategory Security -Path "ou=COMM,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_COMM -GroupScope Global -GroupCategory Security -Path "ou=COMM,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_COMPTA -GroupScope Global -GroupCategory Security -Path "ou=COMPTA,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_COMPTA -GroupScope Global -GroupCategory Security -Path "ou=COMPTA,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_DEVECO -GroupScope Global -GroupCategory Security -Path "ou=DEVECO,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_DEVECO -GroupScope Global -GroupCategory Security -Path "ou=DEVECO,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_EEA -GroupScope Global -GroupCategory Security -Path "ou=EEA,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_EEA -GroupScope Global -GroupCategory Security -Path "ou=EEA,ou=services,dc=test,dc=lan"
New-ADGroup -Name ELU -GroupScope Global -GroupCategory Security -Path "ou=Elu,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_JEU -GroupScope Global -GroupCategory Security -Path "ou=JEU,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_JEU -GroupScope Global -GroupCategory Security -Path "ou=JEU,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_JUR -GroupScope Global -GroupCategory Security -Path "ou=JUR,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_JUR -GroupScope Global -GroupCategory Security -Path "ou=JUR,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_MP -GroupScope Global -GroupCategory Security -Path "ou=MP,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_MP -GroupScope Global -GroupCategory Security -Path "ou=MP,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_OM -GroupScope Global -GroupCategory Security -Path "ou=OM,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_OM -GroupScope Global -GroupCategory Security -Path "ou=OM,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_OT -GroupScope Global -GroupCategory Security -Path "ou=OT,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_OT -GroupScope Global -GroupCategory Security -Path "ou=OT,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_PAT -GroupScope Global -GroupCategory Security -Path "ou=PAT,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_PAT -GroupScope Global -GroupCategory Security -Path "ou=PAT,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_PE -GroupScope Global -GroupCategory Security -Path "ou=PE,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_PE -GroupScope Global -GroupCategory Security -Path "ou=PE,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_PROT -GroupScope Global -GroupCategory Security -Path "ou=PROT,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_PROT -GroupScope Global -GroupCategory Security -Path "ou=PROT,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_RH -GroupScope Global -GroupCategory Security -Path "ou=RH,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_RH -GroupScope Global -GroupCategory Security -Path "ou=RH,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_RJ-GroupScope Global -GroupCategory Security -Path "ou=RJ,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_RJ -GroupScope Global -GroupCategory Security -Path "ou=RJ,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_THE -GroupScope Global -GroupCategory Security -Path "ou=THE,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_THE -GroupScope Global -GroupCategory Security -Path "ou=THE,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_TIC -GroupScope Global -GroupCategory Security -Path "ou=TIC,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_TIC -GroupScope Global -GroupCategory Security -Path "ou=TIC,ou=services,dc=test,dc=lan"
New-ADGroup -Name A_URBA -GroupScope Global -GroupCategory Security -Path "ou=URBA,ou=services,dc=test,dc=lan"
New-ADGroup -Name R_URBA -GroupScope Global -GroupCategory Security -Path "ou=URBA,ou=services,dc=test,dc=lan" |
Partager