Microsoft
Software
Hardware
Network
Question : vbscript with Loop command
Hi All,
I have below script, which copy user members from one group and cpies to another group.Now the question is that i have 6 different source groups and 6 target groups. I dont want to run 6 differnet scripts for each group. Can someone help me out with this. We can define set objx1....objx6 and same for target and then run the for command looping for each group.
--------------------------
----------
----------
-------
Set objSource = GetObject("LDAP://cn=Locat
ion - src, ou=Distribution Lists, ou= Groups, dc=xyz, dc=com")
' Select target group.
Set objTarget = GetObject("LDAP://cn=Locat
ion- DL, ou=Security Groups, ou=Groups, dc=xyz, dc=com")
' Enumerate members of source group.
For Each objMember In objSource.Members
' Check if this object already a member of the target group.
If (objTarget.IsMember(objMem
ber.AdsPat
h) = False) Then
' Add this object to the target group.
objTarget.Add(objMember.Ad
sPath)
count = count + 1
End If
Next
if count < 1 then
count = 0
end if
--------------------------
----------
----------
-----
Thanks
Answer : vbscript with Loop command
I am not familiar with the specifics of the ldap object, but you need to check to see if it is a group, and ignore it if it is.
Random Solutions
Dell Disk error - is there any point trying to recover this? Whats the problem do you think?
Deleting OEM Jobs
Using VBA in MS Access trying to prefill a pdf form...stumped on how to programmatically fill a check box..
How to let the user save back Excel to website?
MS Access SQL
Server Local Group to Domain Local Group
If attribut is ... then do this
How do I set a form to open when Access 2007 and/or 2010 opens a data base?
Need help with form that uses radio & check boxes with JS
Using find and grep to create a file