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

PowerShell: Ninja-Property-Clear

Topic

This article explains how to use Ninja-Property-Clear to clear the value of a specified custom field.

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-Clear cmdlet clears the value of a specified custom field. You can specify the field name using the -Name parameter. The cmdlet will remove any existing value from the custom field, effectively resetting it to an empty state.

Only fields with automation write permissions can be reset using this cmdlet. The custom field value will be cleared after the next successful sync with the NinjaOne platform, which typically occurs within a few minutes.

Syntax

Ninja-Property-Clear [[-Name] <Object>] [<CommonParameters>]

Examples

Example 1: Clear a Text Custom Field

PS C:> Ninja-Property-Clear -Name "exampleTextField"

The text field is cleared after the next successful sync with the NinjaOne platform, which
typically occurs within a few minutes.

Parameters

-Name

Specify the name of the custom field you want to clear.

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 -Name parameter accepts a string
value representing the name of the custom field to clear.

Outputs

None

  • Automation read permissions are required to clear any custom field value. For information about permissions for custom fields, refer to NinjaOne Custom Fields: Getting Started.
  • The custom field value will be cleared after the next successful sync with the NinjaOne
    platform, which typically occurs within a few minutes.

Additional Resources

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

FAQ

Next Steps