Already a NinjaOne customer? Log in to view more guides and the latest updates.

PowerShell: Ninja-Property-Docs-Names

Topic

This article explains how to use Ninja-Property-Docs-Names to retrieve the ID or name of documents associated with a template id.

If you use the NinjaOne PowerShell Module outside of an automation script, you may need to adjust PowerShell's execution policy. For more information about execution policies, refer to Microsoft's documentation: about Execution Policies (external link).

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 2

When 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 Access

When 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: False

Inputs

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.

Automation read permissions are required to retrieve any custom field value. For information about permissions for custom fields refer to NinjaOne Custom Fields: Getting Started.

Additional Resources

For more information about asset management and custom scripting, refer to the following resources:

FAQ

Next Steps