View on GitHub

Palo Alto powershell

Download this project as a .zip file Download this project as a tar.gz file

Get-PaConnectionString

Synopsis

Connects to a Palo Alto firewall and returns an connection string with API key.

Syntax

Get-PaConnectionString [-Address] <String> [-Cred] <PSCredential> [<CommonParameters>]

Description

PARAMETERS

Parameters

-Address <String>

Specifies the IP or FQDN of the system to connect to.

Requiredtrue
Position1
Default Value
Accept pipeline inputfalse
Accept wildcard charactersfalse

-Cred <PSCredential>

Specifiy a PSCredential object, If no credential object is specified, the user will be prompted.

Requiredtrue
Position2
Default Value
Accept pipeline inputfalse
Accept wildcard charactersfalse

Example 1

C:\PS>Connect-Pa 192.168.1.1
    
    
    https://192.168.1.1/api/?key=LUFRPT1SanJaQVpiNEg4TnBkNGVpTmRpZTRIamR4OUE9Q2lMTUJGREJXOCs3SjBTbzEyVSt6UT01
    
          c:\PS> $global:PaConnectionArray
    
          ConnectionString                 ApiKey                           Address
          ----------------                 ------                           -------
          https://10.10.42.72/api/?key=... LUFRPT1SanJaQVpiNEg4TnBkNGVpT... 10.10.42.72

Example 2

C:\PS>Connect-Pa -Address 192.168.1.1 -Cred $PSCredential
    
    
    https://192.168.1.1/api/?key=LUFRPT1SanJaQVpiNEg4TnBkNGVpTmRpZTRIamR4OUE9Q2lMTUJGREJXOCs3SjBTbzEyVSt6UT01