Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Create a New Outlook Distribution List Based On the Membership of an Active Directory GroupContent of Create a New Outlook Distribution List Based On the Membership of an Active Directory Group.vbsMD5 Hash: 776E12BBBE204F1BD93996F20E62E7CF |
||
On Error Resume Next
Const olDistributionListItem = 7 Set objOutlook = CreateObject("Outlook.Application") Set objList = objOutlook.CreateItem(olDistributionListItem ) objList.DLName = "Test Group" objList.Save Set objGroup = GetObject("LDAP://CN=Finance Users,OU=Finance,,DC=fabrikam,DC=com") For Each strUser in objGroup.Member Set objUser = GetObject("LDAP://" & strUser) strUserName = objUser.displayName Set objRecipient = objOutlook.Session.CreateRecipient(strUserName) objRecipient.Resolve objList.AddMember objRecipient Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |