Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all articles
Browse latest Browse all 306

New Post: Trying to remove "Pending deletion" items cause a lot of (yellow) warnings

$
0
0

I'm not sure about the set-scsmobject cmdlet you are using, however when we want to remove an object for immediate purging, we use remove-scsmobject.

As far as being able to populate your $deletedobjects variable, I looked at the object status of one of our objects in the deleted items folder, and it has an objectstatus of "Pending Delete", so your script looks correct.

Also, you are pulling every config item in the system.configitem class before filtering. It would be better (and faster) if you add a filter before passing the result to the where-object cmdlet. This would look like this:

Get-SCSMObject -class $class -filter "objectstatus -match Pending"

Can you try to select just one of your pending delete objects and see if you still see those warnings? You might try something like " $deletedobject = get-scsmobject -class $class -filter "displayname -eq enterobjectdisplayname" "


Viewing all articles
Browse latest Browse all 306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>