Get-SCSMEmailTemplate

Retrieves email templates that are defined in Service Manager.

Syntax

Get-SCSMEmailTemplate
   [-Description <String>]
   [[-DisplayName] <String>]
   [-ManagementPack <ManagementPack>]
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCSMEmailTemplate cmdlet retrieves email templates that are defined in Service Manager. The type of the returned object is ManagementPackObjectTemplate. This cmdlet returns only objects of the class SMTP.

Examples

Example 1: Get all templates

C:\PS>Get-SCSMEmailTemplate
DisplayName          Description          ManagementPack       TimeAdded            LastModified
-----------          -----------          --------------       ---------            ------------
Assigned To User Not Use for notification Service Manager Inci 12/2/2010 12:22:15 A 12/3/2010 12:56:15 A
ification Template   s sent to the user w dent Management Conf M                    M

                     ho is assigned the i iguration Library
                     ncident
End User Notificatio Use for notification Service Manager Inci 12/2/2010 12:22:15 A 12/3/2010 12:01:50 A
n Template           s sent to end users  dent Management Conf M                    M
                                          iguration Library
Assigned To User Not Use for notification Service Manager Chan 12/2/2010 12:21:55 A 12/2/2010 12:21:55 A
ification Template   s sent to the user w ge Management Config M                    M
                     ho is assigned the c uration Library
                     hange request
Escalation Notificat Use for notification Service Manager Inci 12/2/2010 12:22:15 A 12/3/2010 12:01:50 A
ion Template         s sent when an incid dent Management Conf M                    M
                     ent is escalated     iguration Library

This command retrieves all email templates from Service Manager.

Example 2: Display names and targeted classes

C:\PS>Get-SCSMEmailTemplate | Format-Table -Property DisplayName,TargetClass -AutoScale
DisplayName                            TargetClass
-----------                            -----------
Assigned To User Notification Template System.WorkItem.Incident
End User Notification Template         System.WorkItem.Incident
Assigned To User Notification Template System.WorkItem.ChangeRequest
Escalation Notification Template       System.WorkItem.Incident
Printer Email Template                 Microsoft.AD.Printer

This command retrieves the email templates, and passes them to the Format-Table cmdlet. That cmdlet displays the display name and the targeted class for the templates. The results could be passed to the New-SCSMSubscription cmdlet.

Optional Parameters

-ComputerName

Specifies the name of the computer on which the System Center Data Access service runs. The user account that is specified in the Credential parameter must have access rights to the specified computer.

Type:String[]
Position:Named
Default value:Localhost
Accept pipeline input:False
Accept wildcard characters:False
-Credential

Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs. The specified user account must have access rights to that server.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies the description of the email template to retrieve.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

Specifies the display name of the email template to retrieve.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ManagementPack

Specifies the management packs in which email templates to retrieve are defined.

Type:ManagementPack
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SCSession

Specifies an object that represents the session to a Service Manager management server.

Type:Connection[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None.

You cannot pipe input to this cmdlet.

Outputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate

This cmdlet returns email template objects.