Commands › Microsoft Teams

New-CsAgent

Microsoft Teams MicrosoftTeams New-*

Create an AI Agent that can be associated with a Teams Phone Resource Account.

Quick start script

# New-CsAgent — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsAgent
$before | Format-List

# 3. Make the change
New-CsAgent -Name <String> -AIAgentId <String> -AIAgentType <String>

# 4. Verify and diff
$after = Get-CsAgent
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

New-CsAgent -Name <String> -AIAgentId <String> -AIAgentType <String> [-AIAgentTargetTagTemplateId <String>] [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Name String yes The name of the AI Agent.
-AIAgentId String yes The ID of the agent as issued by the AI provider (for example, the Microsoft Copilot Studio agent ID).
-AIAgentType String yes The type of AI Agent provider. Currently supported value: MicrosoftCopilotStudio.
-AIAgentTargetTagTemplateId String Tag Template Id of this AI Agent. If given, this command will validate if the given tag template id exists or not. If the given Id of the tag template does not exist, this command will fail.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.