Jump to content

Private Password List for current users


TomJonsson

Recommended Posts

We have just enabled the option "When a new User Account is added to Passwordstate, automatically create a Private Password List for the user" option. However we cannot find an option to retroactively create Private Password Lists for the users already created. Is there such a way or is the only option to ask users to manually create these?

Link to comment
Share on other sites

Hi Tom,

 

We've just thought possibly you could use the API to achieve this.  I have pasted in a script below which will create a Private Password List for one single user called halox\lkels.  Possibly what you could do is get a list of names that you need to create Private Lists for, and loop through those names, putting this script below in a foreach loop.

 

If you have any questions about this, please let me know:

 


$PasswordstateUrl = "https://sandbox.halox.net"
$APIKey = "4ca37695823bdfe9285afe3bc3463453"

 

# Define values for the Password List in below array
$Body = @{
    PasswordList                    = "A Test Password List"
    Description                           = "This short description is for my Test Password List"
    NestUnderFolderID                   = "0"
    APIKey                               = $APIKey
    Guide                               = "This is some test text to be inserted into the guide for this Password List"
    ImageFileName                    = "activedirectory.png"
    AllowExport                        = "True"
    PrivatePasswordList                = "true"
    PreventBadPasswordUse            = "true"
    ApplyPermissionsForUserID       = "halox\lkels"
    Permission                      = "A"
}

 

# Convert Array to Json
$jsonData = $Body | ConvertTo-Json

# Execute the command


$FullUrl = "$PasswordstateUrl/api/passwordlists"
$result = Invoke-Restmethod -Method Post -Uri $FullUrl -ContentType "application/json; charset=utf-8" -Body $jsonData

 

 

 

Regards,

Support.

Link to comment
Share on other sites

  • 1 month later...

Hi Support,

 

I've converted to using WinAPI and have disabled API.  Is it possible to provide the same capability using 'winAPI'?   I've tried it using the following code (signed-in as myself), but get the error  [ Invoke-Restmethod : You do not have permission to view this directory or page ] :

-------------------------------------

  $PasswordstateUrl = 'https://my.url'


  # Define values for the Password List in below array
  $Body = @{
    PasswordList                              = "Test_Private_PasswordList"
    Description                                  = "This short description is for my Test Password List"
    NestUnderFolderID                    = "0"
    Guide                                           = ""
    ImageFileName                         = ""
    AllowExport                                = "True"
    PrivatePasswordList                 = "true"
    PreventBadPasswordUse        = "true"
    ApplyPermissionsForUserID  = "myDomain/myUserId"
    Permission                                = "A"
  }

 

# Convert Array to Json
  $jsonData = $Body | ConvertTo-Json

# Execute the command

  $FullUrl = "$PasswordstateUrl/winapi/passwordlists"
  $result = Invoke-Restmethod -Method Post -Uri $FullUrl -ContentType "application/json; charset=utf-8" -Body $jsonData

  Write-Host "Created PasswordListId [$result.PasswordListID]"

-------------------------------------

 

I'm assuming it is possible through WinAPI and I simply don't have the syntax correct.  

 

Can you confirm this is possibly through WinAPI, and provide me with the correct syntax.

 

Thanks... Scott

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...