def rule(event):
    if any(
        [
            all(
                [
                    any(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\net.exe"),
                                    event.deep_get("Image", default="").endswith("\\net1.exe"),
                                ]
                            ),
                            event.deep_get("OriginalFileName", default="")
                            in ["net.exe", "net1.exe"],
                        ]
                    ),
                    "/add" in event.deep_get("CommandLine", default=""),
                    "/domain" in event.deep_get("CommandLine", default=""),
                    "ESX Admins" in event.deep_get("CommandLine", default=""),
                    "group" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    any(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\PowerShell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                            event.deep_get("OriginalFileName", default="")
                            in ["PowerShell.exe", "pwsh.dll"],
                        ]
                    ),
                    "New-ADGroup" in event.deep_get("CommandLine", default=""),
                    "ESX Admins" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
