AnsweredAssumed Answered

User management with mgmt_cli.exe

Question asked by Jeremy Parker on Feb 7, 2019
Latest reply on Feb 8, 2019 by Joshua Hatter

Hello,
I'm trying to write a simple powershell toolbox to help us manage some of our more manual tasks with checkpoint. Mainly user related.

We are currently running 80.20

 

 

I'm able to query users through from mgmt_cli via show objects, this lets me see expiring users

 

 

$temp = .\mgmt_cli.exe show objects limit 500 offset 0 order.1.ASC "name" in.1 "name" in.2 "userprefix*" type "object" details-level full -m servername --format json --session-id $sid
$all = $temp | ConvertFrom-Json

    foreach($acc in $all.objects){
        if(HasProperty $acc "expirationdate"){
            try{
                $expdate = [datetime]::Parse($acc.expirationdate)
            } catch {
                write-host ("date error for record: " + $acc.name)
            }
            *Play with or return user details here*

        }
    }

 

I'm hoping to be able to change users expiry dates, create new users, add users to groups etc.
Is this possible through mgmt_cli?

Are there better ways to do this that can be done from powershell?
I have a vague assumption from reading through other threads that it's going to involve generic-objects but I'm not sure how to properly use them.

 

Thanks =]

Outcomes