mahesh_gowda
asked on
VB script to update distribution list
Need a VB script which will update "XYZ" distribution list membership from the related security group. All members (users and groups) of the distribution group are removed first.Then the related security group is fully expanded to include all members (users and groups). Finally, the members (users and groups) are added from the related security group
Couldn't you just mail enable the security group, and use one group for both purposes?
Depending on your aim, it could be as simple as this. It simply overwrites the membership of the Destination Group with that from the Source Group.
Chris
Set objSourceGroup = GetObject("LDAP://CN=Source Group Name,OU=somewhere,DC=yourdomain,DC=com")
Set objDestGroup = GetObject("LDAP://CN=Dest Group Name,OU=somewhere,DC=yourdomain,DC=com")
objDestGroup.Put "member", objSourceGroup.GetEx("member")
objDestGroup.SetInfo
ASKER
Hello Sage,
Thank you for your reply. We need to remove the member and we want the security group to expand fully to include all members. Can you let me know on this.
Thank you for your reply. We need to remove the member and we want the security group to expand fully to include all members. Can you let me know on this.
What do you mean by expand fully to include all members?
The above already removes existing members, simply because it completely overwrites any current membership.
Chris
ASKER
Hello Chris,
Thank you!! Is there a possibility for us to get a mail once the update is done? Can you help me on that?
Thank you!! Is there a possibility for us to get a mail once the update is done? Can you help me on that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.