Quackers Posted December 8, 2008 Posted December 8, 2008 I want to put on a timer the adding of a group to a group in active directory. Easy i thought, i'll use the NET GROUP command. In a batch file, so i try NET GROUP "GROUP 1" "GROUP 2" / ADD It says no such user as it thinks i'm trying to add a user to a group. How can i achive this with a script?
ful56_uk Posted December 8, 2008 Posted December 8, 2008 any good? Tutorial for VBScript. Example add members to Active Directory group
Lithium Posted December 8, 2008 Posted December 8, 2008 Why would you want to put on a timer, the adding of a group to a group? Active Directory groups automagically update themselves when child groups are updated...
Quackers Posted December 8, 2008 Author Posted December 8, 2008 Why would you want to put on a timer, the adding of a group to a group? Active Directory groups automagically update themselves when child groups are updated... We use file permissions to allow access to a specific area on the local hard disk. We want to timer this by adding "Domain Users" to the group which has access to the folder.
srochford Posted December 8, 2008 Posted December 8, 2008 @ful56_uk should have pointed you in the right direction; if not then give me a shout and I'll dig out some more sample code. You can't do it with the "net group" command because it uses the API from Windows NT days (probably LAN Manager days!) which didn't support nested groups. You have to use the ADSI interface and then it will work well. If you can't get that to work and you need it in a hurry then take the list of usernames and make a long list of: net group /add /domain (create them in Excel!) followed by a matching list of: net group /delete /domain (remember that even if you don't have the username list that net group will give you that list)
Quackers Posted December 8, 2008 Author Posted December 8, 2008 @ful56_uk should have pointed you in the right direction; if not then give me a shout and I'll dig out some more sample code. The link from ful56_uk is making my eyes bleed . I've had a go, but it just errors when i alter things in the example code. Cannot belive how difficult things are to do with VBS, cannot find Group to Group examples anywhere...
Lithium Posted December 8, 2008 Posted December 8, 2008 Somewhere I read in a different topic that other people do the same sort of thing... but they add and remove the group from the security permissions and schedule that to run at two times (add the group and remove the group)
Jonesminor Posted December 8, 2008 Posted December 8, 2008 dsmod group with -addmbr and -rmmbr dsmod group "CN=Group, OU=GroupLivesHere, OU=ParentOU, DC=your, DC=domainname" -addmbr "CN=Domain Users, CN=Users, DC=your, DC=domainname" -- 1
Quackers Posted December 9, 2008 Author Posted December 9, 2008 Thanks, DS MOD is doing the trick great!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now