Topic
This article explains how to use Ninja-Property-Docs-Names to retrieve the ID or name of documents associated with a template id.
Environment
- NinjaOne
- Microsoft PowerShell
Description
The Ninja-Property-Docs-Names cmdlet retrieves the ID or name of documents associated with a template id. You can specify the document template using the -TemplateId parameter. The cmdlet returns the ID or name of the document(s) associated with the specified template id in the format <id>=<name> .
Syntax
Ninja-Property-Docs-Names [[-TemplateId] <Object>] [<CommonParameters>]
Examples
Example 1: List of Pages
PS C:> Ninja-Property-Docs-Names -TemplateId "11"
10=Document 1
11=Document 2When a document template contains multiple documents, the cmdlet returns the ID and
name of each document associated in the format <id>=<name> .
Example 2: Single Document
PS C:> Ninja-Property-Docs-Names -TemplateId "4"
5=Remote AccessWhen a single document is associated with a document template, the cmdlet returns the ID
and name of just the individual document in the format <id>=<name> .
Parameters
TemplateId
Specify the ID of the document template containing the documents you want to retrieve.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseInputs
System.String
This cmdlet does not accept input from the pipeline. The -TemplateId parameter accepts string values representing the ID of the document template containing the documents you want to retrieve.
Outputs
System.String[]
The cmdlet returns the ID and name of the document(s) associated with the specified template id in the format <id>=<name> as a string or an array of strings if more than one document is associated with the template.
Additional Resources
For more information about asset management and custom scripting, refer to the following resources: