Open vortex91 opened 2 months ago
Yea knowm issue that some clients can't be stop annoying
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,
feel free to make a PR, otherwise I'll look into this whenever I'm free
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})")
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.