Restore-SCSMDeletedItem

Restores items that were previously marked for deletion in Service Manager.

Syntax

Restore-SCSMDeletedItem
       [-DeletedItem] <EnterpriseManagementInstance[]>
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Restore-SCSMDeletedItem cmdlet restores items that were previously marked for deletion in Service Manager.

Examples

Example 1: Restore a previously deleted item

PS C:\>Get-SCSMDeletedItem -DisplayName "Printer7" | Restore-SCSMDeletedItem

This command gets the previously marked for deletion item that has the display name Printer7 by using Get-SCSMDeletedItem. The command passes it to the current cmdlet by using the pipeline operator. That command restores the item.

Example 2: Restore a previously deleted item and display results

PS C:\>Get-SCSMDeletedItem -DisplayName "Printer7" | Restore-SCSMDeletedItem -PassThru
UNCName                PrinterName Description Location
-------                ----------- ----------- --------
\\PrintServer\Printer7 Printer7                Seattle

This command gets the previously marked for deletion item that has the display name Printer7 by using Get-SCSMDeletedItem. The command passes it to the current cmdlet by using the pipeline operator. That command restores the item. The command specifies the PassThru parameter. The command returns the restored item.

Required Parameters

-DeletedItem

Specifies an instance of the deleted item to restore. To obtain an EnterpriseManagementInstance object to use with this cmdlet, use the Get-SCSMDeletedItem cmdlet.

Type:EnterpriseManagementInstance[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Indicates that this cmdlet returns the restored item. You can pass this object to other cmdlets.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance

You can pipe a deleted item to the DeletedItem parameter. For example, the object that is returned by the Get-SCSMDeletedItem cmdlet.

Outputs

None.

This cmdlet does not generate any output.