Skip to content

Latest commit

 

History

History
1078 lines (758 loc) · 39.2 KB

OktaGroupApi.md

File metadata and controls

1078 lines (758 loc) · 39.2 KB

Okta.PowerShell.Okta.PowerShell\Api.OktaGroupApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
Invoke-OktaActivateGroupRule POST /api/v1/groups/rules/{ruleId}/lifecycle/activate Activate a Group Rule
Add-OktaGroupOwner POST /api/v1/groups/{groupId}/owners Assign a Group Owner
Add-OktaUserToGroup PUT /api/v1/groups/{groupId}/users/{userId} Assign a User
New-OktaGroup POST /api/v1/groups Create a Group
New-OktaGroupRule POST /api/v1/groups/rules Create a Group Rule
Invoke-OktaDeactivateGroupRule POST /api/v1/groups/rules/{ruleId}/lifecycle/deactivate Deactivate a Group Rule
Invoke-OktaDeleteGroup DELETE /api/v1/groups/{groupId} Delete a Group
Invoke-OktaDeleteGroupOwner DELETE /api/v1/groups/{groupId}/owners/{ownerId} Delete a Group Owner
Invoke-OktaDeleteGroupRule DELETE /api/v1/groups/rules/{ruleId} Delete a group Rule
Get-OktaGroup GET /api/v1/groups/{groupId} List all Group Rules
Get-OktaGroupOwners GET /api/v1/groups/{groupId}/owners List all Owners
Get-OktaGroupRule GET /api/v1/groups/rules/{ruleId} Retrieve a Group Rule
Invoke-OktaListAssignedApplicationsForGroup GET /api/v1/groups/{groupId}/apps List all Assigned Applications
Invoke-OktaListGroupRules GET /api/v1/groups/rules List all Group Rules
Invoke-OktaListGroupUsers GET /api/v1/groups/{groupId}/users List all Member Users
Invoke-OktaListGroups GET /api/v1/groups List all Groups
Remove-OktaUserFromGroup DELETE /api/v1/groups/{groupId}/users/{userId} Unassign a User
Update-OktaGroup PUT /api/v1/groups/{groupId} Replace a Group
Update-OktaGroupRule PUT /api/v1/groups/rules/{ruleId} Replace a Group Rule

Invoke-OktaActivateGroupRule

void Invoke-OktaActivateGroupRule
        [-RuleId]

Activate a Group Rule

Activates a specific group rule by id from your organization

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$RuleId = "MyRuleId" # String | 

