def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\schtasks.exe"),
            any(
                [
                    "/delete" in event.deep_get("CommandLine", default=""),
                    "/change" in event.deep_get("CommandLine", default=""),
                ]
            ),
            "/TN" in event.deep_get("CommandLine", default=""),
            "\\Microsoft\\Windows\\Defrag\\ScheduledDefrag"
            in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
