是的,可以将未发布的Microsoft Teams连接器归属于租户而非个人所有。以下是一个示例代码:
Connect-PnPOnline -Url "https://.sharepoint.com" -Credentials (Get-Credential)
$property = @{
Title = "My Teams Connector";
WebhookUrl = "https://example.com";
WebhookResourceId = "00000000-0000-0000-0000-000000000000";
WebhookDisplayName = "Test Webhook";
PublisherId = "00000000-0000-0000-0000-000000000000";
CategoryId = "00000000-0000-0000-0000-000000000000";
IsIncoming = $true;
SupportsFiles = $true;
CardFormattingRenderModes = "Compact";
CardFormattingTemplates = @{
"1.0" = @{
SchemeName = "tds";
IconUrl = "https://example.com/logo.png";
Body = @{
AdditionalProperties = @{
contentType = "application/vnd.microsoft.card.adaptive";
content = @{
$schema = "http://adaptivecards.io/schemas/adaptive-card.json";
type = "AdaptiveCard";
body = @(
@{
type = "TextBlock";
text = "Hello World!";
}
);
};
};
};
};
};
}
Add-PnPTeamsTeamConnector -Title $property.Title -ConnectorProperty $property -Scope Team
在上述示例中,团队连接器被归属于团队租户而非个人。这可以通过在Add-PnPTeamsTeamConnector cmdlet中使用“-Scope Team”参数来实现。