AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Register-SSMTaskWithMaintenanceWindow-TaskArn <String>-AlarmConfiguration_Alarm <Alarm[]>-Lambda_ClientContext <String>-CloudWatchOutputConfig_CloudWatchLogGroupName <String>-CloudWatchOutputConfig_CloudWatchOutputEnabled <Boolean>-RunCommand_Comment <String>-CutoffBehavior <MaintenanceWindowTaskCutoffBehavior>-Description <String>-RunCommand_DocumentHash <String>-RunCommand_DocumentHashType <DocumentHashType>-Automation_DocumentVersion <String>-RunCommand_DocumentVersion <String>-AlarmConfiguration_IgnorePollAlarmFailure <Boolean>-StepFunctions_Input <String>-MaxConcurrency <String>-MaxError <String>-Name <String>-StepFunctions_Name <String>-NotificationConfig_NotificationArn <String>-NotificationConfig_NotificationEvent <String[]>-NotificationConfig_NotificationType <NotificationType>-RunCommand_OutputS3BucketName <String>-RunCommand_OutputS3KeyPrefix <String>-Automation_Parameter <Hashtable>-RunCommand_Parameter <Hashtable>-Lambda_Payload <Byte[]>-Priority <Int32>-Lambda_Qualifier <String>-LoggingInfo_S3BucketName <String>-LoggingInfo_S3KeyPrefix <String>-LoggingInfo_S3Region <String>-ServiceRoleArn <String>-RunCommand_ServiceRoleArn <String>-Target <Target[]>-TaskParameter <Hashtable>-TaskType <MaintenanceWindowTaskType>-RunCommand_TimeoutSecond <Int32>-WindowId <String>-ClientToken <String>-Select <String>-PassThru <SwitchParameter>-Force <SwitchParameter>-ClientConfig <AmazonSimpleSystemsManagementConfig>
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AlarmConfiguration_Alarms |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_Automation_DocumentVersion |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_Automation_Parameters |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_CloudWatchOutputConfig_CloudWatchLogGroupName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_CloudWatchOutputConfig_CloudWatchOutputEnabled |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_Lambda_ClientContext |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_Lambda_Payload |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_Lambda_Qualifier |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | MaxErrors |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_NotificationConfig_NotificationArn |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_NotificationConfig_NotificationEvents |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_NotificationConfig_NotificationType |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_Comment |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_DocumentHash |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_DocumentHashType |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_DocumentVersion |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_OutputS3BucketName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_OutputS3KeyPrefix |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_Parameters |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_ServiceRoleArn |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_RunCommand_TimeoutSeconds |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_StepFunctions_Input |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskInvocationParameters_StepFunctions_Name |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | Targets |
Required? | True |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | TaskParameters |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
$parameters = @{}
$parameterValues = New-Object Amazon.SimpleSystemsManagement.Model.MaintenanceWindowTaskParameterValueExpression
$parameterValues.Values = @("Install")
$parameters.Add("Operation", $parameterValues)
Register-SSMTaskWithMaintenanceWindow -WindowId "mw-03a342e62c96d31b0" -ServiceRoleArn "arn:aws:iam::123456789012:role/MaintenanceWindowsRole" -MaxConcurrency 1 -MaxError 1 -TaskArn "AWS-RunShellScript" -Target @{ Key="InstanceIds";Values="i-0000293ffd8c57862" } -TaskType "RUN_COMMAND" -Priority 10 -TaskParameter $parameters
f34a2c47-ddfd-4c85-a88d-72366b69af1bThis example registers a task with a maintenance window using an instance ID. The output is the Task ID.
$parameters = @{}
$parameterValues = New-Object Amazon.SimpleSystemsManagement.Model.MaintenanceWindowTaskParameterValueExpression
$parameterValues.Values = @("Install")
$parameters.Add("Operation", $parameterValues)
register-ssmtaskwithmaintenancewindow -WindowId "mw-03a342e62c96d31b0" -ServiceRoleArn "arn:aws:iam::123456789012:role/MaintenanceWindowsRole" -MaxConcurrency 1 -MaxError 1 -TaskArn "AWS-RunShellScript" -Target @{ Key="WindowTargetIds";Values="350d44e6-28cc-44e2-951f-4b2c985838f6" } -TaskType "RUN_COMMAND" -Priority 10 -TaskParameter $parameters
f34a2c47-ddfd-4c85-a88d-72366b69af1bThis example registers a task with a maintenance window using a target ID. The output is the Task ID.
$parameters = [Collections.Generic.Dictionary[String,Collections.Generic.List[String]]]::new()
$parameters.Add("commands",@("ipconfig","dir env:\computername"))
$parameters.Add("executionTimeout",@(3600))
$props = @{
WindowId = "mw-0123e4cce56ff78ae"
ServiceRoleArn = "arn:aws:iam::123456789012:role/MaintenanceWindowsRole"
MaxConcurrency = 1
MaxError = 1
TaskType = "RUN_COMMAND"
TaskArn = "AWS-RunPowerShellScript"
Target = @{Key="WindowTargetIds";Values="fe1234ea-56d7-890b-12f3-456b789bee0f"}
Priority = 1
RunCommand_Parameter = $parameters
Name = "set-via-cmdlet"
}
Register-SSMTaskWithMaintenanceWindow @props
f1e2ef34-5678-12e3-456a-12334c5c6cbeThis example creates a parameter object for the run command document AWS-RunPowerShellScript and creates a task with given maintenance window using target ID. The return output is the task ID.
$automationParameters = @{}
$automationParameters.Add( "instanceId", @("{{ TARGET_ID }}") )
$automationParameters.Add( "AutomationAssumeRole", @("{arn:aws:iam::111111111111:role/AutomationRole}") )
$automationParameters.Add( "SnapshotTimeout", @("PT20M") )
Register-SSMTaskWithMaintenanceWindow -WindowId mw-123EXAMPLE456`
-ServiceRoleArn "arn:aws:iam::123456789012:role/MW-Role"`
-MaxConcurrency 1 -MaxError 1 -TaskArn "CreateVolumeSnapshots"`
-Target @{ Key="WindowTargetIds";Values="4b5acdf4-946c-4355-bd68-4329a43a5fd1" }`
-TaskType "AUTOMATION"`
-Priority 4`
-Automation_DocumentVersion '$DEFAULT' -Automation_Parameter $automationParameters -Name "Create-Snapshots"This example registers an AWS Systems Manager Automation task by using a document namedCreate-Snapshots
.
AWS Tools for PowerShell: 2.x.y.z