Commit 8319b600 authored by Sébastien's avatar Sébastien

quser pour windows

parent a29c08e0
......@@ -111,11 +111,19 @@ def get_users_linux():
users = f"{nb}"
except Exception:
users = "?"
LOG.debug(f"utilisateurs connectés: {nb}")
return users
def get_users_windows():
# commande "quser" ?
return "?"
try:
out = subprocess.run(["quser"], stdout=subprocess.PIPE)
txt = out.stdout.decode()
nb = txt.count("Actif")
users = f"{nb}"
except Exception:
users = "?"
LOG.debug(f"utilisateurs connectés: {nb}")
return users
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment