Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

script pour modification de l'AD.

6 réponses
Avatar
lionel
Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.

6 réponses

Avatar
sofiane
Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.


Avatar
lionel
Merci pour cette réponse rapide.

L'inconvénient est que mes utilisateurs sont déjà créés. Mon fichier de base
doit permettre de mettre à jour les infos de l'AD en se basant sur un
identifiant unique pour chaque utilisateur. Il faut donc que je vérifie ce
code et que je mette à jour les infos de l'utilisateur correspondant.

merci encore,
Lionel.


Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.




Avatar
sofiane
tout à fait

________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Merci pour cette réponse rapide.

L'inconvénient est que mes utilisateurs sont déjà créés. Mon fichier de base
doit permettre de mettre à jour les infos de l'AD en se basant sur un
identifiant unique pour chaque utilisateur. Il faut donc que je vérifie ce
code et que je mette à jour les infos de l'utilisateur correspondant.

merci encore,
Lionel.


Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.






Avatar
lionel
tu ne serais pas ou je peux trouver un script déjà tout fait ? Je suis pas un
fan de scripting ;))


tout à fait

________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Merci pour cette réponse rapide.

L'inconvénient est que mes utilisateurs sont déjà créés. Mon fichier de base
doit permettre de mettre à jour les infos de l'AD en se basant sur un
identifiant unique pour chaque utilisateur. Il faut donc que je vérifie ce
code et que je mette à jour les infos de l'utilisateur correspondant.

merci encore,
Lionel.


Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.








Avatar
sofiane
au fait c tous simple. si vous avez déja crééer votre script d'ajout, il vous
suffit de changer dsadd par dsmove et changer les variables que vous voulez.
sinon, suivez le script il est simple à comprendre.

___________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




tu ne serais pas ou je peux trouver un script déjà tout fait ? Je suis pas un
fan de scripting ;))


tout à fait

________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Merci pour cette réponse rapide.

L'inconvénient est que mes utilisateurs sont déjà créés. Mon fichier de base
doit permettre de mettre à jour les infos de l'AD en se basant sur un
identifiant unique pour chaque utilisateur. Il faut donc que je vérifie ce
code et que je mette à jour les infos de l'utilisateur correspondant.

merci encore,
Lionel.


Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.










Avatar
lionel
ok je vais essayer, merci pour tout.


au fait c tous simple. si vous avez déja crééer votre script d'ajout, il vous
suffit de changer dsadd par dsmove et changer les variables que vous voulez.
sinon, suivez le script il est simple à comprendre.

___________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




tu ne serais pas ou je peux trouver un script déjà tout fait ? Je suis pas un
fan de scripting ;))


tout à fait

________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Merci pour cette réponse rapide.

L'inconvénient est que mes utilisateurs sont déjà créés. Mon fichier de base
doit permettre de mettre à jour les infos de l'AD en se basant sur un
identifiant unique pour chaque utilisateur. Il faut donc que je vérifie ce
code et que je mette à jour les infos de l'utilisateur correspondant.

merci encore,
Lionel.


Bonjour,

Ci-dessous un exemple de script. Remplacez les valeurs des OU's par les
votres.

---------------------------------------------------
rem %1 est le domaine
rem %2 est le TopLevelDomain(ex: fr, com,org...)

rem Création des OU
dsmove ou "OU=Comptabilite,DC=%1,DC=%2"
dsmove ou "OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
dsmove ou "OU=Direction,DC=%1,DC=%2"
dsmove ou "OU=SI,DC=%1,DC=%2"
dsmove ou "OU­mins,OU=SI,DC=%1,DC=%2"
dsmove ou "OU=Techniciens,OU=SI,DC=%1,DC=%2"

rem Création des groupes
dsmove group "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove group "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"

rem Création des utilisateurs
dsmove user "CN=Compta1,OU=Comptabilite,DC=%1,DC=%2" -fn Compta1 -samid
Compta1 -upn compta1@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CN=Compta2,OU=Comptabilite,DC=%1,DC=%2" -fn Compta2 -samid
Compta2 -upn compta2@%1.%2 -pwd -disabled no -mustchpwd yes
-memberof "CN=Compta,OU=Comptabilite,DC=%1,DC=%2"
dsmove user "CNÞveloppeur1,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur1
-samid Developpeur1 -upn Developpeur1@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CNÞveloppeur2,OUÞveloppeurs,DC=%1,DC=%2" -fn Developpeur2
-samid Developpeur2 -upn Developpeur2@%1.%2 -pwd -disabled no
-mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet1,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet1 -samid chefprojet1 -upn chefprojet1@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=chefprojet2,OU=Chefs de projet,OUÞveloppeurs,DC=%1,DC=%2"
-fn chefprojet2 -samid chefprojet2 -upn chefprojet2@%1.%2 -pwd
-disabled no -mustchpwd yes -memberof "CNÞvs,OUÞveloppeurs,DC=%1,DC=%2"
dsmove user "CN=direction1,OU=Direction,DC=%1,DC=%2" -fn direction1 -samid
direction1 -upn direction1@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN=direction2,OU=Direction,DC=%1,DC=%2" -fn direction2 -samid
direction2 -upn direction2@%1.%2 -pwd -disabled no -mustchpwd yes
dsmove user "CN­min1,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin1 -samid admin1
-upn admin1@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN­min2,OU­mins,OU=SI,DC=%1,DC=%2" -fn admin2 -samid admin2
-upn admin2@%1.%2 -pwd -disabled no -mustchpwd yes -memberof
"CN­mins du domaine,CN=Users,DC=%1,DC=%2"
dsmove user "CN=technicien1,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien1 -samid technicien1 -upn technicien1@%1.%2 -pwd -disabled
no -mustchpwd yes
dsmove user "CN=technicien2,OU=Techniciens,OU=SI,DC=%1,DC=%2" -fn
technicien2 -samid technicien2 -upn technicien2@%1.%2 -pwd -disabled
no -mustchpwd yes
-----------------------------------------------------------------

________________________________
Sofiane ALI-MOUSSA
MCSA/MCSE Windows Server 2K3




Bonjour,

je souhaite à partir d'un fichier (txt par exemple) contenant toutes les
utilisateurs et les infos les concernant mettre à jour mon AD. Ou puis je
trouver un script qui fasse ça ?

merci d'avance,
Lionel.