首页 > 解决方案 > Azure Automation: Run PowerShell after AD user added

问题描述

I'm reviewing Azure Automation, but I couldn't find out if it is possible to run a PowerShell script whenever a new user is added to Active Directory? The scenario I'm researching is whenever a new Office365 account is added through admin.microsoft.com then I want to configure some email preferences for this user. I have my PowerShell script tested already (so these preferences should be set correctly), but now I'm trying to find out how exactly this script should be executed right after account is added.

Thanks,

标签: azurepowershellactive-directoryazure-active-directoryazure-automation

解决方案


您可以检查 Azure AD 审核日志以创建新用户。您可以将诊断设置(日志)导出到 Azure Monitor(请参阅文档)。

以下是一个想法,但我自己从未尝试过:在 Azure Monitor -> Logs 中,您可以找到例如此查询:

在此处输入图像描述

根据您的需要对其进行修改并创建警报规则。在警报规则中,您可以设置一个操作组,以使用 PowerShell 脚本触发您的自动化帐户。


推荐阅读