Skip to content

Instantly share code, notes, and snippets.

@luke-z
Created June 10, 2025 09:49
Show Gist options
  • Save luke-z/7fb05225f3fdd451775e5bfa2a49990d to your computer and use it in GitHub Desktop.
Save luke-z/7fb05225f3fdd451775e5bfa2a49990d to your computer and use it in GitHub Desktop.
Get password notification config
$dllPath = "dll\PsrApi.dll"
Add-Type -Path $dllPath
$serverUrl = "domain/api"
$psrApi = New-Object PsrApi.PsrApi($serverUrl)
$authenticationFlow = $psrApi.AuthenticationManagerV2.StartNewAuthentication("db", "username")
$startLoginTask = $authenticationFlow.StartLogin()
$startLoginTask.Wait()
$requirement = $authenticationFlow.GetNextRequirement()
$selectedRequirement = $requirement.PossibleRequirements[0]
foreach ($field in $selectedRequirement.Fields) {
$field.Value = "password"
}
$authenticateTask = $authenticationFlow.Authenticate($selectedRequirement)
try {
$authenticateTask.Wait()
}
catch {
Write-Error "Login failed. Please check the credentials and try again."
return
}
$triggerTask = $psrApi.TriggerManager.GetTriggerConfigList("passwordId")
$triggerTask.Wait()
$triggerConfigList = $triggerTask.Result
Write-Output $triggerConfigList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment