How to get PrimarySmtpAddress for Exchance users and distribution lists
Tag : chash , By : adrianmooreuk
Date : March 29 2020, 07:55 AM
may help you . You need to resolve the recipient first - after calling CreateRecipient, call Recipient.Resolve.
|
How to Use PowerShell Create a new Distribution List( Contact Group) on Outlook 2010 Contacts
Date : March 29 2020, 07:55 AM
it fixes the issue I want to use PowerShell script to create a new outlook Contact group in contacts. , You need to specify that you want the DL list: $dl= $contacts.Items.Add("IPM.DistList")
|
Dynamic distribution lists in exchange 2010
Date : March 29 2020, 07:55 AM
|
Powershell script to list Distribution lists a user is a member of
Date : March 29 2020, 07:55 AM
this one helps. I assume you want only those four properties. Change the last line in your code to something like below: Get-DistributionGroup -ResultSize Unlimited -Filter $Filter | Select-Object Name,DisplayName,GroupType,PrimarySmtpAddress
|
Target all users in two OU's and remove Distribution Lists
Date : March 29 2020, 07:55 AM
I wish this help you So it sounds like you need three loops. First, you will need to loop over the OU list to get the Users. We'll store the user objects in $Users $OUs = 'OU=PendingDeletion,OU=Users,DC=Stuff,DC=Place,DC=net','OU=HoldForReview,OU=Users,DC=Stuff,DC=Place,DC=net'
$Users = ForEach ($OU in $OUs) {
Get-ADUser -Filter * -SearchBase $OU
}
ForEach ($User in $Users) {
Get-ADPrincipalGroupMembership -Identity $user |
Where-Object {$_.GroupCategory -eq 0} |
ForEach-Object {
Remove-ADPrincipalGroupMembership -Identity $user -MemberOf $_
}
}
|