Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
ScottG67
Participant

Publish and install

Hello All,

I have been working with the Powershell module for Checkpoint (psCheckPoint) I have the following code configured so far:

 

$Session = Open-CheckPointSession -ManagementServer <ServerNameHere> -Credentials (Get-Credential)  -SessionTimeout 3600 -SessionComments "Testing API additions"
 
Import-Csv D:\temp\FirewallHosts.csv -OutVariable Hosts
New-CheckPointGroup -Name "GroupNameHere" -Comments "GroupCommentsHere" -Session $Session
Foreach ($newHost in $Hosts){
$name = $newHost.name
$ip = $newHost.Ip

New-CheckPointHost -IPv4Address $ip -Name $name -Comments "HostCommentsHere" -Session $Session

}
 
$MHosts = $hosts.Name
 
Set-CheckPointGroup -Group "GroupNameHere" -Members $MHosts
 
Publish-CheckPointSession -Session $Session -Verbose
 
Install-CheckPointPolicy -PolicyPackage <FirewallPolicyName> -Access -Verbose -Session $Session
 
Everything works except for the publish and then the install. I do not get any response from the publish however when I run the install I get the following error:
 
Install-CheckPointPolicy: Runtime error: This operation cannot be done when unpublished changes are present. The current session contains 1 unpublished changes.
 
I do have a cluster of firewalls and I don't think that should make a difference but it might. Anyway and help on this would be fantastic.
 
Thanks,
Scott
 
0 Kudos
2 Replies
PhoneBoy
Admin
Admin

Publish is an asynchronous operation.
You must monitor the task-id returned by the publish API call for completion.

See: https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/publish~v1.8%20
and: https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-task~v1.8%20 

ScottG67
Participant

Sorry for the late reply; am I to understand that the publish and install cmdlets listed in the Powershell module listed here  do not work? I was able to get the publish to work if I included the -ContinueSessionInSmartconsole with the close-CheckpointSession. It seems to me that tkoopman has put a lot of effort into this project so I must be missing something here. 

0 Kudos