Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

DELETE_DEVICE_IF_NO_MEDIA_CONTROLS not working with 10.9.7 #30

Open
vortex91 opened this issue Jul 14, 2024 · 4 comments
Open

DELETE_DEVICE_IF_NO_MEDIA_CONTROLS not working with 10.9.7 #30

vortex91 opened this issue Jul 14, 2024 · 4 comments

Comments

@vortex91
Copy link

vortex91 commented Jul 14, 2024

seems like all is working per design except clients which do not have media controls. I'm running on 10.9.7

one suggestion instead of killing the device is to disable the user. In admin GUI each user has disable function.

@WardPearce
Copy link
Owner

Yea knowm issue that some clients can't be stop annoying

@vortex91
Copy link
Author

vortex91 commented Jul 14, 2024

So why not just disable user via API and then re-enable? this way no need to kill client. Disable user via API automaticaly kicks users client device offline.

menu-dashboard-users->select user-profile-disable user check box. I'm checking API will post back once I find it there.

I think post in /users should work

"IsDisabled": true,

@WardPearce
Copy link
Owner

feel free to make a PR, otherwise I'll look into this whenever I'm free

@vortex91
Copy link
Author

I ended up writing a separate script which does a bit more of what I need. However this part might come in handy if you wanted it for your scirpt

    # Fetch user profile
    profile_url = f"{base_url}/Users/{user['user_id']}?api_key={api_key}"
    profile_response = requests.get(profile_url)
    profile_data = profile_response.json()

    # Prepare data for disabling user
    disable_data = profile_data['Policy']
    disable_data["IsDisabled"] = True

    disable_url = f"{base_url}/Users/{user['user_id']}/Policy?api_key={api_key}"
    disable_response = requests.post(disable_url, json=disable_data)

    if disable_response.status_code == 204:
        print(f"Disabled user: {user_name}")
    else:
        print(f"Failed to disable user: {user_name} (Status Code: {disable_response.status_code})")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants