Skip to main content
June 29, 2022
Question

Export specific data from vault

  • June 29, 2022
  • 14 replies
  • 786 views

Hello, any help would be greatly appreciated on this. I have to export a list of logins from a specific Vault as part of a divestiture with the company I work for. I have been attempting to pull the data in a way that I get the Title and the Username for now (I will need to export this to a csv but need to get the data returned for now). However, I cannot get the data I am wanting.

```
function Get-1passworditems {
[CmdletBinding()]
param ([Parameter(Mandatory=$true)][string]$vaultuuid)

#Set Console Encoding
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8

#Ensure variables are empty and ready to go
$results = @()
$id =@()
$data =@()
$item = @()

#Get Initial list of item uuids
$results = op item list --vault $vaultuuid --format=JSON

#Convert from JSON to powershell objects

#$data = $results | ConvertFrom-Json

$id = $results.id

Write-Host "Starting foreach" -ForegroundColor Green
foreach($item in $id){
    $item
    & $op item get $item --vault $vaultuuid --field username
}

}
```
If I attempt to convert the data using ConvertFrom-JSON (as per another discussion I saw here), I get all kinds of errors. I know there is something I am missing here, but am not sure what. Attempts to use the desktop app to export that specific vault is not working in a way that I can safely say its specific to that vault and not a full export of the 40+ vaults we have.


1Password Version: Desktop 8.7.3, CLI 2.5.1
Extension Version: Not Provided
OS Version: Win 10
Browser:_ Not Provided

14 replies

July 6, 2022

Thanks @jwilson5607

We're going to start looking into this by trying to reproduce it on a Windows binary on a vault with many items. After some digging around, it turns out we've had the same error reported on another Windows system user with lots of items in their vault - so you are not alone in seeing this error.

I am not quite sure if you have a timeline on fixing this error due to the divesture from your current company, but because the fix for this error is quite undefined at this point, I would advise trying to circumvent the error by adding a longer sleep, or trying to use op on a different platform, like mac or linux OSs for example.

July 8, 2022

The code I executed on my personal MacBook ran flawlessly. It seems that the 1password CLI in Windows is flawed to the point I have issue using it - which is disappointing because my team is PC only. I look forward to the fix to the Windows libraries so that i can utilize this on my work PC moving forward.

July 13, 2022

Thank you for your detailed diagnostics and your time!
We have an internal ticket tracking all the reports that we receive, related to this.
We'll make sure to post an update as soon as we'll have any developments on this.

Best,
Horia

December 16, 2022

Just wanted to drop by to let you know that we have just released v2.11.0 of 1Password CLI, which should address this issue. See https://developer.1password.com/docs/cli/reference/update/ for instructions on how to update.

Let us know if you are still having issues with v2.11.0 or later.