def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4661,
            event.deep_get("ObjectType", default="") in ["SAM_USER", "SAM_GROUP"],
            any(
                [
                    any(
                        [
                            event.deep_get("ObjectName", default="").endswith("-512"),
                            event.deep_get("ObjectName", default="").endswith("-502"),
                            event.deep_get("ObjectName", default="").endswith("-500"),
                            event.deep_get("ObjectName", default="").endswith("-505"),
                            event.deep_get("ObjectName", default="").endswith("-519"),
                            event.deep_get("ObjectName", default="").endswith("-520"),
                            event.deep_get("ObjectName", default="").endswith("-544"),
                            event.deep_get("ObjectName", default="").endswith("-551"),
                            event.deep_get("ObjectName", default="").endswith("-555"),
                        ]
                    ),
                    "admin" in event.deep_get("ObjectName", default=""),
                ]
            ),
            not event.deep_get("SubjectUserName", default="").endswith("$"),
        ]
    ):
        return True
    return False
