![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Quest AD Cmdlets - add-QADGroupMember 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 USERNAME@xxxxxx $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. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Quest AD Cmdlets - add-QADGroupMember 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: Quote: > 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 USERNAME@xxxxxx > $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. |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Quest AD Cmdlets - add-QADGroupMember You can pipe it directly to Add-QADGroupMember: (Get-QADUser UsernameA).memberof | Add-QADGroupMember -Member UsernameB ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > 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 > > "JSC" wrote: > Quote: >> 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 USERNAME@xxxxxx >> $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. >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Quest cmdlets : get-qaduser | PowerShell | |||
| Quest cmdlets - x64 Compliant ? | PowerShell | |||
| Quest AD cmdlets RC1 | PowerShell | |||
| Can't add Quest AD cmdlets | PowerShell | |||
| Quest AD Cmdlets | PowerShell | |||