Invoke-DSPamCheckout

Synopsis

Creates a checkout request.

Syntax

__AllParameterSets

Invoke-DSPamCheckout -AccountID <guid> [-Reason <string>] [-ApproverID <guid>] [-Duration <int>]
 [-AsLegacyResponse] [<CommonParameters>]

Description

Creates a checkout request for the provided PAM credential. Also return the password if approval is not required or if approved ID is the same as the asking user's ID.

Examples

Example 1

PS C:\> $Response = Invoke-DSPamCheckout -PamCredentialID '92e1d27f-6e7b-4c62-86da-a04fc22603c2' -Verbose
        $BobPassword = $Response.Password
        $BobCheckoutInfo = $Response.CheckoutInfo
        $BobCheckinResponse = Invoke-DSPamCheckin $BobCheckoutInfo

Auto checkout of the pam credential (approval not required)

Example 2

PS C:\> $Response = Invoke-DSPamCheckout -PamCredentialID '2735a06c-baa0-4ff9-911c-aa1fcc03ea1e' -Reason 'Because' -ApproverID '49a60972-b1ff-4be9-ac73-47c6d4a4125d'
        $MauricePassword = $Response.Password
        $MauriceCheckoutInfo = $Response.CheckoutInfo
        $MauriceCheckinResponse = Invoke-DSPamCheckin $MauriceCheckoutInfo

Self checkout of the pam credential (approver is the same person who request the checkout)

Example 3

PS C:\> $Response = Invoke-DSPamCheckout -PamCredentialID '08a521fe-14f7-4ae5-b2b9-d9f6164c15e8' -ApproverID '2364ec1f-a739-450b-afe8-d85b5a3db50e' -Reason 'Because'
        # After approval
        $CheckoutResponse = Get-DSPamCheckout -CheckoutID $Response.ID
        $KellyPassword = Get-DSPamPassword -PamCredentialID $CheckoutResponse.CredentialID
        $KellyCheckoutInfo = $CheckoutResponse.CheckoutInfo
        $KellyCheckinResponse = Invoke-DSPamCheckin $KellyCheckoutInfo

Approved checkout of the pam credential (approval done by the specified approver)

Parameters

-AccountID

ID of the pam credential to checkout

Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases:
- PamCredentialID
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ApproverID

Approver's ID. Necessary if approval is mandatory.

Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AsLegacyResponse

In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Duration

Duration, in minutes, of the checkout request. By default, it is set to 2 hours (120 minutes).

Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Reason

Information on the checkout request to be sent to an administrator for approval.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Notes

For more information, type "Get-Help Invoke-DSPamCheckout -detailed". For technical information, type "Get-Help Invoke-DSPamCheckout -full".

Devolutions Forum logo Give us Feedback