Share via


Send-MgTeamworkActivityNotificationToRecipient

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Note

To view the beta release of this cmdlet, view Send-MgBetaTeamworkActivityNotificationToRecipient

Syntax

SendExpanded (Default)

Send-MgTeamworkActivityNotificationToRecipient
    [-ResponseHeadersVariable <string>]
    [-ActivityType <string>]
    [-AdditionalProperties <hashtable>]
    [-ChainId <long>]
    [-IconId <string>]
    [-PreviewText <IMicrosoftGraphItemBody>]
    [-Recipients <IMicrosoftGraphTeamworkNotificationRecipient[]>]
    [-TeamsAppId <string>]
    [-TemplateParameters <IMicrosoftGraphKeyValuePair[]>]
    [-Topic <IMicrosoftGraphTeamworkActivityTopic>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-PassThru]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Send

Send-MgTeamworkActivityNotificationToRecipient

    -BodyParameter <IPaths1T8Q21HTeamworkMicrosoftGraphSendactivitynotificationtorecipientsPostRequestbodyContentApplicationJsonSchema>
    [-ResponseHeadersVariable <string>]
    [-Break]
    [-Headers <IDictionary>]
    [-HttpPipelineAppend <SendAsyncStep[]>]
    [-HttpPipelinePrepend <SendAsyncStep[]>]
    [-PassThru]
    [-Proxy <uri>]
    [-ProxyCredential <pscredential>]
    [-ProxyUseDefaultCredentials]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Examples

Example 1: Notify multiple users about pending finance approval requests


Import-Module Microsoft.Graph.Teams

$params = @{
	topic = @{
		source = "entityUrl"
		value = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsAppId}"
	}
	activityType = "pendingFinanceApprovalRequests"
	previewText = @{
		content = "Internal spending team has a pending finance approval requests"
	}
	recipients = @(
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "569363e2-4e49-4661-87f2-16f245c5d66a"
		}
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "ab88234e-0874-477c-9638-d144296ed04f"
		}
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "01c64f53-69aa-42c7-9b7f-9f75195d6bfc"
		}
	)
	templateParameters = @(
		@{
			name = "pendingRequestCount"
			value = "5"
		}
	)
}

Send-MgTeamworkActivityNotificationToRecipient -BodyParameter $params

This example will notify multiple users about pending finance approval requests

Example 2: Notify multiple users about an event using a custom topic


Import-Module Microsoft.Graph.Teams

$params = @{
	topic = @{
		source = "text"
		value = "Deployment Approvals Channel"
		webUrl = "https://teams.microsoft.com/l/message/19:448cfd2ac2a7490a9084a9ed14cttr78c@thread.skype/1605223780000?tenantId=c8b1bf45-3834-4ecf-971a-b4c755ee677d&groupId=d4c2a937-f097-435a-bc91-5c1683ca7245&parentMessageId=1605223771864&teamName=Approvals&channelName=Azure%20DevOps&createdTime=1605223780000"
	}
	activityType = "deploymentApprovalRequired"
	previewText = @{
		content = "New deployment requires your approval"
	}
	templateParameters = @(
		@{
			name = "deploymentId"
			value = "6788662"
		}
	)
	recipients = @(
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "569363e2-4e49-4661-87f2-16f245c5d66a"
		}
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "ab88234e-0874-477c-9638-d144296ed04f"
		}
		@{
			"@odata.type" = "microsoft.graph.aadUserNotificationRecipient"
			userId = "01c64f53-69aa-42c7-9b7f-9f75195d6bfc"
		}
	)
}

Send-MgTeamworkActivityNotificationToRecipient -BodyParameter $params

This example will notify multiple users about an event using a custom topic

Parameters

-ActivityType

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AdditionalProperties

Additional Parameters

Parameter properties

Type:System.Collections.Hashtable
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-BodyParameter

To construct, see NOTES section for BODYPARAMETER properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IPaths1T8Q21HTeamworkMicrosoftGraphSendactivitynotificationtorecipientsPostRequestbodyContentApplicationJsonSchema
Supports wildcards:False
DontShow:False

Parameter sets

Send
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Break

Wait for .NET debugger to attach

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
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

-ChainId

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Parameter properties

Type:System.Int64
Default value:0
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
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
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

-Headers

Optional headers that will be added to the request.

Parameter properties

Type:System.Collections.IDictionary
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-HttpPipelineAppend

SendAsync Pipeline Steps to be appended to the front of the pipeline

Parameter properties

Type:

