Get-SCSMEmailTemplateContent

Retrieves the content of Service Manager email templates.

Syntax

Get-SCSMEmailTemplateContent
   [-EmailTemplate] <EmailTemplate[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCSMEmailTemplateContent cmdlet retrieves the content of Service Manager email templates.

Examples

Example 1: Display template contents

C:\PS>Get-SCSMEmailTemplateContent -EmailTemplate (Get-SCObjectTemplate -Name AssignedToUserNotificationTemplate) | Where-Object {$_.language -eq "en"}
Language             Subject                        Body
--------             -------                        ----
en                   Incident assigned: $Context/Pr Dear $Context/Path[Relationship='WorkItem!System.WorkItemAsP
                     operty[Type='WorkItem!System.W ignedToUser' SeedRole='Source' TypeConstraint='System!System
                     orkItem']/Id$                  .Domain.User']/Property[Type='System!System.Domain.User']/Fi
                                                    rstName$,
                                                    The following incident has been assigned to you: 
                                                    Incident ID: $Context/Property[Type='WorkItem!System.WorkIte
                                                    m']/Id$
                                                    Target Resolution Time: $Context/Property[Type='CoreIncident
                                                    !System.WorkItem.Incident']/TargetResolutionTime$
                                                    Priority: $Context/Property[Type='WorkItem!System.WorkItem.T
                                                    roubleTicket']/Priority$
                                                    Affected User: $Context/Path[Relationship='WorkItem!System.W
                                                    orkItemAffectedUser' SeedRole='Source' TypeConstraint='Syste
                                                    m!System.Domain.User']/Property[Type='System!System.Domain.U
                                                    ser']/UserName$
                                                    Category: $Context/Property[Type='CoreIncident!System.WorkIt
                                                    em.Incident']/Classification$
                                                    This is an automated e-mail generated by System Center Servi
                                                    ce Manager.

This command retrieves the content of the AssignedToUserNotificationTemplate template, and then displays the English version of that content.

Required Parameters

-EmailTemplate

Specifies an instance of a ManagementPackObjectTemplate for which to retrieve content.

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

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:None
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
-SCSession

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

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

Inputs

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate

You can pipe an email template to the EmailTemplate parameter. You can obtain an EmailTemplate by using the Get-SCSMEmailTemplate cmdlet.

Outputs

ManagementPackElement#System.Notification.Template.SMTP#Content