Moving users with curl

Trying to move users between PO's using curl/API.  Command seems to be doing something, but user never moves and never shows up in the "failed move" node.

Script I am using (and i've tried many variations)

curl -k --user admin:xxxxxx -H "Content-Type: application/json" -X POST -d '{"GWPO6":"POST_OFFICE.myDomain.GWPO6","sources":[{"GWLLPO":"myDomain.GWLLPO.User1","createNickname":"true"}]}' 172.18.11.180:9710/.../moverequests --output /tmp/out.txt

The first PO listed above is the source and the second is the destination.  I have tried flipping those around to no success.

The results I see when firing the script are as follows:

Any help would be greatly appreciated.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 121 0 7 100 114 7000 111k --:--:-- --:--:-- --:--:-- 118k

  • 0  

    I have checked some ReSTApi calls but did find your approach.

    I see this.

    But this is only a GET ...


    Use "Verified Answers" if your problem/issue has been solved!

  • 0   in reply to   

    However in the SDK documentation there is a POST ...


    Use "Verified Answers" if your problem/issue has been solved!

  • 0  
    -d '{"GWPO6":"POST_OFFICE.myDomain.GWPO6"

    Did you try to replace your first "GWPO6" with "postOfficeId"?

    I take this explanation:

    {
    "postOfficeId": "POST_OFFICE.Dom1.Po2",
    "sources": [
    {"id": "USER.Dom1.Po1.User1", "createNickname": "true"},
    {"id": "USER.Dom1.Po1.User2"},
    {"id": "RESOURCE.Dom1.Po1.Rsrc1", "resourceOwnerId": "USER.Dom1.Po1.User3"},
    ]
    }

    and of course SDK: www.novell.com/.../b12yq0ty.html


    Use "Verified Answers" if your problem/issue has been solved!

  • 0 in reply to   

    I have to be honest, the documentation, if they tried very hard, could not be more confusing.  For example, in the docs and your example, when we see, for example "id", do they mean the literal word "id" or do they mean the PO ID.  Same with other segments, for example, USER.Dom2.Po1.User1, do they mean to convert to the actual name username.domain.po.username ?!?  It really could not be any more unclear.

    Help me out here.  Lets say I have a user called jsmith who currently resides on a postoffice called GWPO6 and I want to move that user to a postoffice called GWLLPO - how would that info be converted into the command above, or that which is contained in the documentation.

  • Verified Answer

    +1   in reply to 

    this works in the lab 

    curl -k --user admin:password -H "Content-Type: application/json" -X POST -d '{"postOfficeId":"POST_OFFICE.newdom.newpo","sources":[{"id":"USER.olddom.oldpo.user1","createNickname":"true"}]}' https://gwserver:9710/gwadmin-service/system/moverequests

    So the first part newdom.newpo is the destination and olddom.oldo.userID is the current location of the the user

    Dont use any other Curl commands but the basics as above until it works

  • 0 in reply to   

    Okay, much appreciated - this is progress!

    When I issue the script, I see this at the command prompt:

    {"succeeded":1,"failed":[]}gwdm1:~ #

    Not sure if that is some sort of error or not.

    After the script executes I can go to the new target PO and watch the progress of this user in the "Move Status" node and ultimately this test user ends up in the "User" node of this target PO. - Mission accomplished -- mostly.

    However, when I check their original source PO, they are no longer listed as a user on that PO, however, they are still listed on that PO in the "group" node, in the group they were originally housed.  However, in that group listing on the original PO, within the group, they are listed as the new target PO.  Ex. 

    jUsersName.NewPO.OurDomain

    Not sure what this means.  If that group is tied to the original PO, as it appears it is, I guess I would prefer that the target user no longer remain in a group tied to the original PO, if for no other reason than cleanliness.

    Should I be concerned about this AND/OR is there a way in this process to remove the user from that group as well?  I have many users to move and I would prefer that the users NOT end up both on the NewPO and remain in a group on the OldPO.

  • Verified Answer

    +1   in reply to 

    As you see in the move status the command line result means it worked 

    groups are different objects and not moved when a user is moved, the group members can be on different PO's and this should reflect moved users as well so the user should show as u.p.d meaning user.po.domain and mail is routed to this when the group is used

  • 0 in reply to   

    I figured it was something like that.  If desired, is there some additional code that can be added to the command to also remove the user from the group?

  • Verified Answer

    +1   in reply to 

    If you want you can remove users from the memberlist of a Group with the REST API


    curl -k --user admin:novell -X DELETE https://gwserver:9710/gwadmin-service/domains/DOMAIN_NAME/postoffices/GROUP_PO/groups/GROUPNAME/members/GROUP.DOMAIN_NAME.GROUP_PO.userid-to-remove

    Replace this with your info

    domain_name

    group_po

    groupname

    userid-to-remove

    Examples are in the docu as well