Using Powershell and the SDK, this script will allow you to change the management state of nodes, interfaces, or applications, and updates a custom property [Unmanaged_Reason] for each element.
Create the Unmanaged_Reason property on each element
Update the file page [$importfile] to point to your CSV file, or update the script to call it.
Description (Also in the script header):
# Toggles the management status of Nodes, Interfaces, or Applications (SAM).
#
# Usage: .\UnmanToggle_3.ps1 < unman | man > -ManReason "reason for unman" -hours [hours to unmanage, override csv]
# ManReason and hours is optional.
# If no ManReason, reason will be "No Reason Provided"
# If no hours, then hours will be used form csv. This is used to override what's in the csv only.
# Requirements: Custom property [Unmanaged_Reason] applied to nodes, interfaces, and applications.
#
# csv format:
# elementType,elementID,hours
This will check the state of the element, and then process the task for each element in the csv file, either managing it or unmanaging it, and choosing an appropriate action for updating the custom property, or flushing it out depending on the state of that element.