Restore-SCSMDeletedItem
Restores items that were previously marked for deletion in Service Manager.
Syntax
Default (Default)
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.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | System.Management.Automation.SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-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.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Core.Cmdlets.Instances.EnterpriseManagementInstance[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PassThru
Indicates that this cmdlet returns the restored item. You can pass this object to other cmdlets.
Parameter properties
Type: | System.Management.Automation.SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | System.Management.Automation.SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
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.