# Activate a Group Rule
try {
    $Result = Invoke-OktaActivateGroupRule -RuleId $RuleId
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaActivateGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
RuleId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Add-OktaGroupOwner

GroupOwner Add-OktaGroupOwner
        [-GroupId]
        [-GroupOwner]

Assign a Group Owner

Assigns a group owner for a specific group.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$GroupOwner = Initialize-GroupOwner -DisplayName "MyDisplayName" -Id "MyId" -LastUpdated (Get-Date) -OriginId "MyOriginId" -OriginType "APPLICATION" -Resolved $false -Type "GROUP" # GroupOwner | 

# Assign a Group Owner
try {
    $Result = Add-OktaGroupOwner -GroupId $GroupId -GroupOwner $GroupOwner
} catch {
    Write-Host ("Exception occurred when calling Add-OktaGroupOwner: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
GroupOwner GroupOwner

Return type

GroupOwner (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Add-OktaUserToGroup

void Add-OktaUserToGroup
        [-GroupId]
        [-UserId]

Assign a User

Adds a user to a group with 'OKTA_GROUP' type.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$UserId = "MyUserId" # String | 

# Assign a User
try {
    $Result = Add-OktaUserToGroup -GroupId $GroupId -UserId $UserId
} catch {
    Write-Host ("Exception occurred when calling Add-OktaUserToGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
UserId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

New-OktaGroup

Group New-OktaGroup
        [-Group]

Create a Group

Adds a new group with OKTA_GROUP type to your organization.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$HrefObjectHints = Initialize-HrefObjectHints -Allow "DELETE"
$HrefObject = Initialize-HrefObject -Hints $HrefObjectHints -Href "MyHref" -Name "MyName" -Type "MyType"

$GroupLinks = Initialize-GroupLinks -Apps $HrefObject -Logo $HrefObject -Self $HrefObject -Source $HrefObject -Users $HrefObject

$Group = Initialize-Group -Created (Get-Date) -Id "MyId" -LastMembershipUpdated (Get-Date) -LastUpdated (Get-Date) -ObjectClass "MyObjectClass" -VarProfile  -Type "APP_GROUP" -Embedded @{ key_example =  } -Links $GroupLinks # Group | 

# Create a Group
try {
    $Result = New-OktaGroup -Group $Group
} catch {
    Write-Host ("Exception occurred when calling New-OktaGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
Group Group

Return type

Group (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

New-OktaGroupRule

GroupRule New-OktaGroupRule
        [-GroupRule]

Create a Group Rule

Creates a group rule to dynamically add users to the specified group if they match the condition

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupRuleGroupAssignment = Initialize-GroupRuleGroupAssignment -GroupIds "MyGroupIds"
$GroupRuleAction = Initialize-GroupRuleAction -AssignUserToGroups $GroupRuleGroupAssignment

$GroupRuleExpression = Initialize-GroupRuleExpression -Type "MyType" -Value "MyValue"

$GroupRuleGroupCondition = Initialize-GroupRuleGroupCondition -Exclude "MyExclude" -Include "MyInclude"
$GroupRuleUserCondition = Initialize-GroupRuleUserCondition -Exclude "MyExclude" -Include "MyInclude"
$GroupRulePeopleCondition = Initialize-GroupRulePeopleCondition -Groups $GroupRuleGroupCondition -Users $GroupRuleUserCondition

$GroupRuleConditions = Initialize-GroupRuleConditions -Expression $GroupRuleExpression -People $GroupRulePeopleCondition

$GroupRule = Initialize-GroupRule -Actions $GroupRuleAction -Conditions $GroupRuleConditions -Created (Get-Date) -Id "MyId" -LastUpdated (Get-Date) -Name "MyName" -Status "ACTIVE" -Type "MyType" # GroupRule | 

# Create a Group Rule
try {
    $Result = New-OktaGroupRule -GroupRule $GroupRule
} catch {
    Write-Host ("Exception occurred when calling New-OktaGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupRule GroupRule

Return type

GroupRule (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaDeactivateGroupRule

void Invoke-OktaDeactivateGroupRule
        [-RuleId]

Deactivate a Group Rule

Deactivates a specific group rule by id from your organization

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$RuleId = "MyRuleId" # String | 

# Deactivate a Group Rule
try {
    $Result = Invoke-OktaDeactivateGroupRule -RuleId $RuleId
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaDeactivateGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
RuleId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaDeleteGroup

void Invoke-OktaDeleteGroup
        [-GroupId]

Delete a Group

Removes a group with OKTA_GROUP type from your organization.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 

# Delete a Group
try {
    $Result = Invoke-OktaDeleteGroup -GroupId $GroupId
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaDeleteGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaDeleteGroupOwner

void Invoke-OktaDeleteGroupOwner
        [-GroupId]
        [-OwnerId]

Delete a Group Owner

Delete a group owner from a specific group.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$OwnerId = "MyOwnerId" # String | 

# Delete a Group Owner
try {
    $Result = Invoke-OktaDeleteGroupOwner -GroupId $GroupId -OwnerId $OwnerId
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaDeleteGroupOwner: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
OwnerId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaDeleteGroupRule

void Invoke-OktaDeleteGroupRule
        [-RuleId]
        [-RemoveUsers] <System.Nullable[Boolean]>

Delete a group Rule

Removes a specific group rule by id from your organization

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$RuleId = "MyRuleId" # String | 
$RemoveUsers = $true # Boolean | Indicates whether to keep or remove users from groups assigned by this rule. (optional)

# Delete a group Rule
try {
    $Result = Invoke-OktaDeleteGroupRule -RuleId $RuleId -RemoveUsers $RemoveUsers
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaDeleteGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
RuleId String
RemoveUsers Boolean Indicates whether to keep or remove users from groups assigned by this rule. [optional]

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-OktaGroup

Group Get-OktaGroup
        [-GroupId]

List all Group Rules

Fetches a group from your organization.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 

# List all Group Rules
try {
    $Result = Get-OktaGroup -GroupId $GroupId
} catch {
    Write-Host ("Exception occurred when calling Get-OktaGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String

Return type

Group (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-OktaGroupOwners

GroupOwner[] Get-OktaGroupOwners
        [-GroupId]
        [-Filter]
        [-After]
        [-Limit] <System.Nullable[Int32]>

List all Owners

List all owners for a specific group.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$Filter = "MyFilter" # String | SCIM Filter expression for group owners. Allows to filter owners by type. (optional)
$After = "MyAfter" # String | Specifies the pagination cursor for the next page of owners (optional)
$Limit = 56 # Int32 | Specifies the number of owner results in a page (optional) (default to 1000)

# List all Owners
try {
    $Result = Get-OktaGroupOwners -GroupId $GroupId -Filter $Filter -After $After -Limit $Limit
} catch {
    Write-Host ("Exception occurred when calling Get-OktaGroupOwners: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
Filter String SCIM Filter expression for group owners. Allows to filter owners by type. [optional]
After String Specifies the pagination cursor for the next page of owners [optional]
Limit Int32 Specifies the number of owner results in a page [optional] [default to 1000]

Return type

GroupOwner[] (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get-OktaGroupRule

GroupRule Get-OktaGroupRule
        [-RuleId]
        [-Expand]

Retrieve a Group Rule

Fetches a specific group rule by id from your organization

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$RuleId = "MyRuleId" # String | 
$Expand = "MyExpand" # String |  (optional)

# Retrieve a Group Rule
try {
    $Result = Get-OktaGroupRule -RuleId $RuleId -Expand $Expand
} catch {
    Write-Host ("Exception occurred when calling Get-OktaGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
RuleId String
Expand String [optional]

Return type

GroupRule (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaListAssignedApplicationsForGroup

Application[] Invoke-OktaListAssignedApplicationsForGroup
        [-GroupId]
        [-After]
        [-Limit] <System.Nullable[Int32]>

List all Assigned Applications

Enumerates all applications that are assigned to a group.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$After = "MyAfter" # String | Specifies the pagination cursor for the next page of apps (optional)
$Limit = 56 # Int32 | Specifies the number of app results for a page (optional) (default to 20)

# List all Assigned Applications
try {
    $Result = Invoke-OktaListAssignedApplicationsForGroup -GroupId $GroupId -After $After -Limit $Limit
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaListAssignedApplicationsForGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
After String Specifies the pagination cursor for the next page of apps [optional]
Limit Int32 Specifies the number of app results for a page [optional] [default to 20]

Return type

Application[] (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaListGroupRules

GroupRule[] Invoke-OktaListGroupRules
        [-Limit] <System.Nullable[Int32]>
        [-After]
        [-Search]
        [-Expand]

List all Group Rules

Lists all group rules for your organization.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$Limit = 56 # Int32 | Specifies the number of rule results in a page (optional) (default to 50)
$After = "MyAfter" # String | Specifies the pagination cursor for the next page of rules (optional)
$Search = "MySearch" # String | Specifies the keyword to search fules for (optional)
$Expand = "MyExpand" # String | If specified as `groupIdToGroupNameMap`, then show group names (optional)

# List all Group Rules
try {
    $Result = Invoke-OktaListGroupRules -Limit $Limit -After $After -Search $Search -Expand $Expand
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaListGroupRules: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
Limit Int32 Specifies the number of rule results in a page [optional] [default to 50]
After String Specifies the pagination cursor for the next page of rules [optional]
Search String Specifies the keyword to search fules for [optional]
Expand String If specified as `groupIdToGroupNameMap`, then show group names [optional]

Return type

GroupRule[] (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaListGroupUsers

User[] Invoke-OktaListGroupUsers
        [-GroupId]
        [-After]
        [-Limit] <System.Nullable[Int32]>

List all Member Users

Enumerates all users that are a member of a group.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$After = "MyAfter" # String | Specifies the pagination cursor for the next page of users (optional)
$Limit = 56 # Int32 | Specifies the number of user results in a page (optional) (default to 1000)

# List all Member Users
try {
    $Result = Invoke-OktaListGroupUsers -GroupId $GroupId -After $After -Limit $Limit
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaListGroupUsers: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
After String Specifies the pagination cursor for the next page of users [optional]
Limit Int32 Specifies the number of user results in a page [optional] [default to 1000]

Return type

User[] (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Invoke-OktaListGroups

Group[] Invoke-OktaListGroups
        [-Q]
        [-Filter]
        [-After]
        [-Limit] <System.Nullable[Int32]>
        [-Expand]
        [-Search]

List all Groups

Enumerates groups in your organization with pagination. A subset of groups can be returned that match a supported filter expression or query.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$Q = "MyQ" # String | Searches the name property of groups for matching value (optional)
$Filter = "MyFilter" # String | Filter expression for groups (optional)
$After = "MyAfter" # String | Specifies the pagination cursor for the next page of groups (optional)
$Limit = 56 # Int32 | Specifies the number of group results in a page (optional) (default to 10000)
$Expand = "MyExpand" # String | If specified, it causes additional metadata to be included in the response. (optional)
$Search = "MySearch" # String | Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass (optional)

# List all Groups
try {
    $Result = Invoke-OktaListGroups -Q $Q -Filter $Filter -After $After -Limit $Limit -Expand $Expand -Search $Search
} catch {
    Write-Host ("Exception occurred when calling Invoke-OktaListGroups: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
Q String Searches the name property of groups for matching value [optional]
Filter String Filter expression for groups [optional]
After String Specifies the pagination cursor for the next page of groups [optional]
Limit Int32 Specifies the number of group results in a page [optional] [default to 10000]
Expand String If specified, it causes additional metadata to be included in the response. [optional]
Search String Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass [optional]

Return type

Group[] (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Remove-OktaUserFromGroup

void Remove-OktaUserFromGroup
        [-GroupId]
        [-UserId]

Unassign a User

Removes a user from a group with 'OKTA_GROUP' type.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$UserId = "MyUserId" # String | 

# Unassign a User
try {
    $Result = Remove-OktaUserFromGroup -GroupId $GroupId -UserId $UserId
} catch {
    Write-Host ("Exception occurred when calling Remove-OktaUserFromGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
UserId String

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update-OktaGroup

Group Update-OktaGroup
        [-GroupId]
        [-Group]

Replace a Group

Updates the profile for a group with OKTA_GROUP type from your organization.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$GroupId = "MyGroupId" # String | 
$HrefObjectHints = Initialize-HrefObjectHints -Allow "DELETE"
$HrefObject = Initialize-HrefObject -Hints $HrefObjectHints -Href "MyHref" -Name "MyName" -Type "MyType"

$GroupLinks = Initialize-GroupLinks -Apps $HrefObject -Logo $HrefObject -Self $HrefObject -Source $HrefObject -Users $HrefObject

$Group = Initialize-Group -Created (Get-Date) -Id "MyId" -LastMembershipUpdated (Get-Date) -LastUpdated (Get-Date) -ObjectClass "MyObjectClass" -VarProfile  -Type "APP_GROUP" -Embedded @{ key_example =  } -Links $GroupLinks # Group | 

# Replace a Group
try {
    $Result = Update-OktaGroup -GroupId $GroupId -Group $Group
} catch {
    Write-Host ("Exception occurred when calling Update-OktaGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
Group Group

Return type

Group (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update-OktaGroupRule

GroupRule Update-OktaGroupRule
        [-RuleId]
        [-GroupRule]

Replace a Group Rule

Updates a group rule. Only INACTIVE rules can be updated.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-OktaConfiguration

# Configure your client ID and scope for authorization
$Configuration.ClientId = "YOUR_CLIENT_ID"
$Configuration.Scope = "OKTA_SCOPES" # for example okta.users.read

$RuleId = "MyRuleId" # String | 
$GroupRuleGroupAssignment = Initialize-GroupRuleGroupAssignment -GroupIds "MyGroupIds"
$GroupRuleAction = Initialize-GroupRuleAction -AssignUserToGroups $GroupRuleGroupAssignment

$GroupRuleExpression = Initialize-GroupRuleExpression -Type "MyType" -Value "MyValue"

$GroupRuleGroupCondition = Initialize-GroupRuleGroupCondition -Exclude "MyExclude" -Include "MyInclude"
$GroupRuleUserCondition = Initialize-GroupRuleUserCondition -Exclude "MyExclude" -Include "MyInclude"
$GroupRulePeopleCondition = Initialize-GroupRulePeopleCondition -Groups $GroupRuleGroupCondition -Users $GroupRuleUserCondition

$GroupRuleConditions = Initialize-GroupRuleConditions -Expression $GroupRuleExpression -People $GroupRulePeopleCondition

$GroupRule = Initialize-GroupRule -Actions $GroupRuleAction -Conditions $GroupRuleConditions -Created (Get-Date) -Id "MyId" -LastUpdated (Get-Date) -Name "MyName" -Status "ACTIVE" -Type "MyType" # GroupRule | 

# Replace a Group Rule
try {
    $Result = Update-OktaGroupRule -RuleId $RuleId -GroupRule $GroupRule
} catch {
    Write-Host ("Exception occurred when calling Update-OktaGroupRule: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
RuleId String
GroupRule GroupRule

Return type

GroupRule (PSCustomObject)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]