Hi,
i want to switch (Enable/Disable) a Networkrule with powershell.
A call with browser is working but i want it directly (the browser-cache is anoying).
$firewall = "firewall-fqdn:4444"
$request = @"
<Login><UserName>api-admin</UserName>
<Password passwordform=""encrypt"">api-key</Password></Login>
<Set operation=""update"">
<SecurityPolicy transactionid="""">
<Name>Lucy -> Any ALL (TEMP)</Name>
<Description/>
<IPFamily>IPv4</IPFamily>
<Status>Enable</Status>
<Position>After</Position>
<PolicyType>Network</PolicyType>
<After>
<Name>Tiger2 ANY -> Internet</Name>
</After>
<SourceZones>
<Zone>LAN</Zone>
</SourceZones>
<Schedule>All The Time</Schedule>
<Action>Accept</Action>
<LogTraffic>Enable</LogTraffic>
<MatchIdentity>Disable</MatchIdentity>
<SourceNetworks>
<Network>Lucy</Network>
</SourceNetworks>
<DSCPMarking>-1</DSCPMarking>
<ApplicationControl>None</ApplicationControl>
<ApplicationBaseQoSPolicy>Revoke</ApplicationBaseQoSPolicy>
<WebFilter>None</WebFilter>
<WebCategoryBaseQoSPolicy>Revoke</WebCategoryBaseQoSPolicy>
<IntrusionPrevention>None</IntrusionPrevention>
<TrafficShappingPolicy>None</TrafficShappingPolicy>
<ApplyNAT>CustomNatPolicy</ApplyNAT>
<OverrideGatewayDefaultNATPolicy>Disable</OverrideGatewayDefaultNATPolicy>
<PrimaryGateway/>
<OutboundAddress>MASQ</OutboundAddress>
<BackupGateway/>
<ScanHTTP>Disable</ScanHTTP>
<ScanHTTPS>Disable</ScanHTTPS>
<Sandstorm>Disable</Sandstorm>
<BlockQuickQuic>Disable</BlockQuickQuic>
<ScanFTP>Disable</ScanFTP>
<SourceSecurityHeartbeat>Disable</SourceSecurityHeartbeat>
<MinimumSourceHBPermitted>No Restriction</MinimumSourceHBPermitted>
<DestSecurityHeartbeat>Disable</DestSecurityHeartbeat>
<MinimumDestinationHBPermitted>No Restriction</MinimumDestinationHBPermitted>
</SecurityPolicy>
</Set>
"@
start "https://$firewall/webconsole/APIController?reqxml=<Request>$request</Request>"
The thing is i have no clue how the command has to be (Invert-WebRequest i think).
Later i want to expand it with variables for adding URLs to web-exceptions.
Can someone help?
Best regards.
This thread was automatically locked due to age.