How to delete asset tag values manually

Last Modified

Thu Dec 29 16:30 GMT 2022

Description

  • There are some cases where the asset tag tool is not working on the device, this article details the locations and removal of the tags if required.

Environment

  • N-able N-central

Solution

  • There are 3 asset tag values that needs to be deleted or removed:
    • WMI
    • Registry
    • File Value
  • The NcentralAssetTool.exe is found in the following location:
    • C:\Program Files (x86)\N-able Technologies\Windows Agent\bin\NcentralAssetTool.exe
      • NOTE: If this is not on the device, please copy this over from a working device.
  • To clear out the asset tags, please do the following:
    1. Open Command Prompt as administrator
    2. Run the following commands:
      • cd 'C:\Program Files (x86)\N-able Technologies\Windows Agent\bin'
      • NcentralAssetTool.exe -d
  • This should output something similar to:
    • -----------------------------------------[Delete Operation Start]
      Delete Operation Detected Delete WMI is [True]
      Delete Operation Detected Delete Registry is [True]
      Delete Operation Detected Delete File is [True]
      ---------------Asset Tag Values After Deletion----------------------
      WMI Value = []
      Registry Value = []
      File Value = []
      -----------------------------------------[Delete Operation End]
  • Please see below for the WMI location if you need to find them manually:
    • Namespace: /root/cimv2/NcentralAsset
    • Class: NcentralAssetTag
  • Please see below for the registry location:
    • Location: HKEY_LOCAL_MACHINE\SOFTWARE\N-able Technologies\NcentralAsset
    • Key : NcentralAsstTag
  • Please see below for the xml location:
    • C:\Program Files (x86)\N-able Technologies\NcentralAsset.xml

Script Alternative

You also may use the following script to achieve this:

Disclaimer: Please note, if any items or other contains set forth herein is derived from N-able N-central, any items or other content posted are provided as a suggestion or recommendation to you for your internal use. This is not part of the N-able N-central software or services that you have purchased from N-able N-central, and the information set forth herein may come from third party customers. Your organization should internally review and assess to what extent, if any, such custom items or recommendations will be incorporated into your environment. Any custom scripts obtained herein are provided to you "AS IS" without indemnification, support, or warranty of any kind, express or implied. You elect to utilize the custom scripts at your own risk, and you will be solely responsible for the incorporation of the same, if any.

function clearWMI() {

$class='NCentralAssetTag'

$namespace='root\cimv2\NCentralAsset'

try {

$wmiAssetTag = Get-WmiObject -Namespace $namespace -Class $class -ErrorAction Stop | Remove-WmiObject

}

catch {

write-host $_

}

If ($null -eq $wmiAssetTag) {

write-host "N-central Asset Tag no longer exists in WMI."

} Else {

Remove-WmiObject $wmiAssetTag

write-host "WMI entry cleared."

}

}

function clearReg() {

$path='HKLM:\SOFTWARE\N-able Technologies\NcentralAsset'

$name='NcentralAssetTag'

try {

$regAssetTag = Get-ItemProperty -Path $path -Name $name -ErrorAction Stop

}

catch {

write-host $_
} 

If ($null -eq $regAssetTag) {

write-host "N-central Asset Tag no longer exists in the registry."

} Else {

Remove-ItemProperty -Path $path -Name $name -Force

write-host "Registry entry cleared."

}

}

function clearFile() {

If (Test-Path -LiteralPath "C:\Program Files (x86)\N-able Technologies\NcentralAsset.xml") {

try {

Remove-Item -path "C:\Program Files (x86)\N-able Technologies\NcentralAsset.xml" -ErrorAction Stop

}

catch {

write-host $_

}

write-host "The xml file was removed."

} Else {

write-host "The xml file does not exist."

}

}


function main() {

clearWMI

clearReg

clearFile
}

main