Windows Vista Forums

Active Directory and group copy
  1. #1


    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

  2. #2


    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

    > 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

  3. #3


    fan.of.tarja Guest

    Re: Active Directory and group copy

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

    > 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

  4. #4


    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

    > 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

  5. #5


    fan.of.tarja Guest

    Re: Active Directory and group copy

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

    > 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 !
    Oh is too simple...

    And did you know if it possible to "move" the user ? (ie, clean the
    source group) ?

      My System SpecsSystem Spec

  6. #6


    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

    > 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 !
    >>


      My System SpecsSystem Spec

  7. #7


    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

    >
    > 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 !
    >>>
    >
    >

      My System SpecsSystem Spec

  8. #8


    fan.of.tarja Guest

    Re: Active Directory and group copy

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

    > 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.
    >

    > > -----
    > > 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.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 !
    That's fine ! Thanks a lot guy's...

    I will try to continue my script for another thing !

      My System SpecsSystem Spec

Active Directory and group copy problems?

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