Topic
This article explains how to use Options-NinjaTag to list all possible system tags for a device.
Environment
- NinjaOne
- Microsoft PowerShell
Description
The Options-NinjaTag cmdlet retrieves a list of all possible system tags that can be
assigned to a device. This cmdlet must be executed within a Ninja automation script to access the tag information.
Syntax
Options-NinjaTag [<CommonParameters>]
Examples
Example 1: Retrieve from Automation Script
PS C:> Options-NinjaTag
IIS
Stuff
Fax Server
Data Deduplication
File Server
ADDS
DNS
ESU Eligible
DFS ReplicationAll possible system tags for a device are listed in the output. The actual tags assigned to the device can be retrieved using the Get-NinjaTag cmdlet.
Example 2: Retrieve from Active Terminal
PS C:> Options-NinjaTag
Options-NinjaTag : Access to tags is possible only from automation script
At line:1 char:1
+ Options-NinjaTag
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : FromStdErr: (:) [Write-Error],
WriteErrorException
+ FullyQualifiedErrorId :
Microsoft.PowerShell.Commands.WriteErrorException,Options-NinjaTagTags are only retrievable from an automation script, so an error message is returned when attempting to run the cmdlet in an active terminal session.
Parameters
Title
text
Title
text
Common Parameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and WarningVariable.For more information about common parameters, refer to Microsoft document about_CommonParameters (external link).
Inputs
None
Outputs
System.String[]
When executed, this cmdlet returns an array of strings representing all possible system tags that can be assigned to a device.
Additional Resources
For more information about asset management and custom scripting, refer to the following resources:
- NinjaOne: Index of PowerShell Commands and Articles
- Getting Started with NinjaOne Device Tags
- Use API and CLI with NinjaOne Device Tags
- Command Line Interface (CLI)
- Assigning Devices as Documentation Delegates
- Reading from or Writing to Documentation: Automation, CLI, and API
- Command Line Interface (CLI): Supported Fields and Functionality
- NinjaOne Custom Fields: Getting Started