[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clonage/sources/quitte_se3/outils/ -> suppr_adminse3.vbs (source)

   1  ' D'après le script rejoin_se3_XP.vbs de:
   2  ' Sandrine Dangreville matice creteil
   3  ' Il s'agit de supprimer le compte adminse3
   4  ' Stephane Boireau AS Bernay/Pont-Audemer (27)
   5  ' 08 juillet 2005
   6  
   7  'Option Explicit
   8  Dim oWsh 'Windows Script Host Shell object
   9  Dim sCurrentName 'holds computername environment variable
  10  Dim oWshEnvironment 'Windows Script Host environment object
  11  Dim sAdminName
  12  
  13  Set oWsh = CreateObject("WScript.Shell")
  14  Set oWshEnvironment = oWsh.Environment("Process")
  15  Set oWshnet= Wscript.CreateObject("WScript.Network")
  16  
  17  sCurrentName= oWshnet.ComputerName
  18  
  19  sAdminName="adminse3"
  20  
  21  Set ComputerObj = GetObject("WinNT://" & sCurrentName )
  22  'error("Instanciation de l'objet Computer")
  23  ComputerObj.Filter = Array("user")
  24  For Each oUser In ComputerObj
  25      'MsgBox "compte " & oUser.name ,vbInformation + vbOkOnly + vbApplicationModal + 0,"Installation"
  26      If LCase(oUser.Name) = LCase(sAdminName) Then
  27          ComputerObj.Delete "user",sAdminName
  28          'error( oUser.Name & " already has an account. Destroyed")
  29          'MsgBox "compte admin détruit " & sAdminName ,vbInformation + vbOkOnly + vbApplicationModal + 0,"Installation"
  30      End If
  31  Next
  32  
  33  ' Il serait intéressant de récupérer le nom du dossier HOME d'adminse3
  34  ' Comment le faire en VBS?
  35  ' Sinon, utiliser aussi un script autoit, avec des cases à cocher pour les dossiers à supprimer.


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