Question

How to add the distrubtion group from Powershell in Active Directory ?

I have user in active directory and i want to add the user into particular group rather than going and server because that part is going to be outsourced.

so how to add the distrubution group for particular user.

Was it helpful?

Solution

Here's the basic code:

$group = [adsi]"LDAP://CN=Group1,OU=Groups,DC=domain,DC=com" $group.member.Add('CN=User1,OU=Users,DC=domain,DC=com')
$group.SetInfo()

OTHER TIPS

'Add-ADGroupMember' is useful here if you have ActiveDirectory module available. Powershell 3.0 and later have it available by default. Use Get-Help for syntax.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top