[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-domain/home/netlogon/domscripts/ -> quitte_domaine.vbs (source)

   1  ' D'après le script rejoin_se3_XP.vbs de:
   2  ' Sandrine Dangreville matice creteil
   3  ' Il s'agit de rejoindre un groupe de travail 'tmpse3'
   4  ' $Id:$
   5  
   6  'Option Explicit
   7  Dim oWsh 'Windows Script Host Shell object
   8  
   9  Set oWsh = CreateObject("WScript.Shell")
  10  Set oWshEnvironment = oWsh.Environment("Process")
  11  Set oWshnet= Wscript.CreateObject("WScript.Network")
  12  
  13  strPassword = WScript.Arguments.Named("p")
  14  strUser = WScript.Arguments.Named("u")
  15  WScript.Echo "Utilisateur: " & strUser
  16  
  17  
  18  Set objNetwork = CreateObject("WScript.Network")
  19  strComputer = objNetwork.ComputerName
  20  WScript.Echo "Ordinateur: " & strComputer
  21  
  22  Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & strComputer & "'")
  23  strDomain = objComputer.Domain
  24  WScript.Echo "Domaine: " & strDomain
  25  intunjoin = objComputer.UnjoinDomainOrWorkgroup(strPassword, strDomain & "\" & strUser, 0)
  26  ReturnValue = objComputer.JoinDomainOrWorkGroup("tmpse3", NULL, NULL, NULL, 0)
  27  
  28  WScript.Echo "code : " & ReturnValue
  29  wscript.Quit(ReturnValue mod 255)


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1