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
3 years agoExport 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 th...
Former Member
3 years agoI started to get somewhere with these commands but its still being a bit of a pain and randomly giving me these errors in the screenshot. There are about 4200 entries in this Vault and I KNOW API limits are likely an issue, so I added the start-sleep after each one, to avoid it. It might be too much of a timer, but I am trying to get all the results back.
```
function Get-1passworditems {
[CmdletBinding()]
param ([Parameter(Mandatory=$true)][string]$vaultuuid)
#Set Console Encoding
#Ensure variables are empty and ready to go
$results = @()
$data =@()
$item = @()
$export = @()
$vaultname = @()
#Get Initial list of item uuids
$results = op item list --vault $vaultuuid --format=json
$vaultname = op vault get $vaultuuid
#Convert from JSON to powershell objects
$data = $results | ConvertFrom-Json
foreach($item in $data){
$obj = @()
$name = op item get $item.id --vault $vaultuuid --field username
$obj = New-Object psobject -Property @{
Username = $name
UUID = $data.id
Title = $data.title
}
$export += $obj
Start-Sleep -Seconds 10
}
Export-Excel -Path C:\Scripts\Results\1password_logins.xlsx -WorksheetName $vaultname.Name -Append -AutoSize -AutoFilter -FreezeTopRow
}
```