Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Active Directory and group copy

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-28-2008   #1 (permalink)
fan.of.tarja
Guest


 

Active Directory and group copy

Hi everybody,

I'd like to move the group members to another group. I've isntalled
the Quest cmdlets.
I think the solution is near Add-QADGroupMember but I don't know how
to use these...

What is the best practices to do that ?

Thanks !

My System SpecsSystem Spec
Old 02-28-2008   #2 (permalink)
Shay Levi
Guest


 

Re: Active Directory and group copy



Try

Get-QADGroupMember GroupA | % { Add-QADGroupMember GroupB -Member $_ }



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

> Hi everybody,
>
> I'd like to move the group members to another group. I've isntalled
> the Quest cmdlets.
> I think the solution is near Add-QADGroupMember but I don't know how
> to use these...
> What is the best practices to do that ?
>
> Thanks !
>

My System SpecsSystem Spec
Old 02-28-2008   #3 (permalink)
fan.of.tarja
Guest


 

Re: Active Directory and group copy

On 28 fév, 16:19, "fan.of.tarja" <fan.of.ta...@xxxxxx> wrote:
Quote:

> Hi everybody,
>
> I'd like to move the group members to another group. I've isntalled
> the Quest cmdlets.
> I think the solution is near Add-QADGroupMember but I don't know how
> to use these...
>
> What is the best practices to do that ?
>
> Thanks !
I've find a piece of solution :

get-content d:\taf\scripts\powershell\groupe\grp.txt | foreach {
$grp = $_
Get-QADGroupMember $_ | select name,type,dn,@{n="Group";e={$grp}}

} | export-csv -noType d:\taf\scripts\powershell\groupe
\groupMembers.csv

Perhaps, I don't know how to affect this users to the another group...
My System SpecsSystem Spec
Old 02-28-2008   #4 (permalink)
Andy Schneider
Guest


 

Re: Active Directory and group copy

To add users to a group, you can use the get-qaduser and pipe it to
add-qadgroupmember like this

Get-QadUser JoeUser | Add-Qadgroupmember GroupName

To copy users to another group you could probably do something like

Get-QadGroupMember OldGroupName | Add-QadGroupmember NewGroupName

If you are "moving" the users, then you would have to remove the users from
the first group which you could do with Remove-QadGroupMember

Andy

Blog
http://www.get-powershell.com


"fan.of.tarja" <fan.of.tarja@xxxxxx> wrote in message
news:880bbdd0-6ab5-48ab-8fc5-49f25eff044f@xxxxxx
Quote:

> Hi everybody,
>
> I'd like to move the group members to another group. I've isntalled
> the Quest cmdlets.
> I think the solution is near Add-QADGroupMember but I don't know how
> to use these...
>
> What is the best practices to do that ?
>
> Thanks !
My System SpecsSystem Spec
Old 02-28-2008   #5 (permalink)
fan.of.tarja
Guest


 

Re: Active Directory and group copy

On 28 fév, 16:49, Shay Levi <n...@xxxxxx> wrote:
Quote:

> Try
>
> Get-QADGroupMember GroupA | % { Add-QADGroupMember GroupB -Member $_ }
>
> -----
> Shay Levi
> $cript Fanatichttp://scriptolog.blogspot.com
>
Quote:

> > Hi everybody,
>
Quote:

> > I'd like to move the group members to another group. I've isntalled
> > the Quest cmdlets.
> > I think the solution is near Add-QADGroupMember but I don't know how
> > to use these...
> > What is the best practices to do that ?
>
Quote:

> > Thanks !
Oh is too simple...

And did you know if it possible to "move" the user ? (ie, clean the
source group) ?
My System SpecsSystem Spec
Old 02-28-2008   #6 (permalink)
Shay Levi
Guest


 

Re: Active Directory and group copy


Odd.. I also tried piping the members directly to Add-QadGrouMember, it didn't
work.
I'm behind a VPN connection but I'm not sure if this is the cause. Using
foreach worked with no errors.

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

> To add users to a group, you can use the get-qaduser and pipe it to
> add-qadgroupmember like this
>
> Get-QadUser JoeUser | Add-Qadgroupmember GroupName
>
> To copy users to another group you could probably do something like
>
> Get-QadGroupMember OldGroupName | Add-QadGroupmember NewGroupName
>
> If you are "moving" the users, then you would have to remove the users
> from the first group which you could do with Remove-QadGroupMember
>
> Andy
>
> Blog
> http://www.get-powershell.com
> "fan.of.tarja" <fan.of.tarja@xxxxxx> wrote in message
> news:880bbdd0-6ab5-48ab-8fc5-49f25eff044f@xxxxxx
> ...
>
Quote:

