def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 5145,
            "\\winreg" in event.deep_get("RelativeTargetName", default=""),
            not event.deep_get("IpAddress", default="") == "%Admins_Workstations%",
        ]
    ):
        return True
    return False
