ImportCollections

<< Click to Display Table of Contents >>

ImportCollections

Imports one or more PDQ Inventory collections from an exported XML file or a directory of export files. Use this command to restore collections from a backup or deploy standardized collection definitions across multiple PDQ Inventory instances.

Syntax

PDQInventory ImportCollections -Path <path> [-Overwrite]

Parameters

Parameter

Required

Description

-Path <path>

Yes

Path to a collection export file (.xml) or a directory containing export files. When a directory is specified, all .xml files in that directory are imported.

-Overwrite

No

Replaces existing collections (matched by name) with the imported definitions. Without this flag, collections that already exist are skipped and logged.

Exit Codes

Exit Code

Meaning

0

Command completed successfully.

1

One or more collections failed to import.

3

No importable files found at the specified path.

Examples

Import collections from a single file:

PDQInventory ImportCollections -Path C:\Exports\Windows10.xml

Import all collection files from a directory:

PDQInventory ImportCollections -Path C:\Exports

Import and replace any existing collections with the same name:

PDQInventory ImportCollections -Path C:\Exports -Overwrite

Check the exit code in a PowerShell script:

PDQInventory ImportCollections -Path C:\Exports\Windows10.xml

if ($LASTEXITCODE -eq 0) {

 Write-Host "Import completed successfully."

} elseif ($LASTEXITCODE -eq 1) {

 Write-Warning "One or more collections failed to import. Check output for details."

}

NOTE: Importing collections requires the Modify Collections RBAC permission. All import operations are recorded in the audit log, including whether each collection was newly created or overwritten.

 

 

 

© 2026 PDQ.com Corporation. All rights reserved.

PDQ.com is a trademark of PDQ.com Corporation. All other product and company names are the property of their respective owners.

Help Version: 20.0.22.0