Get the location of an object in the console via PowerShell

This script contains a function that gets the location of an object in the console. It will simply output the folder location on screen.

 
 
 
 
 
4.5 Star
(2)
1,638 times
Add to favorites
System Center
11/30/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Did you know that an InstanceKey can have multiple objects associated?
    1 Posts | Last post February 14, 2018
    • This was not a problem with your script per se, which I thank you for, but a problem in my enironment I presume. I ran into two objects that for some odd reason shared the same InstanceKey in the SMS_ObjectContainerItem class. One was a SMS_PAckage object that the PackageID matched the InstanceKey and one was a SMS_Query object where the InstanceKey did not match the QueryID. To work around the issue I ran the $ContainerNode variable through a foreach loop executing the rest of your code, and writing out the Object type.  No longer and issue in CM CB since ObjectPath is a property. Your script helped me move imported items that I could not include in a migration job.