The first command gets a class named Microsoft.AD.Printer by using the Get-SCSMClass cmdlet, and then stores it in the $PrinterClass variable.
The second command creates a message for the email, and stores it in the $Message variable.
This example uses the same string as the subject and the body of the email.
The third command gets a management pack in which to save this template by using the Get-SCSMManagementPack cmdlet, and then stores it in the $ManagementPack variable.
The fourth and fifth commands store values for language and encoding in the $Language and $Encoding variables.
The final command creates an email template that applies when a change occurs to a printer.
The command uses values that were created in the first five commands.
Parameters
-Body
Specifies the message body, which can include insertion strings.
Parameter properties
Type:
System.String
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
-Class
Specifies the name of the class that the email template targets.
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.
Parameter properties
Type:
System.String[]
Default value:
Localhost
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
-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
-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.
Parameter properties
Type:
System.Management.Automation.PSCredential
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
-Description
Specifies a description for the email template.
Parameter properties
Type:
System.String
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
-DisplayName
Specifies the name of the email template.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Encoding
Specifies the encoding to be used in the message.
Parameter properties
Type:
System.Text.Encoding
Default value:
Unicode (UTF-8)
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
-Language
Specifies the language for the message.
Parameter properties
Type:
System.Globalization.CultureInfo
Default value:
English (United States)
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
-ManagementPack
Specifies the name of the management pack in which this cmdlet stores the email template.
Specifies that this cmdlet causes the email to be sent as HTML.
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
-Subject
Specifies the subject for the email message.
Parameter properties
Type:
System.String
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
-TemplateCollection
Specifies a collection of hash tables which represent the email template.
The hash table must have the following keys:
Body.
This is a string which represents the body of the template.
Subject.
This is a string which represents the subject of the email.
Language.
This must be of type CultureInfo.
It represents the language for the message.
If you specify multiple hash tables, you cannot use the same value for Language.
Parameter properties
Type:
System.Collections.Hashtable[]
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
-Urgency
Specifies the urgency of the email message.
Valid values are:
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.