How do i use WGM or dcsl to change the primary groups of users, defined by another group?

i've got a ton of users, whose primary group is "current student". they all belong to the other group "year 13"
they've left school, so i thought it would be easy to do a search of users with GID equal to or containing the GID for "year 13" (in this case 1121) and then change their primary group to "left school"
except that doesn't work. i can only search for them in WGM by primary group, it seems. therefore i cannot do any batch operations on a secondary group.
so. how do i do this? is there a way of scripting dcsl to find users by 'other group' and then change the primary group attribute?
i'm going to need to be doing a lot of this (changing the other gropus of a school full of students). bit stumped.
help!

ok. for some reason neitehr root nor my account (which is part of the open directory admin group) can make changes using dscl.
when addingremoving users from groups, remember that teh UUID has to be added/removed too
this is getting there:
old=year11
new=year12
for item in `dscl /LDAPv3/127.0.0.1/ read /Groups/$old GroupMembership | cut -d: -f2`
do
echo $item
UUID=`dsmemberutil getuuid -U $item`
case "$UUID"
          in
          "There is no uuid for user $item")
                    echo "user $item need personal attention"
                    dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembership $item
                    dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembers $UUID
                    if [ "`dsmemberutil checkmembership -U $item -G $new`" == "user is a member of the group" ]  ; then
                    echo "$item added to $new"
                    dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembership $item
                    dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembers $UUID
                              if [ "`dsmemberutil checkmembership -U $item -G $old`" == "user is a member of the group" ]  ; then
                              echo "removal of $item from $old failed"
                              else
                              echo "removal of $item from $old succeded"
                              fi
                    else echo "append of $item to $new failed"
                    fi
          esac
done

