[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clonage/sources/quitte_se3/outils/ -> rejoin_workgrp2.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 'XXX'
   4  ' Stephane Boireau AS Bernay/Pont-Audemer (27)
   5  ' 08/10/2005
   6  
   7  'Option Explicit
   8  Dim oWsh 'Windows Script Host Shell object
   9  
  10  Set oWsh = CreateObject("WScript.Shell")
  11  Set oWshEnvironment = oWsh.Environment("Process")
  12  Set oWshnet= Wscript.CreateObject("WScript.Network")
  13  
  14  Set args = Wscript.Arguments
  15  
  16  'testarg=MsgBox("Argument: " & args(0),vbCritical + vbOKCancel + 0,"Titre")
  17  
  18  if Wscript.Arguments.Count then
  19      workgroup=args(0)
  20  else
  21      workgroup="test"
  22  End If
  23  
  24  strComputer = "."
  25  
  26  'if PN="Microsoft Windows XP" then
  27      Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  28      Set colCompSystems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
  29      For Each objComputer in colCompSystems
  30          'intunjoindomain=objComputer.UnjoinDomainOrWorkgroup(sAdminPwd,sAdminName,0)
  31          intunjoindomain=objComputer.UnjoinDomainOrWorkgroup("","",0)
  32      next
  33  'end if
  34  
  35  
  36  Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  37  Set colCompSystems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
  38  For Each objComputer in colCompSystems
  39      'Ca ne passe pas avec args(0)
  40      'intunjoindomain=objComputer.JoinDomainOrWorkgroup(args(0),"","",0)
  41      intunjoindomain=objComputer.JoinDomainOrWorkgroup(workgroup,"","",0)
  42  next
  43  
  44  ' Est-ce que cela fonctionne aussi sous WNT/2K?


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