Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1441 connectés 

  FORUM HardWare.fr
  Windows & Software

  AD - Script ou ligne de commande pour inscrire machine dans le domaine

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

AD - Script ou ligne de commande pour inscrire machine dans le domaine

n°2349958
symantec
Posté le 09-03-2006 à 12:40:44  profilanswer
 

Ca existe une ligne de commande ou un script pour enregistrer une machine dans un domaine AD ?
 
J'ai cherché sur Google mais y m'a rien trouvé !
 
Merci

mood
Publicité
Posté le 09-03-2006 à 12:40:44  profilanswer
 

n°2349962
shuai
Posté le 09-03-2006 à 12:42:33  profilanswer
 

netdom...

n°2349963
Le Veilleu​r
Posté le 09-03-2006 à 12:42:40  profilanswer
 

symantec a écrit :

Ca existe une ligne de commande ou un script pour enregistrer une machine dans un domaine AD ?
 
J'ai cherché sur Google mais y m'a rien trouvé !
 
Merci


Code :
  1. Const JOIN_DOMAIN = 1
  2. Const ACCT_CREATE = 2
  3. Const ACCT_DELETE = 4
  4. Const WIN9X_UPGRADE = 16
  5. Const DOMAIN_JOIN_IF_JOINED = 32
  6. Const JOIN_UNSECURE = 64
  7. Const MACHINE_PASSWORD_PASSED = 128
  8. Const DEFERRED_SPN_SET = 256
  9. Const INSTALL_INVOCATION = 262144
  10. strDomain = "FABRIKAM"
  11. strPassword = "ls4k5ywA"
  12. strUser = "shenalan"
  13. Set objNetwork = CreateObject("WScript.Network" )
  14. strComputer = objNetwork.ComputerName
  15. Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
  16.     strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
  17.         strComputer & "'" )
  18. ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _
  19.     strPassword, strDomain & "\" & strUser, NULL, _
  20.         JOIN_DOMAIN + ACCT_CREATE)


---------------
Mon Blog : LeVeilleur.net | Hébergement d'images : Hostipics.net
n°2350032
symantec
Posté le 09-03-2006 à 14:05:50  profilanswer
 

Merci Messieurs (enfin je crois)
 
Le VBS est niquel chrome !

n°2350089
Le Veilleu​r
Posté le 09-03-2006 à 14:57:26  profilanswer
 

:jap:


---------------
Mon Blog : LeVeilleur.net | Hébergement d'images : Hostipics.net
n°2350123
boisorbe
Posté le 09-03-2006 à 15:20:41  profilanswer
 

quel type de machine tu integres (XP ou 2000)?
il me semblait qu'il ne fonctionnait pas pour des 2000 ce script ou alors j'avais mal teste...
 
j'utilise netdom lancer par un script :D
ca pourrait m'alleger ca.

n°2350143
brainbugs
Posté le 09-03-2006 à 15:33:55  profilanswer
 

+1 netdom c'est plus sur.

n°2350964
dahlo
Posté le 10-03-2006 à 11:45:58  profilanswer
 


Citation :

You want to know whether the script will run on Windows 2000-based computers. As it turns out, it does not, because the Win32_ComputerSystem class does not support the JoinDomainOrWorkGroup method on Windows 2000. The JoinDomainOrWorkGroup method was added to the Win32_ComputerSystem class in the version of WMI included with Windows XP. Source:http://www.microsoft.com/technet/s [...] _osjn.mspx


voir: http://msdn.microsoft.com/library/ [...] system.asp -> Requirements (Client)
       http://support.microsoft.com/kb/q222525/

n°2351076
bigstyle
Posté le 10-03-2006 à 13:34:23  profilanswer
 

+1 pour netdom aussi


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Windows & Software

  AD - Script ou ligne de commande pour inscrire machine dans le domaine

 

Sujets relatifs
changer controleur de domaine NT4 en serveur simple ?Deux FAI sur une même ligne c'est possible ?
Script Dragon Naturally SpeakingLa commande exécuter a disparu
Script CGI + récupération de fichiers zippésInscrire un eggdrop dans la base de registre
commande DOS et dateAudit sur un domaine et journal d'evenement
Filtrer les strategie de domaine ADcherche script pour chater sur chat deja existant
Plus de sujets relatifs à : AD - Script ou ligne de commande pour inscrire machine dans le domaine


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR