I am having a problem with Update Limit Domain Access To property.
Scenario 1:
![image](https://user-images.githubusercontent.com/37862906/85808334-1a6c6200-b787-11ea-9431-836beffb0384.png)
Account onboarded to CyberArk with Windomain Platform but didn't check the BOX limit domain access to
By running an update command, I am unable to activate the parameter Limit Domain Access to and also unable to add IP address
Scenario 2:
![image](https://user-images.githubusercontent.com/37862906/85808586-e2195380-b787-11ea-895f-464f0a84c26c.png)
Account onboarded to CyberArk with Windomain Platform and enabled checkbox limit domain access to
without any addresses in the limit domain access to.
By running an update command, I am unable to update IP address
Scenario 3:
![image](https://user-images.githubusercontent.com/37862906/85808606-ef364280-b787-11ea-86d7-a6cebefe0de7.png)
Account onboarded to CyberArk with Windomain Platform but didn't include any addresses in the limit domain access to. But enabled the option Limit Domain Access To and added dummy value
By running an update command, I am ABLE to UPDATE the Limit Domain Access to with UPDATED IP ADDRESSES
![image](https://user-images.githubusercontent.com/37862906/85808629-007f4f00-b788-11ea-9106-ed7ea83fd956.png)
In the last scenario, the value update but showing an error message as below:
PS C:\Temp> .\Untitled2.ps1 -PVWAURL https://10.247.54.28/PasswordVault -CsvPath .\test-3.csv -DisableSSLVerify -NoSafeCreation -AuthType cyberark -Update -Verbose -Debug
=======================================
Welcome to Accounts Onboard Utility
WARNING: It is not Recommended to disable SSL verification
DEBUG: Trying to validate URL: https://10.247.54.28/PasswordVault
VERBOSE: HEAD https://10.247.54.28/PasswordVault with 0-byte payload
Getting PVWA Credentials to start Onboarding Accounts
VERBOSE: {
"password": "Cyberark1",
"username": "sudhakar"
}
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/auth/cyberark/Logon -Method Post -Header -ContentType "appl
ication/json" -Body {
"password": "****",
"username": "sudhakar"
} -TimeoutSec 36000
VERBOSE: POST https://10.247.54.28/PasswordVault/api/auth/cyberark/Logon with -1-byte payload
VERBOSE: received 182-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: YWNiZWE2NmQtY2NjYy00NWI5LWI5ZTAtNzM0NmVkZDVjNzhhOzc4NTE2QkNCNTM0OEZERTI7MDAwMDAwMDJFNUExRjg5Qjc3ODc5
RTgzMzEyMUIxNkFEMjEyRjc5RDgyRjQ4Qjc5MzZBQTZEREM0OTJDRjY2REY0NTg5RDIxMDAwMDAwMDA7
Starting to Onboard 1 accounts
4
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/WebServices/PIMServices.svc/Safes/DC1-Prod-Win-Bucket -Method Ge
t -Header System.Collections.Generic.Dictionary`2[System.String,System.String] -ContentType "application/json" -TimeoutSec 36000
VERBOSE: GET https://10.247.54.28/PasswordVault/WebServices/PIMServices.svc/Safes/DC1-Prod-Win-Bucket with 0-byte payload
VERBOSE: received 180-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: @{GetSafeResult=}
Safe DC1-Prod-Win-Bucket exists
DEBUG: Returning URL Encode of DC1-Prod-Win-Bucket
DEBUG: Returning URL Encode of pamwinadm1 07.07.07.07
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/Accounts?filter=safename eq DC1-Prod-Win-Bucket&search=pamwi
nadm1+07.07.07.07 -Method Get -Header System.Collections.Generic.Dictionary`2[System.String,System.String] -ContentType "applicatio
n/json" -TimeoutSec 36000
VERBOSE: GET https://10.247.54.28/PasswordVault/api/Accounts?filter=safename eq DC1-Prod-Win-Bucket&search=pamwinadm1+07.07.07.07 w
ith 0-byte payload
VERBOSE: received 538-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: @{value=System.Object[]; count=1}
Account pamwinadm1 exist
DEBUG: Returning URL Encode of DC1-Prod-Win-Bucket
DEBUG: Returning URL Encode of pamwinadm1 07.07.07.07
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/Accounts?filter=safename eq DC1-Prod-Win-Bucket&search=pamwi
nadm1+07.07.07.07 -Method Get -Header System.Collections.Generic.Dictionary`2[System.String,System.String] -ContentType "applicatio
n/json" -TimeoutSec 36000
VERBOSE: GET https://10.247.54.28/PasswordVault/api/Accounts?filter=safename eq DC1-Prod-Win-Bucket&search=pamwinadm1+07.07.07.07 w
ith 0-byte payload
VERBOSE: received 538-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: @{value=System.Object[]; count=1}
VERBOSE: Inspecting Account Property id
VERBOSE: Inspecting Account Property name
VERBOSE: Inspecting Account Property address
VERBOSE: Inspecting Account Property userName
VERBOSE: Inspecting Account Property platformId
VERBOSE: Inspecting Account Property safeName
VERBOSE: Inspecting Account Property secretType
VERBOSE: Inspecting Account Property platformAccountProperties
VERBOSE: Inspecting Account Property Location
VERBOSE: Inspecting Account Property Hostname
VERBOSE: Inspecting Account Property Environment
VERBOSE: Inspecting Account Property secretManagement
VERBOSE: Inspecting Account Property automaticManagementEnabled
VERBOSE: Since Account Automatic management is off, adding the Manual management reason
VERBOSE: Inspecting Account Property manualManagementReason
VERBOSE: Updating Account Property @{automaticManagementEnabled=False; manualManagementReason=[No Reason]; lastModifiedTime=1584959
645} value from: '[No Reason]' to: ''
VERBOSE: Inspecting Account Property lastModifiedTime
VERBOSE: Inspecting Account Property remoteMachinesAccess
VERBOSE: Inspecting Account Property remoteMachines
VERBOSE: Updating Account Property @{remoteMachines=dummy; accessRestrictedToRemoteMachines=True} value from: 'dummy' to: 'FINAPP02
.exFinance.com;FINAPP03.exFinance.com;FINAPP04.exFinance.com;FINAPP05.exFinance.com;FINAPP06.exFinance.com'
VERBOSE: Inspecting Account Property accessRestrictedToRemoteMachines
VERBOSE: Inspecting Account Property createdTime
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/Accounts/51_29 -Method PATCH -Header System.Collections.Gene
ric.Dictionary`2[System.String,System.String] -ContentType "application/json" -Body [
{
"op": "add",
"path": "/secretManagement/manualManagementReason",
"value": "[No Reason]"
},
{
"op": "replace",
"path": "/secretManagement/manualManagementReason",
"value": ""
},
{
"op": "replace",
"path": "/remoteMachinesAccess/remoteMachines",
"value": "FINAPP02.exFinance.com;FINAPP03.exFinance.com;FINAPP04.exFinance.com;FINAPP05.exFinance.com;FINAPP06.exFinance.c
om"
] -TimeoutSec 36000
VERBOSE: PATCH https://10.247.54.28/PasswordVault/api/Accounts/51_29 with -1-byte payload
VERBOSE: received 625-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: @{id=51_29; name=07.07.07.07-pamwinadm1; address=07.07.07.07; userName=pamwinadm1; platformId=WinDom
ain; safeName=DC1-Prod-Win-Bucket; secretType=password; platformAccountProperties=; secretManagement=; remoteMachinesAccess=; creat
edTime=1584959645}
Account properties Updated Successfully
DEBUG: Updating Account Secret...
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/Accounts/51_29/Password/Update -Method POST -Header System.C
ollections.Generic.Dictionary`2[System.String,System.String] -ContentType "application/json" -Body {
} -TimeoutSec 36000
VERBOSE: POST https://10.247.54.28/PasswordVault/api/Accounts/51_29/Password/Update with -1-byte payload
**Error Message: {"Details":[{"ParameterName":"NewCredentials","ErrorCode":"PASWS011E","ErrorMessage":"Missing mandatory parameter [N
ewCredentials]."}],"ErrorCode":"PASWS167E","ErrorMessage":"There are some invalid parameters"}
Exception Message: The remote server returned an error: (400) Bad Request.**
Status Code: 400
Status Description: Bad Request
VERBOSE: Invoke-REST Response:
[1/1] Updated [email protected] successfully.
Logoff Session...
VERBOSE: Invoke-RestMethod -Uri https://10.247.54.28/PasswordVault/api/auth/Logoff -Method Post -Header System.Collections.Generic.
Dictionary`2[System.String,System.String] -ContentType "application/json" -TimeoutSec 36000
VERBOSE: POST https://10.247.54.28/PasswordVault/api/auth/Logoff with 0-byte payload
VERBOSE: received 16-byte response of content type application/json; charset=utf-8
VERBOSE: Invoke-REST Response: @{LogoffUrl=}
Vaulted 1 out of 1 accounts successfully.
=======================================
LogoffUrl