Jump to content

Search the Community

Showing results for tags 'secret server'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. My company has dictated that I can no longer use KeePass command line to retrieve credentials for my automated testing and I'm to use secretserver from thycotic. Secret Server is a web based application that can only be automated from a WebAPI. I have never done this type of thing with AutoIT and I'm not sure where to start. I have been sent the generic How-To get started link but it's all PowerShell: https://thycotic.force.com/support/s/article/REST-API-PowerShell-Scripts-Getting-Started How would I either: a. Convert the powershell script into AutoIT. (This is what I would prefer) or b. Launch the Powershell script from AutoIT and retrieve the values back into AutoIT. Below are the examples from that website. 2 - Windows Authentication $api = "http:// <secret server url>/api/v1" $endpoint = "$api/secrets/3844" $secret = Invoke-RestMethod $endpoint -UseDefaultCredentials 3 - Searching Secrets try { $api = "http:// <secret server url>/api/v1" $tokenRoute = "http:// <secret server url>/oauth2/token"; $creds = @{ username = "< user name >" password = "< password >" grant_type = "password" } $token = "" $response = Invoke-RestMethod $tokenRoute -Method Post -Body $creds $token = $response.access_token; #Write-Host $token $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization", "Bearer $token") $filters = "?filter.HeartbeatStatus=1&filter.includeRestricted=true&filter.searchtext=< mySearchText >" Write-Host "------------------------------" Write-Host "----- Secret Search Values -----" Write-Host "------------------------------" #?filter.searchfields=username&filter.searchfields=displayname&filter.searchfields=filter.searchText=mister&filter.includeinactive=true" -Headers $headers $result = Invoke-RestMethod "$api/secrets$filters" -Headers $headers Write-Host $result.filter.searchFields Write-Host $result.total foreach($secret1 in $result.records) { Write-Host $secret1.id" - "$secret1.name" - "$secret1.folderId - $secret1.lastHeartBeatStatus } Write-Host "------------------------------" Write-Host "----- Secret Lookup Values -----" Write-Host "------------------------------" #?filter.searchfields=username&filter.searchfields=displayname&filter.searchfields=filter.searchText=mister&filter.includeinactive=true" -Headers $headers $result = Invoke-RestMethod "$api/secrets/lookup$filters" -Headers $headers Write-Host $result.filter.searchFields Write-Host $result.total foreach($secret in $result.records) { Write-Host $secret.id" - "$secret.value } Write-Host "------------------------------" } catch [System.Net.WebException] { Write-Host "----- Exception -----" Write-Host $_.Exception Write-Host $_.Exception.Response.StatusCode Write-Host $_.Exception.Response.StatusDescription $result = $_.Exception.Response.GetResponseStream() $reader = New-Object System.IO.StreamReader($result) $reader.BaseStream.Position = 0 $reader.DiscardBufferedData() $responseBody = $reader.ReadToEnd() | ConvertFrom-Json Write-Host $responseBody.errorCode " - " $responseBody.message foreach($modelState in $responseBody.modelState) { $modelState } } Thanks in advance for any help you can provide. Mike
×
×
  • Create New...