Jump to content

Delete a passwordlist with powershell

Lesley Spiessens

Recommended Posts

We want to delete several passwordlists ( a 1000 with all the same listname) in our passwordstate automatically with the API (powershell)

How do we manage that ?


Did try something like this:


$PasswordstateUrl = 'https://My-URL/api/passwordlists'

$Result = Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "APIKey" = "key x" }


$Max = ($Result.PasswordListID).count

for ($i=0; $i -le $Max; $i++)


$a = $result.PasswordList[$i]

if ($a -eq "Windows Users")


$PasswordListID_value = $result.PasswordListID[$i]

$PasswordstateDELUrl = 'https://MY-URL/api/passwordlists/' + $PasswordListID_value + '?MoveToRecycleBin=True'

Write-Host $PasswordstateDELUrl

Invoke-Restmethod -Method delete -Uri $PasswordstateDELUrl -Header @{ "APIKey" = "key x" }




 This gives only an invalid API call

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...