chrisgzim / Jamf-API-Recovery-Lock-by-Group

MIT License
7 stars 2 forks source link

There was a problem returning information from the computer group you selected #14

Open joshnovotny opened 4 days ago

joshnovotny commented 4 days ago

Hello,

Getting this error when running the version of the "lazy" script you pushed out this morning:

Screenshot 2024-10-30 at 2 23 56 PM

I am for sure choosing a smart group as seen here:

Screenshot 2024-10-30 at 2 22 25 PM

But still returning that error. There are 12 computers in that group and all of them are managed.

chrisgzim commented 4 days ago

Hey @joshnovotny,

I am going to do some testing today. This looks like you're doing the Computer Group ID > Static Password option. I may have missed something with that workflow. . . so I will see what I can find!

chrisgzim commented 4 days ago

Hey @joshnovotny,

I believe I have identified the issue here. The problem is I cannot get the RSQL query to work properly for general.remoteManagement.managed. Therefore it is returning ALL computers in that request -- even those no longer "managed".

What happens is if I put in I have 2000 managed computers but I have 3000 total inventory records there is going to be a fringe group that won't be found. (Chances are all of the serials in the group you're sending the command to weren't returned in the original GET for their managementID.)

As a temporary workaround, can you put an absurdly large number in the "Number of Computers" field?

I will put in some logic that will stop searching after it returns zero results in an update -- and just get rid of that field all together (since it wasn't really clear what that field was for).

I will also keep working on the "on-demand" workflow. Trying to have a way to be able to grab the management ID regardless if you put serial or JSS ID.

chrisgzim commented 4 days ago

Hey @joshnovotny

Would you try this version of the script? I can push it to main if this works more consistently?

https://github.com/chrisgzim/Jamf-API-Recovery-Lock-by-Group/blob/development/swiftdialog_jproapilock.sh

joshnovotny commented 4 days ago

@chrisgzim Same group ID error with that version.

chrisgzim commented 4 days ago

@joshnovotny can you hit me up on Mac Admin's Slack. I am honestly stuck since I haven't been able to replicate in my testing. OR email me

chrisgzim commented 3 days ago

Just pushed out a new update of the development branch -- replaced the python and plutil commands to be jq instead. If you want to give that a try!

joshnovotny commented 3 days ago

Hey Chris, that got 3 out of 11 computers.

jq: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 2, column 8 -e 2024-11-01 09:41:56 - number of computers returned: 1000

Should be a lot more than 1000 computers.