Jef34 Je ferai mieux demain | J'ai trouvé ce script, mais j'ai malheureusement (débutant oblige) du mal à l'adapter à mes besoins
http://www.kouti.com/samplescripts [...] up.vbs.txt
Code :
- ' -------------------------------------------------------------------------
- ' From the book Inside Active Directory, ISBN 0-201-61621-1
- ' Copyright (C) 2002 by Addison-Wesley
- ' Script by Sakari Kouti (see http://www.kouti.com)
- ' You have a royalty-free right to use, modify, reproduce and distribute
- ' this script (and/or any modified version) in any way you find useful,
- ' provided that you agree that Addison-Wesley or Sakari Kouti has no
- ' warranty, obligations or liability for the script. If you modify
- ' the script, you must retain this copyright notice.
- ' -------------------------------------------------------------------------
- Option Explicit
- Dim objContainer, objGroup, objUser
- Set objContainer = GetObject("LDAP://OU=Sales,DC=sanao,DC=com" )
- Set objGroup = objContainer.GetObject("group", "CN=Sales" )
- objContainer.Filter = Array("user" )
- For Each objUser in objContainer
- If Not objGroup.IsMember(objUser.ADsPath) Then
- Call objGroup.Add(objUser.ADsPath)
- WScript.Echo "Added " & objUser.Name
- End If
- Next
|
Message édité par Jef34 le 29-05-2005 à 14:09:18
|