active directory - is ADD-distributiongroupmember a cmdlet in powershell to add members into a distribution list -
I am trying to write a power script to add and delete members from the distribution list present in Active Directory. I tried an order to add members to the distribution list, which: ADD-DistributionGroupmember- "employee" -mail "johnevans@contoso.com" but when I try to execute this order tell me An error occurred that add-distributiongroupmember is an invalid command. Therefore, someone can give me a power script to add and remove members from the distribution list present in Active Directory. Add-item-distribution group member is an Exchange CMDlet, and it's the exchange management snapin or remote exchange management session. the wanted.
You can accomplish the same thing by using the ActiveDirectory module and add-adgroup member, but you will not be able to use the user's email address as a member identity to add. The exchange will act as an identifying reference with him, but the native AD CMDlets will not be there.
Comments
Post a Comment