Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Adding the Users in a group through Powershell

$
0
0

Dear All,

We have to import all the Mailbox enabled users to a Universal Distribution group and have to import all the Newly created Mailbox enabled user to the same group.

I have got the following script to acheive the same

Get-ADUser -LDAPFilter "(&(objectcategory=person)(objectclass=user)(mailnickname=*))" -SearchScope Subtree -SearchBase "DC=XXX,DC=XXX" -ResultSetSize $null

However the above command is limited to one Domain The problem here is we have multiple child domains and we need to fetch the users from all the domains into one Distribution Group (Located in the Parent Domain)

I have the following command which is used to get the list of all the Active Directory Users (Includes users without Mailbox)

Get-ADUser -FI * -Server "Globalcatalog:3268"

Is there any command in Power Shell which will address my requirement of having a distribution group in Parent Domain with the users from all the child domain accomadated

Regards

Naveen Chandra G.V


Naveen Chandra G.V


Viewing all articles
Browse latest Browse all 2562

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>