The domain is only relevant on and is specified as part of the login call.
In all other cases, the session ID is sufficient.
In this case, I am piping the output out the login call to sid.txt so it can be read by subsequent calls (-s sid.txt).
Using the CSV file you provided, the following commands worked on my system:
mgmt_cli -r true -s 'System Data' > sid.txt
mgmt_cli -s sid.txt add administrator -b admins.csv
mgmt_cli -s sid.txt publish
The publish is required for committing any changes made through the API.
Otherwise, the changes will be locked in the created session until it is published or discarded.
Here is the result the API provided when I queried the user:
[Expert@R82-EA1:0]# mgmt_cli -s sid.txt show administrator name sayooj --format json
{
"uid" : "1bb02495-4e3e-4c0e-9660-e2bc52224d5a",
"name" : "sayooj",
"type" : "administrator",
"domain" : {
"uid" : "a0eebc99-afed-4ef8-bb6d-fedfedfedfed",
"name" : "System Data",
"domain-type" : "mds"
},
"email" : "",
"phone-number" : "",
"authentication-method" : "check point password",
"must-change-password" : true,
"permissions-profile" : {
"uid" : "ff2c8363-eedd-4d06-a140-a2ede779f09e",
"name" : "Super User",
"type" : "domain-permissions-profile",
"domain" : {
"uid" : "a0bbbc99-adef-4ef8-bb6d-defdefdefdef",
"name" : "Check Point Data",
"domain-type" : "data domain"
},
"icon" : "General/Role",
"color" : "black"
},
"sic-name" : "",
"comments" : "",
"color" : "black",
"icon" : "General/Administrator",
"tags" : [ ],
"meta-info" : {
"lock" : "unlocked",
"validation-state" : "ok",
"last-modify-time" : {
"posix" : 1725486662429,
"iso-8601" : "2024-09-04T16:51-0500"
},
"last-modifier" : "WEB_API",
"creation-time" : {
"posix" : 1725486662429,
"iso-8601" : "2024-09-04T16:51-0500"
},
"creator" : "WEB_API"
},
"read-only" : false,
"available-actions" : {
"edit" : "true",
"delete" : "true",
"clone" : "true"
}
}
[Expert@R82-EA1:0]#