SOLVED

PowerShell Console Issue with Remove-CMDevice

%3CLINGO-SUB%20id%3D%22lingo-sub-8823%22%20slang%3D%22en-US%22%3EPowerShell%20Console%20Issue%20with%20Remove-CMDevice%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8823%22%20slang%3D%22en-US%22%3EThis%20just%20started%20out%20of%20the%20blue%20for%20our%20Citrix%20servers%20-%20we're%20on%201606%3A%20PS%20CAS%3A%5C%26gt%3B%20Remove-CMDevice%20-Name%20Wkstn01%20-Force%20-Verbose%20VERBOSE%3A%20Invoking%20cmdlet%20'Get-CMDevice'%20Remove-CMDevice%20%3A%20System%20error.%20At%20line%3A1%20char%3A1%20%2B%20Remove-CMDevice%20-Name%20Wsktn01%20-Force%20-Verbose%20%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%20%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(Microsoft.Confi...veDeviceCommand%3ARemoveDeviceCommand)%20%5BRemove-CMDevice%5D%2C%20ItemNotFoundException%20%2B%20FullyQualifiedErrorId%20%3A%20ItemNotFound%2CMicrosoft.ConfigurationManagement.Cmdlets.Collections.Commands.RemoveDeviceCommand%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-13772%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Console%20Issue%20with%20Remove-CMDevice%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13772%22%20slang%3D%22en-US%22%3EOK%20so%20my%20work-around%20is%20to%20simply%20limit%20the%20collection%20in%20the%201st%20place%20so%20that%20I%20don't%20have%20to%20be%20full%20admin%20who%20sees%20SMS0001.%20For%20example%2C%20this%20works%20every%20time%20so%20I%20won't%20bother%20to%20ask%20Microsoft%20to%20look%20at%20this%20issue%3A%20Get-CMDevice%20-Name%20PCNAME%20-CollectionId%20PRI0000D%20%7C%20Remove-CMDevice%20-Force%3C%2FLINGO-BODY%3E
Occasional Contributor
This just started out of the blue for our Citrix servers - we're on 1606: PS CAS:\> Remove-CMDevice -Name Wkstn01 -Force -Verbose VERBOSE: Invoking cmdlet 'Get-CMDevice' Remove-CMDevice : System error. At line:1 char:1 + Remove-CMDevice -Name Wsktn01 -Force -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Confi...veDeviceCommand:RemoveDeviceCommand) [Remove-CMDevice], ItemNotFoundException + FullyQualifiedErrorId : ItemNotFound,Microsoft.ConfigurationManagement.Cmdlets.Collections.Commands.RemoveDeviceCommand
1 Reply
best response confirmed by Daniel Martins (Microsoft)
Solution
OK so my work-around is to simply limit the collection in the 1st place so that I don't have to be full admin who sees SMS0001. For example, this works every time so I won't bother to ask Microsoft to look at this issue: Get-CMDevice -Name PCNAME -CollectionId PRI0000D | Remove-CMDevice -Force