Similar Messages

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • How to change the text of a user defined field in dynamic selections?

    Logical Database PSJ is used by t code CJI3 - we added a couple of user fields into the dynamic selections of CJI3.
    Now - how to change the text of this user filed (USR01 of structure PRSP_R in logical database PSJ)?
    Found an OSS note - 86980 - that tells that this is not possible.
    But when we read the documentation on the user field (CJI3 - dynamic selections  - double click on user field - F1), it shows the following text:
    User-defined field in which you can enter general information with a length of up to 20 characters.
    Dependencies
    The names (key words) for  user-defined fields depend on the field key.
    Now the question is where to change the field key..
    Thanks,
    Ven

    Madhu - you did not get the question I think.
    Anyways - I found an OSS note 1266643 - this code change should take care of the issue - it will then reflect the details maintained in custoizng at transaction code OPS1..
    Thanks,

  • How do i use my apple express speakers as the sound from apple tv?

    how do i use my apple express speakers as the sound from apple tv?

    Welcome to the Apple Community.
    You can't with the Apple TV 2 or 3, with the Apple TV 1, you can choose them from the Airtunes option in the settings menu.

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • How do I use dual displays to have a full screen app on one monitor and another full screen app or the desktop on the other?

    How do I use dual displays to have a full screen app on one monitor and another full screen app or the desktop on the other?
    I want to have my itunes visualizer on my TV which is connected via HDMI adapter, and still have access to full screen itunes and my desktop on the main display.
    Any suggestions?  App downloads that can do this?  Please let me know.

    You can't do it.  This has been an issue since Lion.

  • I want to hook up a mac mini and us my tv as a monitor. how can I use airplay from my phone on the mac mini like i can with an apple tv (without having to buy an apple tv!). the airplay capabilities i want to use are mirroring and streaming from my iphone

    i want to hook up a mac mini and us my tv as a monitor. how can I use airplay from my phone on the mac mini like i can with an apple tv (without having to buy an apple tv!). the airplay capabilities i want to use are mirroring and streaming from my iphone!

    Download AirPlayer for Mac - Transforms your Mac into an AirPlay-compatible display. MacUpdate.com

  • My old itunes id was an email that no longer can be used, therefore, I can not change the password for that account.  Everything that I purchased under that id name will not play.  How can I fix this?

    My old itunes id was an email that no longer can be used, therefore, I can not change the password for that account.  Everything that I purchased under that id name will not play.  How can I fix this?

    I no longer have an email address that was also my Apple ID. Can I still use the email address as my Apple ID?
    Apple recommends you change your Apple ID to your current, working email address. This will not create another Apple ID, it will only change it to your working email address. See Changing the name you use for your Apple ID if you'd like more information.
    Note: @mac.com and @me.com Apple IDs can not be renamed.  If you no longer use the .mac or .me email address be sure to add your valid email address as an additional email address.
    From here  >  http://support.apple.com/kb/HT5622?viewlocale=en_US
    If necessary...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How do I use a gift card bought in the Netherlands here in Canada

    How do I use a gift card bought in the Netherlands here in Canada

    Hi ..
    Sorry, not possible. A gift card purchased in one country cannot be redeemed in another.
    Purchasing an iTunes Gift Card for use in another country

  • How do i use a time capsule as a shared drive and back it up to another time capsule using time machine ??

    how do i use a time capsule as a shared drive and back it up to another time capsule using time machine ??

    You cannot backup network drives with Time Machine.
    You can simply setup the TC in the network.. it is a shared drive.

  • Hello my name is jose quant, and let me know how I can use CAMERA RAW adobe bridge because the bridge use and want to open a camera raw image, I get a message that says: MAIN BRIDGE aplicaion NOT ACTIVATED. BRIDGE REQUIRES A PARTICULAR PRODUCT HAS BEGUN A

    Hello my name is jose quant, and let me know how I can use CAMERA RAW adobe bridge because the bridge use and want to open a camera raw image, I get a message that says: MAIN BRIDGE aplicaion NOT ACTIVATED. BRIDGE REQUIRES A PARTICULAR PRODUCT HAS BEGUN AT LEAST ONCE TO ACTIVATE THIS FEATURE. I wonder what that means?
    I use a lapto (windows 7) 64-Bit operating system.
    Thank you,
    my email is: [email protected], if you send me the answer to my query

    You need to activate Photoshop.
    Mylenium

  • HT4427 how do I use a song from iTunes as the ringtone for my iPhone 5?

    how do I use a song from iTunes as the ringtone for my iPhone 5?

    Google will find several free ways to create ringtones for iphone.

  • How can I use srvctl command line for change "Failover type" and "F method"

    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.

    user10674190 wrote:
    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.srvctl modify service -d database_name -s orcldb -q TRUE -m BASIC -P BASIC -e SELECT -z 180 -w 5 -j LONG
    Also see
    11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases [ID 1312749.1]

  • How can I use word count without it counting the words in the end notes by default?

    How can I use word count without it counting the words in the end?
    Now I have to highlight the text to get a count.

    I don't think that is possible, it does what it does.
    Peter

  • How can I use my TimeMachine to back up the external hard drive

    How can I use my TimeMachine to back up the external hard drive that is attached to my TimeMachine? I have the external drive attached to my TimeMachine via the USB port and want my TimeMachine to back up the files on the external drive, as it does for the files on my computer. How do I do that?

    https://discussions.apple.com/message/16276201#16276201

Maybe you are looking for

  • Best Practice for Portable Home Directories

    What are the 'best practice' directories to sync for Portable Homes - at login and in the background. I want to make my user experience a little better than it is now. Login and logout take about 2 minutes - even over ethernet 100Mb, and longer using

  • Dynamic number of xml files with a specified max size

    Hi all, I'm using a custom report to generate xml files (via a ST program and a call transformation) containing data belonging to is-u invoices (some are much more complex and rich of data than other ones). I'm asked to generate the minimun number of

  • Confused as to why this doesn't work...

    I wrote this code correctly, but it doesn't seem to work. I'm not sure if I'm leaving something out or not using something correctly. If anyone can tell me why this doesn't work, it would be greatly appreciated! P.S. in the actionPerformed method, I

  • Use of Address field in Delivery Address tab of Purchase Order

    Hi, In Purchase Order, there is field Address in Delivery Address tab. How can we maintain Address in SAP. Also in what scenario we use the Address. My understanding is: We have marinated the Plant Address as Sec-59, Gurgaon and while creating the Pu

  • Null Error when clearing out a search

    When I do a search, then clear out the search string, I get: Line: 112 Error: 'examples.examples' is null or not an object