Azure Pipelines | PowerShell Gallery | Github |
---|---|---|
A PowerShell module for administering and automating your Okta org. It leverages the official Okta .Net SDK, but is unofficial and is not supported by Okta in any way. Runs on Windows PowerShell or cross-platform on PowerShell Core for Windows, Mac and Linux.
Windows PowerShell v5.1 PowerShell Core 6+ (Linux, Mac, or Windows)
In a PowerShell console run Install-Module Okta
and confirm that you'd like to install the module. Once installed, you can import the module by running Import-Module Okta
.
In order to make calls against the Okta API, you'll need to generate an API token in the administrator console. Instructions for this can be found here. Keep in mind that this token will only be granted the same administrative privileges as the account that created it. Some commands in this module may not work properly if your API token does not have permission to perform some actions.
Connect-Okta -OktaDomain https://myorg.okta.com -ApiToken "00wc414Z6FMkJyLnXTPfQTl3JpeiFniYa8j4avjVPe"
Get-OktaConnection
Disconnect-Okta
Or you can simply remove or re-import the module.
Get-OktaUser -Identity jlannister
Get-OktaUser -Filter 'status eq "ACTIVE"'
Get-OktaApp -All
Get-OktaUser -Filter 'status eq "ACTIVE"'
Get-OktaLogEvent -StartDate 6/1/2019
You can find other commands to explore and manage groups, roles, events and more by running Get-Command -Module Okta
.