Add-VPASAccountRequest


Supported Environments:
SelfHosted
SharedServices
PCloudStandard


Synopsis:

CREATE A NEW ACCOUNT REQUEST


Description:

USE THIS FUNCTION TO CREATE A NEW ACCOUNT REQUEST THAT UTILIZES DUAL CONTROL


Syntax:

Add-VPASAccountRequest [[-safe] <String>] [[-platform] <String>] [[-username] <String>] [[-address] <String>] [[-AcctID] <String>] [-Reason] <String> [[-MultipleAccess]] [[-FromDateTime] <String>] [[-ToDateTime] <String>] [[-UseConnect]] [[-ConnectionComponent] <String>] [[-Hostname] <String>] [[-token] <Hashtable>] [<CommonParameters>]


Parameters:

-safe <String>
Safe name that will be used to query for the target account if no AcctID is passed

Required: false
Position: 1
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-platform <String>
PlatformID that will be used to query for the target account if no AcctID is passed

Required: false
Position: 2
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-username <String>
Username that will be used to query for the target account if no AcctID is passed

Required: false
Position: 3
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-address <String>
Address that will be used to query for the target account if no AcctID is passed

Required: false
Position: 4
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-AcctID <String>
Unique ID that maps to a single account, passing this variable will skip any query functions

Required: false
Position: 5
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-Reason <String>
Purpose for opening this account request

Required: true
Position: 6
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-MultipleAccess [<SwitchParameter>]
MultipleAccess type request gives the ability to use the account multiple times within a requested time frame

Required: false
Position: 7
Default value: False
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-FromDateTime <String>
Start of the date range for the account request
Value should follow this format: MM/dd/yyyy HH:mm:ss

Required: false
Position: 8
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-ToDateTime <String>
End of the date range for the account request
Value should follow this format: MM/dd/yyyy HH:mm:ss

Required: false
Position: 9
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-UseConnect [<SwitchParameter>]
Gives this account request the ability to connect via PSM if approved

Required: false
Position: 10
Default value: False
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-ConnectionComponent <String>
Specify the connection component that will be used if UseConnect is enabled
Example value: PSM-RDP, PSM-SSH, PSM-vSphere

Required: false
Position: 11
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-Hostname <String>
Specify the hostname that will be connected to if the account request is for a domain account
This value will populate the PSMRemoteMachine parameter

Required: false
Position: 12
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-token <Hashtable>
HashTable of data containing various pieces of login information (PVWA, LoginToken, HeaderType, etc).
If -token is not passed, function will use last known hashtable generated by New-VPASToken

Required: false
Position: 13
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug
ErrorAction, ErrorVariable, WarningAction, WarningVariable
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216)


Examples:

$AddAccountRequestJSON = Add-VPASAccountRequest -AcctID {ACCTID VALUE} -Reason {REASON VALUE} -MultipleAccess -FromDateTime "03/12/2024 9:00:00" -ToDateTime "03/12/2024 13:00:00" -UseConnect -ConnectionComponent PSM-RDP

$AddAccountRequestJSON = Add-VPASAccountRequest -AcctID {ACCTID VALUE} -Reason {REASON VALUE}


Outputs:

If successful:
{
         "RequestID": "VPASRequestSafe_19",
         "SafeName": "VPASRequestSafe",
         "RequestorUserName": "vadim@vman.com",
         "RequestorReason": "(ConnectionClient=PSM-RDP) Testing Account Request",
         "UserReason": "Testing Account Request",
         "CreationDate": 1723776151,
         "Operation": "Connect to VPASDualControl-DomainAdmin011-vman.com",
         "ExpirationDate": 1726368151,
         "OperationType": 4,
         "AccessType": "ManyTimes",
         "ConfirmationsLeft": 1,
         "AccessFrom": 1723813200,
         "AccessTo": 1723827600,
         "Status": 1,
         "StatusTitle": "Waiting: 1 more user(s) must confirm the request",
         "InvalidRequestReason": 0,
         "CurrentConfirmationLevel": 1,
         "RequiredConfirmersCountLevel2": 1,
         "TicketingSystemProperties": {
                 "Name": null,
                 "Number": null,
                 "Status": null
         },
         "AdditionalInfo": {
                
         },
         "AccountDetails": {
                 "AccountID": "120_3",
                 "Properties": {
                         "Address": "vman.com",
                         "Safe": "VPASRequestSafe",
                         "Folder": "Root",
                         "Name": "Operating System-VPASDualControl-vman.com-DomainAdmin01",
                         "PolicyID": "VPASDualControl",
                         "PlatformName": "VPASDualControl",
                         "DeviceType": "Operating System",
                         "LastModifiedDate": "1715222718000",
                         "LastModifiedBy": "vadim@vman.pam",
                         "LastUsedDate": "1715222731000",
                         "LastUsedBy": "vadim@vman.com",
                         "UserName": "DomainAdmin011",
                         "LockedBy": "",
                         "CPMDisabled": "",
                         "CPMStatus": "NoAction",
                         "ManagedByCPM": "True",
                         "DeletedBy": "",
                         "DeletionDate": "0",
                         "ImmediateCPMTask": "NoTask",
                         "LastCPMTask": "NoTask",
                         "CreationDate": "1715222718",
                         "IsSSHKey": "False",
                         "IsIrregularPlatform": "False",
                         "CreationMethod": "PVWA"
                 }
         },
         "Confirmers": [
                 {
                         "Type": 1,
                         "ID": 41,
                         "Name": "vadim@vman.com",
                         "Action": 2,
                         "Reason": "",
                         "ActionDate": 0,
                 "AdditionalDetails": "@{fullname=Vadim Melamed; email=vadim@vman.com; phone=1234567890}",
                         "Members": null
                 }
         ]
}

$false if failed