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-SCSMDeleteItem cmdlet restores items that were previously marked for deletion in Service Manager.

Parameters

-DeletedItem<EnterpriseManagementInstance[]>

Specifies an instance of the deleted item to restore. It is an object returned from the Get-SCSMDeletedItem cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-PassThru

Specifies the output object that represents the restored item. This output object can be passed 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 of the Restore-SCSMDeleteItem cmdlet. 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 --------------------------

These commands restore the Printer7 item that was previously marked for deletion. The first command displays the item, and the second command restores that item.

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

-------------------------- EXAMPLE 2 --------------------------

This command restores an item which was previously marked for deletion and displays the item that has just been restored.

PS C:\>Get-SCSMDeletedItem -DisplayName “Printer7”|Restore-SCSMDeletedItem -pass

Get-SCSMDeletedItem