Deleting a Password Reset Dependency ​
DELETE /api/dependencies
To delete a password reset dependency from an existing password record i.e. Windows Service, Scheduled Task, etc. Deleting a dependency can be achieved as per the example below, using the following parameter descriptions:
DependencyType field is not mandatory.
| Heading | Data Type | Description |
|---|---|---|
| PasswordID | Integer | Unique identifier for the password record |
| HostName | String (200) | The name of the Host which the Dependency record exists on |
| DependencyName | String (200) | The name of the dependency i.e. the name of the Windows Service, Scheduled Task, etc. |
| DependencyType | String (50) | The type of dependency i.e. Windows Service, IIS Application Pool, Scheduled Task, COM+ Component or blank |
| APIKey | String (NA) | Password List or System Wide API Key |
Powershell
#JSON data for the object
$Body = @{
PasswordID = $PasswordID
HostName = "win2k12server78.domain.local"
DependencyType = "Windows Service"
DependencyName = "Custom Windows Service"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/dependencies' -ContentType "application/json" -Body $jsonData -Header @{ "APIKey" = "<apikey>" }Json
# Response
HTTP/1.1 204 No Content