add members to distribution group powershell

Get-DistributionGroup managed by export-csv – Powershell

Get-DistributionGroup managed by export-csv – Powershell

First step would be import csv with DL names which you would like to check

$List=import-csv “C:\Users\username\Desktop\DLs.csv”

Second would to find the managedby for those DL’s

ForEach ($User in $List){Get-DistributionGroup -Identity $User.name| select name,Managedby | out-gridview}Read the rest

Making a Security Group using Distribution group members in Powershell

Making a Security Group using Distribution group members in Powershell

First lets get the list of users samaccountnames from Distribution list

$List=Get-ADGroupmember DistributionlistName

Now create a empty Security group from Active Directory Users and Computers

Now lets add each of above user into a security group which is created from ADUC(Active Directory Users and Computers).

ForEach ($User in $List){Add-ADGroupMember -Identity SecurityGroupName -Member $User.samaccountname}

We can also use add members to distribution group powershell by this method of Add-ADGroupmember

We can also use powershell to add members to distribution group powershell or a Security group.

We can also use powershell to

Read the rest