>> Hi everybody,
>>
>> I'd like to move the group members to another group. I've isntalled
>> the Quest cmdlets.
>> I think the solution is near Add-QADGroupMember but I don't know how
>> to use these...
>> What is the best practices to do that ?
>>
>> Thanks !
>>

My System SpecsSystem Spec
Old 02-28-2008   #7 (permalink)
Andy Schneider
Guest


 

Re: Active Directory and group copy

Interesting. I got the qaduser one to work fine with a regular pipe.
I just assumed the QadGroupMember would work as well.
Thats what I get for assumptions

Andy
http://www.get-powershell.com



"Shay Levi" <no@xxxxxx> wrote in message
news:8766a9442128e8ca484fc0183d2a@xxxxxx
Quote:

>
> Odd.. I also tried piping the members directly to Add-QadGrouMember, it
> didn't work.
> I'm behind a VPN connection but I'm not sure if this is the cause. Using
> foreach worked with no errors.
>
> -----
> Shay Levi
> $cript Fanatic
> http://scriptolog.blogspot.com
>
Quote:

>> To add users to a group, you can use the get-qaduser and pipe it to
>> add-qadgroupmember like this
>>
>> Get-QadUser JoeUser | Add-Qadgroupmember GroupName
>>
>> To copy users to another group you could probably do something like
>>
>> Get-QadGroupMember OldGroupName | Add-QadGroupmember NewGroupName
>>
>> If you are "moving" the users, then you would have to remove the users
>> from the first group which you could do with Remove-QadGroupMember
>>
>> Andy
>>
>> Blog
>> http://www.get-powershell.com
>> "fan.of.tarja" <fan.of.tarja@xxxxxx> wrote in message
>> news:880bbdd0-6ab5-48ab-8fc5-49f25eff044f@xxxxxx
>> ...
>>
Quote:

>>> Hi everybody,
>>>
>>> I'd like to move the group members to another group. I've isntalled
>>> the Quest cmdlets.
>>> I think the solution is near Add-QADGroupMember but I don't know how
>>> to use these...
>>> What is the best practices to do that ?
>>>
>>> Thanks !
>>>
>
>
My System SpecsSystem Spec
Old 02-29-2008   #8 (permalink)
fan.of.tarja
Guest


 

Re: Active Directory and group copy

On 28 fév, 18:05, "Andy Schneider" <a...@xxxxxx-powershell.com> wrote:
Quote:

> Interesting. I got the qaduser one to work fine with a regular pipe.
> I just assumed the QadGroupMember would work as well.
> Thats what I get for assumptions
>
> Andyhttp://www.get-powershell.com
>
> "Shay Levi" <n...@xxxxxx> wrote in message
>
> news:8766a9442128e8ca484fc0183d2a@xxxxxx
>
>
>
Quote:

> > Odd.. I also tried piping the members directly to Add-QadGrouMember, it
> > didn't work.
> > I'm behind a VPN connection but I'm not sure if this is the cause. Using
> > foreach worked with no errors.
>
Quote:

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

> >> To add users to a group, you can use the get-qaduser and pipe it to
> >> add-qadgroupmember like this
>
Quote:
Quote:

> >> Get-QadUser JoeUser | Add-Qadgroupmember GroupName
>
Quote:
Quote:

> >> To copy users to another group you could probably do something like
>
Quote:
Quote:

> >> Get-QadGroupMember OldGroupName | Add-QadGroupmember NewGroupName
>
Quote:
Quote:

> >> If you are "moving" the users, then you would have to remove the users
> >> from the first group which you could do with Remove-QadGroupMember
>
Quote:
Quote:

> >> Andy
>
Quote:
Quote:

> >> Blog
> >>http://www.get-powershell.com
> >> "fan.of.tarja" <fan.of.ta...@xxxxxx> wrote in message
> >>news:880bbdd0-6ab5-48ab-8fc5-49f25eff044f@xxxxxx
> >> ...
>
Quote:
Quote:

> >>> Hi everybody,
>
Quote:
Quote: