I just created a Distribution list:
$outlook = new-object -com Outlook.Application
$contacts = $outlook.Session.GetDefaultFolder(10)
$dl = $contacts.Items.Add("IPM.DistLIst")
$dl.Save()
and then created a new contact
$newcontact = $contacts.Items.Add()
$newcontact.FullName = "abc"
$newcontact.JobTitle = "abc manager"
$newcontact.Email1Address = "abc@abc.com"
How do I add this new contact to the newly created contact list?
I have tried:
$dl.Members.Add($newcontact)
$dl.Action.Add($newcontact)
But they both did not work,
Please help, any help will be appreciated.
Ruijie