Code Monkey home page Code Monkey logo

powershell-psat's Introduction

Tests

PowerShell-PSAT

A PowerShell module to interact with the Proofpoint Security Awareness Training reporting API.

Installing this module

This module is available in PowerShell Gallery:

PS C:\> Install-Module PSPsat

Or, download it from here and save all of the files somewhere in your $PSModulePath.

Before you start

To get started with this module, you will need to log into your PSAT dashboard and create a new API token. It's under Company Settings > API Tokens. Take note of that token. You will not see it again in the dashboard.

Then, in your PowerShell session, teach it your secrets with Connect-Psat.

PS C:\> Connect-Psat -ApiToken "TF4STGMDR4H7AEXAMPLE"

You will be prompted to save the token into your user profile for later use.

Using the module

Now that that's been done, start using their API!

Users

You can look up users information with the Get-PsatUsers cmdlet. With no arguments, it returns a list of all customers. You can also use the -UserEmailAddress parameter to fetch a specific users. By default, the API will return only the first 20 users and the response is paginated. You can specify the PageSize and PageNumber to pinpoint your searches.

By default, the response will be a PSCustomObject.

PS C:\> Get-PsatUsers

useremailaddress : ex-amohsni@test.com
userfirstname    : Abdel
userlastname     : Mohsni
userlocale       : default
usertimezone     : America/New_York
useractiveflag   : True
userdeleteddate  :
datalastupdated  : 2023-07-08 8:32:17 PM
usertags         :
sso_id           : Unknown
id               : 1
type             : fn_user_v1

You can get the raw response by adding the -FormatJson parameter.

PS C:\> Get-PsatUsers -FormatJson

{
  "data": [
    {
      "type": "fn_user_v1",
      "id": 1,
      "attributes": {
        "useremailaddress": "[email protected]",
        "userfirstname": "Abdel",
        "userlastname": "Mohsni",
        "userlocale": "default",
        "usertimezone": "America/New_York",
        "useractiveflag": true,
        "userdeleteddate": null,
        "datalastupdated": "2023-07-08T20:32:17.840352-04:00",
        "usertags": null,
        "sso_id": "Unknown"
      }
    }]
}

What else can I do?

There is plenty of help to read. Get started here

powershell-psat's People

Contributors

regg00 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.