Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

Former Member's avatar
Former Member
3 years ago

Export specific data from vault

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