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

MIT License
6 stars 1 forks source link

Script fails with No Matching Serial Numbers Found #6

Closed Cr4sh0ver1de closed 1 month ago

Cr4sh0ver1de commented 1 month ago

Hi Chris.

I seem to get an error each time i try and run the script and wondering if you could help me identify where i am going wrong?

The output in Jamf for each fail is as follows:

Script result: 2024-06-24 19:38:24 - PRE-FLIGHT CHECK: swiftDialog version 2.5.0.4768 found; proceeding...
2024-06-24 19:39:45 - API Credentials work, invalidating token
2024-06-24 19:39:46 - Test Token Successfully Invalidated
2024-06-24 19:39:46 - Workflow Selected: Static / Smart Group. Password Option: Set your own.
2024-06-24 19:40:09 - Found old csv, deleting now
2024-06-24 19:40:09 - Found old python script, deleting now
number of computers returned:     457
-:10: parser error : Opening and ending tag mismatch: br line 8 and p
</p>
    ^
-:11: parser error : Opening and ending tag mismatch: p line 8 and body
</body>
       ^
-:12: parser error : Opening and ending tag mismatch: body line 5 and html
</html>
       ^
-:12: parser error : Premature end of data in tag html line 1
</html>
       ^
0 serials found in smart group
2024-06-24 19:40:21 - No Matching Serial Numbers Found. Attempted to search 0 serial numbers.

Any ideas?

Thanks!

chrisgzim commented 1 month ago

Hey @Cr4sh0ver1de I think I know exactly what is going on. I was using the deprecated endpoint for getting a bearer token on the Classic API calls.

I have a fix for this in development if you want to give that one a try! https://github.com/chrisgzim/Jamf-API-Recovery-Lock-by-Group/blob/development/swiftdialog_jproapilock.sh

Cr4sh0ver1de commented 1 month ago

@chrisgzim that worked perfectly. Thank You! 🙌

chrisgzim commented 1 month ago

Sweet! I will push this new version to the main! Thank you for your patience!

Cr4sh0ver1de commented 1 month ago

@chrisgzim no problem at all. Thank YOU for the work you do.