From 3a4ffc17359edb8bb9577b4c30d7766fe9ad6a90 Mon Sep 17 00:00:00 2001 From: wh1te909 <7434746+wh1te909@users.noreply.github.com> Date: Thu, 9 May 2024 23:50:14 +0000 Subject: [PATCH] add deleting user from django shell --- docs/management_cmds.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/management_cmds.md b/docs/management_cmds.md index d8d2dcbb..25373a54 100644 --- a/docs/management_cmds.md +++ b/docs/management_cmds.md @@ -56,6 +56,13 @@ python manage.py reset_password python manage.py reset_2fa ``` +### Delete a User +```python +python manage.py shell +from accounts.models import User +User.objects.get(username="changeme").delete() +``` + ### Find All Agents That Have X Software Installed ```bash @@ -70,7 +77,8 @@ python manage.py find_services "quickbooks" ### Set a Specific Windows Update to not Install -```bash +```python +python manage.py shell from winupdate.models import WinUpdate WinUpdate.objects.filter(kb="KB5007186").update(action="ignore", date_installed=None) ``` @@ -89,7 +97,7 @@ python manage.py delete_tokens ### Reset All Auth Tokens for Install Agents and Web Sessions -```bash +```python python manage.py shell from knox.models import AuthToken AuthToken.objects.all().delete()