Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I used the following code to apply a policy violation, and it is working fine:
public static void PolicyViolation(string chatId, string messageId)
{
try
{
GraphServiceClient graphClient = StaticVariables.GetGraphServiceClientAsync();
ChatMessage updatedMessage = new ChatMessage();
updatedMessage.PolicyViolation = new ChatMessagePolicyViolation()
{
PolicyTip = new ChatMessagePolicyViolationPolicyTip()
{
GeneralText = "Custom Text to block message",
MatchedConditionDescriptions = new List<string>() { "Global (Org-wide default)" }
},
DlpAction = ChatMessagePolicyViolationDlpActionTypes.BlockAccess,
VerdictDetails = ChatMessagePolicyViolationVerdictDetailsTypes.AllowFalsePositiveOverride,
};
var result1 = graphClient.Chats[chatId].Messages[messageId].PatchAsync(updatedMessage).Result;
Console.WriteLine("Policy Violation Applied.");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
This code gives me the option to "Report this message and send" within Microsoft Teams, please find snapshot for the same PolicyViolation.png. However, when I do this, I don’t receive any alert or email as an admin.
Where do we receive notifications when a user reports these policy-violated messages to the admin?
An API that connects multiple Microsoft services, enabling data access and automation across platforms