def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\schtasks.exe"),
            "/Create" in event.deep_get("CommandLine", default=""),
            "/RU" in event.deep_get("CommandLine", default=""),
            "/TR" in event.deep_get("CommandLine", default=""),
            "C:\\Users\\" in event.deep_get("CommandLine", default=""),
            "\\AppData\\Local\\" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "NT AUT" in event.deep_get("CommandLine", default=""),
                    " SYSTEM " in event.deep_get("CommandLine", default=""),
                ]
            ),
            not all(
                [
                    "\\AppData\\Local\\Temp\\" in event.deep_get("ParentImage", default=""),
                    "TeamViewer_.exe" in event.deep_get("ParentImage", default=""),
                    event.deep_get("Image", default="").endswith("\\schtasks.exe"),
                    "/TN TVInstallRestore" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
