Jump to content

njordur

Members
  • Content Count

    22
  • Joined

  • Last visited

  • Days Won

    3

njordur last won the day on January 20 2017

njordur had the most liked content!

About njordur

  • Rank
    Member

Recent Profile Visitors

630 profile views
  1. I can't see it in the API documentation. Is it possible give individual permissions to passwords in Passwordstate? If not can I expect this to be in the API any time soon. /Njörður
  2. njordur

    API Create Password with $ in it

    Thanks for this, didn't solve the input problem though. I just excluded $ from the input so I don't have to handle it. Nice touch with the psobject, will use that. /Njörður
  3. Hi, Can you fix so the whenever you use the API to create a password and the password has a $ sign in it truncates the rest of the password set in passwordstate. I proably can fix this with modifications in my script. But just wanted to have this so I wouldn't have to. Example of a powershell script, works fine if there are no $ signs in the password. Probably the same happens with other parameters. param($username, $password, $description) $jsonString = @" { "PasswordListID":92, "Title":"company\\$username", "Description":"$description", "AccountTypeID":64, "UserName":"$username", "password":"$password", "APIKey":"XXXXXXXXXXXXXXXXXXXXXXXX", "PasswordResetEnabled":true, "PrivilegedAccountID":2, "HeartbeatEnabled":true, "ValidationScriptID":7, "ADDomainNetBIOS":"company" } "@ Invoke-RestMethod -Uri https://passwordstate.company.com/api/passwords/ -Method Post -ContentType "application/json" -Body $jsonString
  4. njordur

    Custom Password Validation Error

    No rush, its just an improvement for you guys :). I'll just wait for the release.
  5. njordur

    Custom Password Validation Error

    No thats not it, I'm overwriting it each time with the variable. I hadn't even started handling that part. What comes in the variable database is just [GenericField1] So if I switch the catch output to this... switch -wildcard ($error[0].Exception.ToString().ToLower()) { #"*A network-related or instance-specific*" { Write-Output "Failed to execute script correctly against Host '$HostName' for the account '$UserName'. Please check SQL details are correct, and that a firewall is not blocking access - default Port is 1433."; break } #"*The password of the account must be changed*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. Password has expired."; break } #"*The account is disabled*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. Account is disabled."; break } #"*Login failed for user*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. UserName or Password is incorrect."; break } #Add other wildcard matches here as required default { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName' with Database:'$Database' Error = " + $error[0].Exception} } Then this is what I get in the attached picture
  6. I ran into a problem when I was trying to use a generic field in password validation. It doesn't seem to get through even though its available from the variable list. I even tried to pass on the URL variable which was standard and had the same results. I made a script for password reset with successful results. This is the script I tried without luck. What I'm trying to do is to validate a password for a contained database user. <# .SYNOPSIS Connect to a Microsoft SQL server and validates the password for a local SQL account. .NOTES Requires database connections on in-use Port to be allowed through Firewall #> function Validate-SQLPassword { [CmdletBinding()] param ( [String]$HostName, [String]$InstanceName, [String]$SQLPort, [String]$UserName, [String]$CurrentPassword, [String]$Database = 'master' ) try { #Declare some connection string variables [String]$InstanceNameString = '' [String]$SQLPortString = '' #Construct the Instance Name section of the connection string if required if ($InstanceName -ne '') { $InstanceNameString = '\' + $InstanceName } #Construct the Port Number section of the connection string if required if ($SQLPort -ne '') { $SQLPortString = ',' + $SQLPort } $SQLConnection = New-Object System.Data.SqlClient.SqlConnection $SQLConnection.ConnectionString = "Server=" + $HostName + $InstanceNameString + $SQLPortString + ";User ID=" + $UserName + ";Password=" + $CurrentPassword + ";Initial Catalog=" + $Database + ";" $SQLConnection.Open() $SQLConnection.Close() Write-Output "Success" } catch { switch -wildcard ($error[0].Exception.ToString().ToLower()) { "*A network-related or instance-specific*" { Write-Output "Failed to execute script correctly against Host '$HostName' for the account '$UserName'. Please check SQL details are correct, and that a firewall is not blocking access - default Port is 1433."; break } "*The password of the account must be changed*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. Password has expired."; break } "*The account is disabled*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. Account is disabled."; break } #"*Login failed for user*" { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName'. UserName or Password is incorrect."; break } #Add other wildcard matches here as required default { Write-Output "Failed to validate the password for the SQL account '$UserName' on Host '$HostName' with Database:'$Database' Error = " + $error[0].Exception} } } } #Make a call to the Validate-SQLPassword function Validate-SQLPassword -HostName '[HostName]' -InstanceName '[SQLInstanceName]' -SQLPort '[DatabasePort]' -Username '[UserName]' -CurrentPassword '[CurrentPassword]' -Database '[GenericField1]'
  7. I'm using the latest version 7.7 (Build 7737) When I'm adding a new password to a password list that does not have the password & password strength field shown on it nothing happens. This happens both to old password lists and new. The cause seems to be that the password strength field has the required field grayed out and enabled so it seems to be still in effect even if the field is not shown. This started when I upgraded directly from Version 7.6 (Build 7676) to Build 7737
  8. njordur

    Password discovery - bug of feature?

    Yes this was it thanks a lot for clarifying. About the changelog on the webpage can you update it.
  9. njordur

    Password discovery - bug of feature?

    Ah ok, that must be the case then. I'll try to add the value and see if it pops in.
  10. njordur

    Password discovery - bug of feature?

    This does not work for me i have build 7537. Still creates a new password for a existing password in another password list. Also update the changelog plz.
  11. njordur

    Passwordstate 7.5 (Build 7539) Update

    Seems the changelog web page hasnt been updated since november 18, version 7483. You might want to look at that. I would like to to be aware of the changes made
  12. Maybe I spoke too soon. I just added the same computer again manually with a different instance name and added a password reset task on it. Hopefully this will solve the issue.
  13. I have several SQL servers with multiple instances on them. What would be the best way to do change the password on the instances this as the hosts in passwordstate only provides an option for one instance. Is DNS alias my only option perhaps?
  14. Hi, I'm using v.7.3 (Build 7316) and have restored the latest discovery scripts to the database. I had a problem with one 2012R2 server when discovering the resources on it. The problem had to do with the service account on the server had an SPN record for http. So the get-resources script needed to use the option If ($resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*0x80090322*" -or $resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*The WS-Management service cannot complete the operation within the time specified in OperationTimeout*") But the if statement: If ($resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*0x80090322*" -or $resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*The WS-Management service cannot complete the operation within the time specified in OperationTimeout*") didn't work since this is not the error message I got was different. When I added: If ($resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*0x80090322*" -or $resultsarray.ErrorDetails.Message -like "*Connecting to remote server $HostName failed with the following error message*The WS-Management service cannot complete the operation within the time specified in OperationTimeout*") ... the results from the server came through and was written in passwordstate. Just wanted to let the community know if anyone else had this problem.
  15. njordur

    Get-Resources script

    This is how the script shows the empty string ResourceName when I ran the non-modified script against a server that had these problems (It was a 2008R2 File server): PS C:\scripts\Get-Resources.ps1 [ { "ResourceType": "Windows Service", "ResourceName": "", "UserName": "" }, { "ResourceType": "Scheduled Task", "ResourceName": "DHCP Backup", "UserName": "DOMAIN\\SOMEUSER" } ]
×