Bonjour, je suis actuellement en formation adulte d’administrateur réseau.

Elle a commencé en décembre, et le centre de formation a jugé bon, de nous envoyer en stage après avoir vu très peu de chose, (5 semaine de cours 3 semaines de binaire 2 semaine et demis de remise a niveau de math (why) 3h sur VM debian 3h sur VM (installation d’active directory) et 2 semaine les couche Sisco ).

Je suis donc en stage, et l’on me demandé de faire des testes sur deux VM (une servant de contrôleurs de domaines et l’autre le serveur de fichier (mise en place vendredi un serveur physique) dans le but d’automatiser un maximum les procédure, et de gagner du temps a l’installation.

Actuellement l’active directory n’est pas optimal, tout les users et sont dans l’OU « user » aucune autre unité d’organisation, et aucun groupe.

Depuis quelque jours, je me suis lancé dans des recherches pour le faire le plus rapidement. Donc par powershell. J’ai créé un script qui active « active directory », la sécurité de powershell, créer l’UO principal « Services » ensuite les UO des différents services dans l’uo pricipal, et dans ses uo, mes groupe ce formes. (cf la photo)

mon script
Code PowerShell : Sélectionner tout - Visualiser dans une fenêtre à part
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"

Nom : AD.PNG
Affichages : 472
Taille : 37,0 Ko

Sur mon serveur fichier, j’ai créé un script .bat qui me permet de créer mes dossiers dans le serveur de fichier.


Code Batch : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
MKDIR E:\ADM\R_Dossier\D_Dossier
MKDIR E:\APN\R_Dossier\D_Dossier
MKDIR E:\BE\R_Dossier\D_Dossier
MKDIR E:\CAQ\R_Dossier\D_Dossier
MKDIR E:\COMM\R_Dossier\D_Dossier
MKDIR E:\COMPTA\R_Dossier\D_Dossier
MKDIR E:\DEVECO\R_Dossier\D_Dossier
MKDIR E:\MP\R_Dossier\D_Dossier
MKDIR E:\OM\R_Dossier\D_Dossier
MKDIR E:\OT\R_Dossier\D_Dossier
MKDIR E:\PAT\R_Dossier\D_Dossier
MKDIR E:\PE\R_Dossier\D_Dossier
MKDIR E:\PROT\R_Dossier\D_Dossier
MKDIR E:\RH\R_Dossier\D_Dossier
MKDIR E:\THE\R_Dossier\D_Dossier
MKDIR E:\TIC\R_Dossier\D_Dossier
MKDIR E:\URBA\R_Dossier\D_Dossier


Maintenant, je commence a avoir du mal, car j’aimerais réussir a automatiser, mes droit d’accès que dans « E:\Adm » seul les membres du groupe « A_Adm » aient le droit d’écriture et de lecture. Que mon groupe R_ADM est le droit de lecture et d’écriture sur le dossier R_dossier et A_Dossier Pour ce qui est du D_Dossier, ce n’ai pas un problème c’est un OU et dossier Direction (dans l’ad) qui lui a le droit de vu sur tout les dossier partager donc pas de prise de tête.

Les utilisateurs eux seront mis a la mano dans dans leur groupe, a moins que quelqu’un ai une méthode pour créé un script. (je rappelle les users sont déjà créé l’active directory aussi, il va juste être mieux architecturé)

Merci d'avance