Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Quest AD Cmdlets - add-QADGroupMember

246 views
Skip to first unread message

RichS

unread,
Mar 12, 2008, 2:46:01 PM3/12/08
to
I haven't got access to a test machine at the moment but something like

$user.memberof | get-qadgroup | foreach {Add-qadgroupmember -identity $_.DN
- member <user identity> }

should work for you
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"JSC" wrote:

> I currently use the Quest AD Cmdlets to give a printout of group membership
> of a particular user by doing the following:
>
> $user = Get-QADUser USER...@domain.com
> $user.memberOf | Get-QADGroup | ft name
>
> Is there a way to pipe the results of the group membership and use the
> addQADgroupmember CMdlet to make another account mirror the exact same group
> membership as the first account?
>
> Example: username A is a member of group 1, 2, and 3. Using the 2nd line of
> code above, it prints out the groups 1, 2, 3. Then take those groups and add
> username B to those exact same groups.

Shay Levi

unread,
Mar 12, 2008, 4:33:05 PM3/12/08
to

You can pipe it directly to Add-QADGroupMember:

(Get-QADUser UsernameA).memberof | Add-QADGroupMember -Member UsernameB

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com

> I haven't got access to a test machine at the moment but something
> like
>
> $user.memberof | get-qadgroup | foreach {Add-qadgroupmember -identity
> $_.DN - member <user identity> }
>
> should work for you
>

0 new messages