löschen mehrerer User und Gruppen gleichzeitig, wie ?

StefanSa

New Member
Feb 13, 2022
2
0
1
63
Hallo zusammen,
nach einem ldap sync möchten wir überflüssige User und Gruppen löschen.
Da diese etliche sind, wäre es gut wenn dies gehen würde -> "pveum group delete *" oder "pveum group delete AB-*", dies funktioniert leider nicht.
Frage, wie lösche ich viele User und Gruppen auf einmal, hat da ev. jemand Idee oder einen script ?

Danke schon mal im Voraus.
Gruß
StefanSa
 
hi,

installiere jq: apt install jq (fuer json parsing)

loesche alle groups: pveum group list --output-format json | jq -r '.[].groupid' | while read grp; do pveum group delete $grp; done

alle user: pveum user list --output-format json | jq -r '.[].userid' | while read usr; do pveum user delete $usr; done

(root@pam wird nicht geloescht)

falls du weitere filter brauchst, kann man ein grep dazu geben, vor der while loop
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!