I'm using the Powershell module Get-CCPCredential to fetch the password. With anonymous authentication this works but when I change my CCP to work with windows authentication and "negotiate:kerberos" is doesn't work anymore. Any ideas?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

I'm using the Powershell module Get-CCPCredential to fetch the password. With anonymous authentication this works but when I change my CCP to work with windows authentication and "negotiate:kerberos" is doesn't work anymore. Any ideas?

L1 Bithead
1 accepted solution

Accepted Solutions

L6 Presenter

have you tried using -UseDefaultCredentials switch?

View solution in original post

14 REPLIES 14

L1 Bithead

PS D:\scripts> D:\scripts\test-CCPCredential.ps1

[ERROR] Failed to fetch password for user TestUser : System.Net.WebException: The remote server returned an error: (401) Unauthorized.  at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)

  at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

 

From IIS logs :

2019-12-06 10:36:04 fe80::e0b0:31eb:c4a8:661f%3 GET /AIMWebService/api/Accounts Safe=APP_CSK_TDA_CYBERARK_AUTOMAT&AppID=APP_CSK_ACC_CYBERARK_AUTOMATION&UserName=TestUser 443 - fe80::e0b0:31eb:c4a8:661f%3 Mozilla/5.0+(Windows+NT;+Windows+NT+10.0;+en-US)+WindowsPowerShell/5.1.14393.3053 - 401 2 5 125

L6 Presenter

have you tried using -UseDefaultCredentials switch?

L4 Transporter

have you tried using -UseDefaultCredentials switch?

L1 Bithead

Indeed, that was the solution! So simple. Thank you very much !!!

Hi @wdams, when I used the get-ccpcredential, it retrieved all the accounts properties, how did you get only the password out and where did you use the -UseDefaultCredentials switch?

 

This is how you should use it. If you only need the password than only get the content attribute.

$CyberArkRecord = Get-CCPCredential -URL $CCP_URL -Safe "YOUR_SAFE" -AppID "YOUR_APP" -UserName "USER_TO_FIND" -UseDefaultCredentials -ErrorAction Stop

$CyberArkRecord.Content

 

L2 Linker

@Wim Dams​ 

Thanks for the tip.

Im trying to insert the content into a variable so that I can use it.

I'm trying to use ConvertTo-SecureString, but when I try to use it, it fails on the network, probably due to special characters.

Any suggestions?

I also use the ConverTo-Securestring function to convert the Password into a Powershell Credential object.

See example.

$PWord = ConvertTo-SecureString -String $CyberArkRecord.Content -AsPlainText -Force

$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ConnectUser, $PWord

Never had issues with this.

check out the "ToSecureString" & "ToCredential" methods included with the module....

https://github.com/pspete/CredentialRetriever#tosecurestring-method

 

$result = Get-CCPCredential -AppID PS -Safe PS -Object PSP-AccountName -URL https://cyberark.yourcompany.com   $result.ToSecureSting()   $result.ToCredential()

 

 

Still doesn't work for me.

I've executed:

$CyberArkRecord = Get-CCPCredential -URL https://URL -Safe <safe name> -AppID baruch -object 'object name' -UseDefaultCredentials -ErrorAction Stop

 

then,

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($user, $CyberArkRecord.ToSecureString())

 

and finally,

start explorer.exe \\server name\c$ -Credential $cred

 

but it keeps prompting for user and password, and the creds in the vault are correct

Have seen something similar if "Hostname\" or "Domain\" is not specified before the username.

but I do specify domain\username

@Pete Maan

​ 

can I show you what I am trying to do to?

Perhaps a quick session?

L1 Bithead

Hi,

Does anyone have a script to rotate many password account ?

Thank you

  • 1 accepted solution
  • 1577 Views
  • 14 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!