Created
          June 10, 2025 09:49 
        
      - 
      
- 
        Save luke-z/7fb05225f3fdd451775e5bfa2a49990d to your computer and use it in GitHub Desktop. 
    Get password notification config
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $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