Remove-MSModuleItems
Remove (delete) a list of Apps,Users,Devices etc. Use the -UnDelete switch to Undelete instead When a item is Deleted is moved in a Delete queue to be deleted at a later date. Deleting these items again with the -AllowRealDelete will truly delete them from MS.
Syntax
Remove-MSModuleItems -Module (String) -Ids (Int32[]) [-AllowRealDelete] [-UnDelete]
Examples
## Delete a list of Applications (add to delete queue)
Remove-MSModuleItems -Module Applications -Ids @(1000,1001,1002)
## Undelete a list of Applications
Remove-MSModuleItems -Module Applications -Ids @(1000,1001,1002) -UnDelete
## Force a real delete of the Applications. The first cmd adds them to the delete queue, the second forces the delete to be processed right away
Remove-MSModuleItems -Module Applications -Ids @(1000,1001,1002)
Remove-MSModuleItems -Module Applications -Ids @(1000,1001,1002) -AllowRealDelete