[Samba] Allow access to a share to all members of a container?

Matt Perkins mperkins at lbmc.com
Fri Nov 5 23:29:49 GMT 2004


This script will add all of the users in an OU to a Group. Copy it and
save it with a .vbs extension.

Begin Script
====================
' The OU that contains the users you want to add.
Set  oContainer = GetObject ("LDAP://OU=Test,DC=domain,DC=com")
' The group you want to add them too.
GroupAdd = "New Group"
' Old style Domain Name
DomainName = "DOMAIN"
Set GroupObj = GetObject("WinNT://" & DomainName  & "/" & GroupAdd)
                                                                       
ModifyUsers oContainer
                                                                        
Sub ModifyUsers(oObject)
Dim oUser
   oObject.Filter = Array("User")
   For Each oUser in oObject
      If oUser.Class = "user" Then
'     Comment in the next line in for testing.
'     WScript.Echo ouser.samAccountName
'     The next line adds the users to the group.
      GroupObj.Add ("WinNT://" & DomainName & "/" & _
oUser.samAccountName)
      End If
   Next
End Sub
====================
End Script




On Thu, 2004-11-04 at 14:52, Tom Dickson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> They are in a 2000 ADS OU.
> 
> - -Tom
> 
> Matt Perkins wrote:
> | Do the users exist in an OPENLDAP database or Windows Active Directory?
> |
> | On Thu, 2004-11-04 at 10:47, Tom Dickson wrote:
> |
> | I have 104,000 users, some of which are in the OU:
> |
> | ad.network.local\AD\People\IFAS\Hort
> |
> | Is there an easy way to find all the users in this OU and grant them
> | access to a share?
> |
> | Or do I have to list each user individually?
> |
> | And if so, can I use net user to list the users in an OU?
> |
> | -Tom
> 
> | .
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFBipZ72dxAfYNwANIRAjU0AJ9f2izoSLin4WcDIc3ikiirzXDRpACff/kg
> SomENjyM72ClkA2hz+BaJuc=
> =zeTr
> -----END PGP SIGNATURE-----



More information about the samba mailing list