Microsoft.Graph.PowerShell.Runtime.SendAsyncStep[]

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

-HttpPipelinePrepend

SendAsync Pipeline Steps to be prepended to the front of the pipeline

Parameter properties

Type:

Microsoft.Graph.PowerShell.Runtime.SendAsyncStep[]

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

-IconId

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Returns true when the command succeeds

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
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

-PreviewText

itemBody To construct, see NOTES section for PREVIEWTEXT properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IMicrosoftGraphItemBody
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Proxy

The URI for the proxy server to use

Parameter properties

Type:System.Uri
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

-ProxyCredential

Credentials for a proxy server to use for the remote call

Parameter properties

Type:System.Management.Automation.PSCredential
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

-ProxyUseDefaultCredentials

Use the default credentials for the proxy

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
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

-Recipients

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Parameter properties

Type:

Microsoft.Graph.PowerShell.Models.IMicrosoftGraphTeamworkNotificationRecipient[]

Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseHeadersVariable

Optional Response Headers Variable.

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False
Aliases:RHV

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TeamsAppId

Send activity feed notifications to multiple users, in bulk. For more information, see sending Teams activity notifications.

Permissions

Permission type Permissions (from least to most privileged)
Delegated (work or school account) TeamsActivity.Send,
Delegated (personal Microsoft account) Not supported
Application TeamsActivity.Send.User, TeamsActivity.Send,

Parameter properties

Type:System.String
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TemplateParameters

To construct, see NOTES section for TEMPLATEPARAMETERS properties and create a hash table.

Parameter properties

Type:

Microsoft.Graph.PowerShell.Models.IMicrosoftGraphKeyValuePair[]

Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Topic

teamworkActivityTopic To construct, see NOTES section for TOPIC properties and create a hash table.

Parameter properties

Type:Microsoft.Graph.PowerShell.Models.IMicrosoftGraphTeamworkActivityTopic
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Parameter properties

Type:System.Management.Automation.SwitchParameter
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.

Inputs

Microsoft.Graph.PowerShell.Models.IPaths1T8Q21HTeamworkMicrosoftGraphSendactivitynotificationtorecipientsPostRequestbodyContentApplicationJsonSchema

{{ Fill in the Description }}

System.Collections.IDictionary

{{ Fill in the Description }}

Outputs

System.Boolean

{{ Fill in the Description }}

Notes

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODYPARAMETER <IPaths1T8Q21HTeamworkMicrosoftGraphSendactivitynotificationtorecipientsPostRequestbodyContentApplicationJsonSchema>: . [(Any) <Object>]: This indicates any property can be added to this object. [ActivityType <String>]: [ChainId <Int64?>]: [IconId <String>]: [PreviewText <IMicrosoftGraphItemBody>]: itemBody [(Any) <Object>]: This indicates any property can be added to this object. [Content <String>]: The content of the item. [ContentType <String>]: bodyType [Recipients <IMicrosoftGraphTeamworkNotificationRecipient[]>]: [TeamsAppId <String>]: [TemplateParameters <IMicrosoftGraphKeyValuePair[]>]: [Name <String>]: Name for this key-value pair [Value <String>]: Value for this key-value pair [Topic <IMicrosoftGraphTeamworkActivityTopic>]: teamworkActivityTopic [(Any) <Object>]: This indicates any property can be added to this object. [Source <String>]: teamworkActivityTopicSource [Value <String>]: The topic value. If the value of the source property is entityUrl, this must be a Microsoft Graph URL. If the value is text, this must be a plain text value. [WebUrl <String>]: The link the user clicks when they select the notification. Optional when source is entityUrl; required when source is text.

PREVIEWTEXT <IMicrosoftGraphItemBody>: itemBody [(Any) <Object>]: This indicates any property can be added to this object. [Content <String>]: The content of the item. [ContentType <String>]: bodyType

TEMPLATEPARAMETERS <IMicrosoftGraphKeyValuePair[]>: . [Name <String>]: Name for this key-value pair [Value <String>]: Value for this key-value pair

TOPIC <IMicrosoftGraphTeamworkActivityTopic>: teamworkActivityTopic [(Any) <Object>]: This indicates any property can be added to this object. [Source <String>]: teamworkActivityTopicSource [Value <String>]: The topic value. If the value of the source property is entityUrl, this must be a Microsoft Graph URL. If the value is text, this must be a plain text value. [WebUrl <String>]: The link the user clicks when they select the notification. Optional when source is entityUrl; required when source is text.