Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion IdentityCommand/IdentityCommand.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,19 @@
'Unlock-IDUser',
'Get-IDTenant',
'Get-IDTenantConfiguration',
'New-IDTenantCname',
'Remove-IDTenantCname',
'Get-IDConnector',
'New-IDPlatformToken',
'Get-IDUserRole',
'Get-IDAnalyticsDataset',
'Get-IDTenantCname',
'Get-IDTenantURL',
'Set-IDTenantPreferredCname',
'Get-IDTenantSuffix',
'New-IDTenantSuffix',
'Remove-IDTenantSuffix',
'Get-IDTenantCdsSuffix',
'Get-IDDownloadUrl',
'Get-IDUserIdentifier',
'Invoke-IDSqlcmd',
Expand Down Expand Up @@ -121,7 +129,8 @@
'Remove-IDAuthenticationPolicyBlock',
'Get-IDUserOathOTPClientName',
'Get-IDUserPasswordComplexityRequirements',
'New-IDAuthenticationPolicy'
'New-IDAuthenticationPolicy',
'Set-IDAuthenticationPolicy'
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
Expand Down
21 changes: 0 additions & 21 deletions IdentityCommand/Public/Get-IDTenant.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions IdentityCommand/Public/Get-IDTenantCname.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions IdentityCommand/Public/Get-IDTenantConfiguration.ps1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ function Remove-IDAuthenticationPolicyBlock {

PROCESS {

if ($Name -notlike "/Policy/*") {

Write-Warning "The name parameter must be in the syntax the '/Policy/<PolicyName>'"
break
}

$Body = @{

"path" = $Name
Expand Down
65 changes: 65 additions & 0 deletions IdentityCommand/Public/Policies/Set-IDAuthenticationPolicy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
function Set-IDAuthenticationPolicy {

[CmdletBinding()]
param
(
[Parameter(Mandatory = $true,
ValueFromPipelinebyPropertyName = $true)]
$PolicyName,

[Parameter(Mandatory = $false)]
$Description = "",

[Parameter(Mandatory = $false)]
[ValidateSet('Role','Global','Collection')]
$LinkType = "Global"
)

BEGIN {} #begin

PROCESS {

$Plinks = Get-IDAuthenticationPolicyLink

$PolicyBlock = Get-IDAuthenticationPolicyBlock -Name $PolicyName
$RevStamp = $PolicyBlock | Select-Object -ExpandProperty RevStamp
$Version = $PolicyBlock | Select-Object -ExpandProperty Version
$Version++

$Plinks = (ConvertTo-Json -InputObject $Plinks)

$Body = "{

'plinks' : $($Plinks),
'policy': {

'Newpolicy': 'false',
'Version': '$($Version)',
'Path': '/Policy/$PolicyName',
'RevStamp': '$($Revstamp)',
'Settings': {
'/Core/Security/CDS/ExternalMFA/ShowQRCode': true
},
'Description': '$($Description)'

}
}"

#Constructed parameters for the rest call
$RestCall = @{

"URI" = "https://$($ISPSSSession.TenantId).id.cyberark.cloud/Policy/SavePolicyBlock3"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"Body" = $Body
"ContentType" = "application/json"

}
# invoking the rest call
$result = Invoke-IDRestMethod @RestCall

return $result
} #process

END {} #end
}
29 changes: 29 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenant.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenant {

[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/SysInfo/About"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}

#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result.Results.Row

}#process

END {}#end

}
29 changes: 29 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenantCdsSuffix.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantCdsSuffix {

[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/Core/GetCdsAliasesForTenant"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}

#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result.Results.Row

}#process

END {}#end

}
27 changes: 27 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenantCname.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantCname {
[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/TenantCnames/UiGet"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}
#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result.Results.Row

}#process

END {}#end

}
28 changes: 28 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenantConfiguration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantConfiguration {
[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/TenantConfig/GetCustomerConfig"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}

#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result

}#process

END {}#end

}
29 changes: 29 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenantSuffix.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantSuffix {

[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/Core/GetAliasesForTenant"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}

#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result.Results.Row

}#process

END {}#end

}
27 changes: 27 additions & 0 deletions IdentityCommand/Public/Tenant/Get-IDTenantURL.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantURL {
[CmdletBinding()]
param( )

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/TenantCnames/Get"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}
#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result

}#process

END {}#end

}
33 changes: 33 additions & 0 deletions IdentityCommand/Public/Tenant/New-IDTenantCname.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# .ExternalHelp IdentityCommand-help.xml
function New-IDTenantCname {
[CmdletBinding()]
param
(

[Parameter(Mandatory = $true)]
$cnamePrefix

)

BEGIN {}#begin

PROCESS {

$RestCall = @{

"URI" = "$($ISPSSSession.tenant_url)/TenantCnames/Register?cnamePrefix=$cnamePrefix"
"Headers" = $($ISPSSSession.WebSession.Headers)
"Method" = "Post"
"ContentType" = "application/json"

}
#Send Request
$result = Invoke-IDRestMethod @RestCall

return $result

}#process

END {}#end

}
Loading