DHCP Server on Palo Alto

Showing results for 
Search instead for 
Did you mean: 

DHCP Server on Palo Alto

L2 Linker

The DHCP server on Palo Alto does not clear the Expired sessions, its stays and we have to manually go and clear the sessions.


Can you please help.



Specifically it would look like the following if I didn't specify an interface; then you just need to schedule it with task sheduler to actually run the powershell command at a set interval.


$netAssembly = [Reflection.Assembly]::GetAssembly([System.Net.Configuration.SettingsSection])

    $bindingFlags = [Reflection.BindingFlags] "Static,GetProperty,NonPublic"
    $settingsType = $netAssembly.GetType("System.Net.Configuration.SettingsSectionInternal")

    $instance = $settingsType.InvokeMember("Section", $bindingFlags, $null, $null, @())

        $bindingFlags = "NonPublic","Instance"
        $useUnsafeHeaderParsingField = $settingsType.GetField("useUnsafeHeaderParsing", $bindingFlags)

          $useUnsafeHeaderParsingField.SetValue($instance, $true)
$OutputFile = "$($env:USERPROFILE)\Desktop\CommandStatus.xml"
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$wc = New-Object System.Net.WebClient
$src=$wc.DownloadString("<clear><dhcp><lease><all><expired-only></expired-only></all></...REPLACEWITHYOURKEY| Out-File $OutputFile

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!