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 !
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 !
Try
Get-QADGroupMember GroupA | % { Add-QADGroupMember GroupB -Member $_ }
-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
> 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 !
>
On 28 fév, 16:19, "fan.of.tarja" <fan.of.ta...@xxxxxx> wrote:I've find a piece of solution :
> 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 !
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...
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
> 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 !
On 28 fév, 16:49, Shay Levi <n...@xxxxxx> wrote:Oh is too simple...
> Try
>
> Get-QADGroupMember GroupA | % { Add-QADGroupMember GroupB -Member $_ }
>
> -----
> Shay Levi
> $cript Fanatichttp://scriptolog.blogspot.com
>>
> > 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 !
And did you know if it possible to "move" the user ? (ie, clean the
source group) ?
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
> 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
> ...
>
>> 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 !
>>
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
>
> 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
>>
>> 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
>> ...
>>
>>> 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 !
>>>
>
On 28 fév, 18:05, "Andy Schneider" <a...@xxxxxx-powershell.com> wrote:That's fine ! Thanks a lot guy's...
> 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
>
>
>>
> > 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.>>
> >> 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.ta...@xxxxxx> wrote in message
> >>news:880bbdd0-6ab5-48ab-8fc5-49f25eff044f@xxxxxx
> >> ...>
> >>> 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 will try to continue my script for another thing !
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy file from one directory to a new directory, using excelspreadsheet as reference for items to be copied | cjake2299 | VB Script | 2 | 17 Dec 2009 |
| How to add to Group in Active Directory.... And has anyone a cmdlet? | Thomas Tomiczek | PowerShell | 3 | 02 Apr 2007 |
| Remove active directory object from group | char1iecha1k | PowerShell | 9 | 06 Jan 2007 |
| Active Directory | Lothar | PowerShell | 7 | 14 Dec 2006 |
| Group Policy for Vista in Windows 2000 Active Directory Domain | Will | Vista General | 0 | 29 Jun 2006 |