Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

MAS Bulk User Modifications?

  • 1.  MAS Bulk User Modifications?

    Posted Mon September 23, 2024 04:24 PM

    Asking a question I pretty much know what the answer will be but here goes...

    Is there any way to modify User Accounts in Bulk in MAS (8 or 9) like we used to be able to do with MxLoader? I am assuming I can still use Mxloader to get at the User record in Manage but that cannot touch the Entitlement settings in MAS correct? Any way to modify user entitlements in Bulk since they in Mongo DB?

    For example I have 82 Users from a Demo install that all need:

    Entitlement upgrade required

    To meet the requirements of the combined access permissions for the Manage application, the current application entitlement needs to be changed to Premium entitlement.
    Any way to do these in bulk? Can any Mongo DB admin be done in bulk at all?

    Appreciate any advice as learning this in my sandbox will help for clients in the future.


    ------------------------------
    David Miller
    Managing Partner - Maximo Consultant
    Enterprise Integration Partners LLC
    ------------------------------


  • 2.  RE: MAS Bulk User Modifications?

    Posted Mon September 23, 2024 04:39 PM

    I guess I forgot to ask can you even CREATE USERS anymore from Outside into Maximo as I assume user creating cant go into the Manage by Mxloader and sync to MAS correct? It must start at MAS and synch to Manage?



    ------------------------------
    David Miller
    Managing Partner - Maximo Consultant
    Enterprise Integration Partners LLC
    ------------------------------



  • 3.  RE: MAS Bulk User Modifications?

    Posted Mon September 23, 2024 04:51 PM

    David,

     

    It doesn't look like there is a way to assign App Points in the API, but many of the user management functions you are asking about can be managed with the MAS Management API.

     

    Documentation can be found here: https://developer.ibm.com/apis/catalog/maximo--maximo-application-suite-admin-apis/api/API--maximo--user-management#setMasUser

     

    Regards,

    Jason






  • 4.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 01:36 AM

    Hi to all,

    I opened a case with IBM and the result is the same than Jason recomended.

    With this link you can force password change:

    https://developer.ibm.com/apis/catalog/maximo--maximo-application-suite-admin-apis/api/API--maximo--user-management#forcePasswordChange

    Whit this link you can change MAS User Pass:

    https://developer.ibm.com/apis/catalog/maximo--maximo-application-suite-admin-apis/api/API--maximo--user-management#changeMasUserPass

    SINTAX: https://api.{mas-instance-id}.{mas-domain}/v3/users/{userId}/forcepasswordchange

    But at the moment I couldn't work succesfull. It show this message error:

    {"exception":{"id":"AIUCO1999E","properties":["405 Method Not Allowed: The method is not allowed for the requested URL."]},"message":"AIUCO1999E: Internal Server Error: 405 Method Not Allowed: The method is not allowed for the requested URL.","uuid":"5ca6b219-de28-4c42-b168-b89f31dc0446"}

    The case is still open

    Regards,

    Flores



    ------------------------------
    Flores Gallegos Romero
    ------------------------------



  • 5.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 01:45 AM

    Hi Flores
    The http response code 405 indicates that you are using a http method (GET, POST, etc.) that is not allowed.
    How do you send the request?
    Make sure that you are using the PUT method as shown in the documentation.
    Regards Dirk



    ------------------------------
    Dirk Huppertz
    Senior Project Manager
    S&T Deutschland GmbH
    Aachen
    ------------------------------



  • 6.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 01:56 AM

    Hi Dirk,

    I forget insert the message with a PUT request (soapUI)

    NOTE. I insert these headers too

      --header 'accept: application/json' \
    4  --header 'content-type: application/json' \
    5  --header 'x-access-token: REPLACE_THIS_VALUE' \
    HTTP/1.1 400 BAD REQUEST
    server=nginx
    date=Tue, 24 Sep 2024 05:55:49 GMT
    content-type=application/json
    content-length=325
    cache-control=no-store
    pragma=no-cache
    content-security-policy=default-src 'none'
    
    {"exception":{"id":"AIUCO1000E","properties":[]},"message":"AIUCO1000E: The request was not valid. Review the constraint violations provided [1 violations]","uuid":"bf38144d-a579-4f13-9d68-203a67c46e1f","violations":[{"exception":{"id":"AIUCO2008E","properties":[[[]]]},"message":"AIUCO2008E: Invalid input violation: []"}]}

    Regards,

    Flores



    ------------------------------
    Flores Gallegos Romero
    ------------------------------



  • 7.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 02:08 AM
    Edited by Dirk Huppertz Tue September 24, 2024 02:08 AM

    Hi Flores,

    I assume that you replaced the "REPLACE_THIS_VLAUE" in the x-access-token with your real apiKey, right?

    How does the http request body look like?
    There are three required fields: currentToken, token and oneTimeCode.
    It should look like the example in the docs:
    {
      "currentToken": "b0089e60eb960c151a22c9eb31d18659f0c07944828fdc7bfc6271b78614d106",
      "token": "5c4c68b98c6fbfd863f99560a98563fd8b617c55d729b588e6be32e9291f7ae6",
      "oneTimeCode": "22:31"
    }

    Regards
    Dirk







  • 8.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 03:42 AM

    Hi Dirk,

    Yes , I replaced the "REPLACE_THIS_VALUE" in the  x-access-token with my real apiKey.

    But in the documentation (https://developer.ibm.com/apis/catalog/maximo--maximo-application-suite-admin-apis/api/API--maximo--user-management#forcePasswordChange), the required in header are this:

    x-access - token
    Content-type - application/json
    And required in parameters are:
    userId - MAS Username
    Look likes this screen capture

    We have in this environment 2000 users for update the password after migrated from Maximo 7.6.1.2 and this fix is not my prefer but I will try.
    Regards
    Flores


    ------------------------------
    Flores Gallegos Romero
    ------------------------------



  • 9.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 04:02 AM

    Hi Flores
    there is also a request body in the documentation:



    Regards Dirk



    ------------------------------
    Dirk Huppertz
    Senior Project Manager
    S&T Deutschland GmbH
    Aachen
    ------------------------------



  • 10.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 10:53 AM

    Hi Dirk,

    If I detail the request body the result is this:

    {
       "exception":    {
          "id": "AIUCO1029E",
          "properties": []
       },
       "message": "AIUCO1029E: Failed to update password. The request may be invalid or something may have gone wrong. Try again or contact your administrator if the issue persists.",
       "uuid": "5bc78663-27ae-4476-8103-7ea7bf894895"
    }

    Regards

    Flores



    ------------------------------
    Flores Gallegos Romero
    ------------------------------



  • 11.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 02:24 AM

    Hi,

    You can use 'import users' functionality to modify the current ones. The one issue is: You cannot export the current users this way. As long as the user id matches existing user, this record will get updated. The 'import users' functionality is available in Admin UI, under Users:

    If You have direct access to MongoDB You can also modify the data in there. The following query needs to be run on mas_<instanceName>_core database. It finds all users with ids in the list, changes the user type to Premium and forces sync with Manage. Remember to change the Workspace id in the query.

    db.User.find({
      _id: { $in: ["xxxx", "yyyyy", "zzzz"] }
    }).forEach(function(doc) {
       var currentDate = new Date();
       var year = currentDate.getFullYear();
       var month = String(currentDate.getMonth() + 1).padStart(2, '0');
       var day = String(currentDate.getDate()).padStart(2, '0');
       var hour = String(currentDate.getHours()).padStart(2, '0');
       var minute = String(currentDate.getMinutes()).padStart(2, '0');
       var second = String(currentDate.getSeconds()).padStart(2, '0');
       var millisecond = String(currentDate.getMilliseconds()).padStart(3, '0');
       var currentDateAsString = `${year}-${month}-${day}T${hour}:${minute}:${second}.${millisecond}`;
       db.User.updateOne(
          { _id: doc._id },
          {
           $set: {
               "updated.timestamp": currentDateAsString,
               "sync.status": "PENDING",
               "sync.timestamp": currentDateAsString,
               "entitlement.application": "PREMIUM",
               "applications.manage.sync.state": "PENDING",
               "applications.manage.sync.timestamp": currentDateAsString,
     
               "workspaces": {
                "<mas workspace name>": {
                  "permissions": {
                    "workspaceAdmin": false
                  },
                  "applications": {
                    "manage": {
                      "role": "MANAGEUSER"
                    }
                  }
                }
              },
           }
       }
      );
    });


    ------------------------------
    Witold Wierzchowski
    Solution Architect
    Cohesive Poland
    ------------------------------



  • 12.  RE: MAS Bulk User Modifications?

    Posted Tue September 24, 2024 04:17 AM

    Hi all,
    to become more familiar with the mongodb I have deployed "Mongo Express" into my OpenShift Cluster.

    https://github.com/mongo-express/mongo-express

    Mongo Express is a "web-based MongoDB admin interface written with Node.js, Express, and Bootstrap 5".
    It makes it a little easier to take a look around in the mongo database.




    Regards Dirk



    ------------------------------
    Dirk Huppertz
    Senior Project Manager
    S&T Deutschland GmbH
    Aachen
    ------------------------------