Update-VPASAccountFields


Supported Environments:
SelfHosted
SharedServices
PCloudStandard


Synopsis:

UPDATE ACCOUNT FIELDS


Description:

USE THIS FUNCTION TO UPDATE AN ACCOUNT FIELD FOR AN ACCOUNT IN CYBERARK


Syntax:

Update-VPASAccountFields [-safe <String>] [-platform <String>] [-username <String>] [-address <String>] -action <String> -field <String> -fieldval <String> [-CustomField <String>] [-token <Hashtable>] [<CommonParameters>]

Update-VPASAccountFields -AcctID <String> -action <String> -field <String> -fieldval <String> [-CustomField <String>] [-token <Hashtable>] [<CommonParameters>]

Update-VPASAccountFields -InputParameters <Hashtable> [-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: named
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: named
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: named
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: named
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: true
Position: named
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-action <String>
Which action will be taken on the updated fields
Possible values: Add, Remove, Replace

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

-field <String>
Define which field will be updated
Possible values: Name, Address, PlatformID, Username, Status, StatusReason, RemoteMachines, AccessRestrictedToRemoteMachines, LogonDomain, AutomaticManagementEnabled, ManualManagementReason

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

-fieldval <String>
Target value that will be used to update the target field

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

-CustomField <String>
Target property tag that will be updated

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

-InputParameters <Hashtable>
HashTable of values containing the parameters required to make the API call

Required: true
Position: named
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: named
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:

$UpdateAccountFieldsJSON = Update-VPASAccountFields -safe {SAFE VALUE} -username {USERNAME VALUE} -action {ACTION VALUE} -field {FIELD VALUE} -fieldval {FIELDVAL VALUE}

$InputParameters = @{
        safe = "TargetSafeName"
         platform = "TargetPlatformID"
         username = "TargetUsername"
         address = "TargetAddress"
         action = "Add"|"Remove"|"Replace"
         field = "Name"|"Address"|"PlatformID"|"Username"|"Status"|"StatusReason"|"RemoteMachines"|"AccessRestrictedToRemoteMachines"|"LogonDomain"|"CustomField"|"AutomaticManagementEnabled"|"ManualManagementReason"
         fieldval = "UpdatedFieldValue"
         CustomField = "CustomFileCategory"
}
$UpdateAccountFieldsJSON = Update-VPASAccountFields -InputParameters $InputParameters

$InputParameters = @{
        AcctID = "22_312"
         action = "Add"|"Remove"|"Replace"
         field = "Name"|"Address"|"PlatformID"|"Username"|"Status"|"StatusReason"|"RemoteMachines"|"AccessRestrictedToRemoteMachines"|"LogonDomain"|"CustomField"|"AutomaticManagementEnabled"|"ManualManagementReason"
         fieldval = "UpdatedFieldValue"
         CustomField = "CustomFileCategory"
}
$UpdateAccountFieldsJSON = Update-VPASAccountFields -InputParameters $InputParameters


Outputs:

If successful:
{
         "categoryModificationTime": 1723869049,
         "platformId": "WinDomain",
         "safeName": "TestSafe",
         "id": "121_5",
         "name": "Operating System-WinDomain-vman.com-testdomainuser02",
         "address": "NewAddress.vman.com",
         "userName": "testdomainuser02",
         "secretType": "password",
         "secretManagement": {
                 "automaticManagementEnabled": true,
                 "lastModifiedTime": 1723780054
         },
         "createdTime": 1723780054
}

$false if failed