def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4697,
            "cmd" in event.deep_get("ServiceFileName", default=""),
            '"set' in event.deep_get("ServiceFileName", default=""),
            "-f" in event.deep_get("ServiceFileName", default=""),
            any(
                [
                    "/c" in event.deep_get("ServiceFileName", default=""),
                    "/r" in event.deep_get("ServiceFileName", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
