tacticalrmm/_modules/get_services.py

11 lines
250 B
Python
Raw Normal View History

2019-10-22 22:22:36 +00:00
from __future__ import absolute_import
import psutil
def get_services():
try:
svc = [x.as_dict() for x in psutil.win_service_iter()]
except Exception:
svc = {"error": "error getting services"}
finally:
return svc