Hello,
I am trying to automate the creation of credentials in a specific PAM vault, but I cannot retrieve the GUID of existing vaults. Get-DSPamFolders allows you to retrieve a json with the label of the folders, but not its GUID. Is there a powershell command to retrieve this GUID? The goal is to fill the $folderID variable of the following script.
# Replace dummy values with the correct information
$DVLSUrl = "https://dvls.domain.com/dvls"
$adminuser = "dvls-admin"
$SecPassword = "xxxxxxxxxxxxxxxxx"
$providerID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"
# Create a session with Devolutions Server
$SecPassword = ConvertTo-SecureString $SecPassword -AsPlainText -Force
$Creds = New System.Management.Automation.PSCredential object ($adminuser,$SecPassword)
$session = New-DSSession -Credential $Creds -BaseURI $DVLSUrl -AsApplication
# Check if the session was created successfully
if ($session -eq $null) {
Write-Host "Connection to Devolutions Server failed. Please check your credentials and instance URL."
} else {
# Add a credentials entry to the user's PAM vault
New-DSPamAccount -Name Test -CredentialType Domainuser -FolderID $folderID -adminusername Myusername -Password "Pa$$w0rd!" -ProviderID $providerID -Security $security
}
Close-DSsession
Hello,
Thank you for contacting us on that matter!
I tried to find a way, like you did, to get the PAM Vaults' IDs in PowerShell without success. It seems that there is no method right now to get these IDs other than manually grabbing them from the web UI!
I will ask our development team if they have a method, and I will get back to you!
Thank you for being so patient!
Best regards,
Érica Poirier
Hello,
The following commands retrieve the PAM Vaults' IDs.
$res = Get-DSPamFolder $res.Data | Where IsPamVault -eq $true | Select ID, Name
Let us know if you have further questions about this.
Best regards,
Érica Poirier
It works like a charm. Thank you very much for this quick feedback!