sbt Posted August 20, 2020 Share Posted August 20, 2020 Hi there, I have created passwordlists via API providing a password list template. The new lists work fine, but I realized that the Password Generator Policy is not being taken from the template. Instead the "Default Password Generator" policy is being used. Is this a general problem? Cheers Sebastian Link to comment Share on other sites More sharing options...
support Posted August 20, 2020 Share Posted August 20, 2020 Hi Sebastian, Can you please share your API Script so we can do some testing with it? Also, can you please confirm what build number of Passwordstate you are using? Thanks Click Studios Link to comment Share on other sites More sharing options...
sbt Posted August 26, 2020 Author Share Posted August 26, 2020 Never mind, the script worked in the customer's environment, so you can close the topic. Here's my powershell function. Function Add-PasswordList { param( [parameter(Mandatory=$true)] [string]$PasswordstateURL, [parameter(Mandatory=$true)] [string]$Passwordlistname, [parameter(Mandatory=$true)] [int]$PasswordlistTemplateID, [parameter(Mandatory=$true)] [int]$PasswordlistAdminGroupID, [parameter(Mandatory=$true)] [int]$PasswordGeneratorID ) if ($PasswordstateURL.EndsWith('/')) { $PasswordstateURL.Remove($PasswordstateURL.Length-1,1) } if ($Passwordlist = Get-PasswordList -PasswordstateURL $PasswordstateURL -Passwordlistname $Passwordlistname) { Write-Error "Passwordlist with the name '$($Passwordlistname)' already exists" return $false } $jsonData = @" { "PasswordList":"$($Passwordlistname)", "Description":"$($Passwordlistname)'s Passwords", "ApplyPermissionsForSecurityGroupID":"$($PasswordlistAdminGroupID)", "Permission":"A", "CopySettingsFromTemplateID":"$PasswordlistTemplateID", "LinkToTemplate":true, "PasswordGeneratorID":"$PasswordGeneratorID", "NestUnderFolderID":"0" } "@ $PasswordstateUrl = "$($PasswordstateURL)/winapi/passwordlists" $PasswordList = Invoke-Restmethod -Method Post -Uri $PasswordstateUrl -ContentType "application/json" -Body $jsonData -UseDefaultCredentials -UseBasicParsing return $PasswordList } $List = Add-PasswordList -PasswordstateURL $PasswordstateURL -Passwordlistname $PasswordStateUser.SamAccountName -PasswordlistTemplateID 13 -PasswordlistAdminGroupID 2 -PasswordGeneratorID 2 Link to comment Share on other sites More sharing options...
support Posted August 27, 2020 Share Posted August 27, 2020 Thanks Sebastian, Glad that's all working now:) Regards, Support. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now