Freigeben über


Restore-SCSMDeletedItem

Restore-SCSMDeletedItem

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

Syntax

Parameter Set: Default
Restore-SCSMDeletedItem [-DeletedItem] <EnterpriseManagementInstance[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

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

Parameters

-DeletedItem<EnterpriseManagementInstance[]>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-PassThru

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • 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

The output type is the type of the objects that the cmdlet emits.

  • None.

    This cmdlet does not generate any output.

Examples

Example 1: Restore a previously deleted item

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.

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

Example 2: Restore a previously deleted item and display results

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.

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

Get-SCSMDeletedItem