azure - 使用 powershell cmd-let/REST API 获取 Azure AD 审计日志
问题描述
我需要获取有关对目录角色所做更改的信息(例如全局管理员) 我需要详细信息,例如用户名 - A)进行更改的用户,B)时间戳,C)操作 - 将用户添加到组或删除,D ) 已添加用户的组的名称。我在 Azure 门户上更新了 AD 模块,现在我有了 AzureADPreview,并且我正在使用 cmd-let --> Get-AzureADAuditDirectoryLogs
。作为输出,我只能得到:A)B)和C)。我检查了输出中的所有“Id”,但没有找到目录角色 ID。有没有使用提到的 PowerShell 命令捕获此信息的方法-> (D)?下面,我使用的命令:
Get-AzureADAuditDirectoryLogs -Filter "activityDateTime gt 2019-08-25" | where-object activitydisplayname -eq "Add member to group" | fl *
Get-AzureADAuditDirectoryLogs -Filter "activityDateTime gt 2019-09-01" | where-object activitydisplayname -eq "remove member from group"
更新:
我使用 Rest API 来获取所需的信息:
$request = "https://graph.windows.net/xxx.com/activities/audit?api-version=beta"
$authHeader = @{
'Content-Type'='application/json'
'Accept'='application/json'
'Authorization'= ("Bearer $personalToken")
}
$output = Invoke-RestMethod -Uri $request -Method Get -ContentType "application/json" -Headers $authHeader
$output.value
在输出中,仍然看不到有关用户已添加到的组的信息。
解决方案
推荐阅读
- typescript - 打字稿路径在 Express 项目中不起作用
- python - ValueError:传递的项目数错误 2,位置暗示 1
- python - 将每个值的频率分配给具有新列的数据框
- elixir - 实时取景重新加载后消失的选择
- c - 返回 C.CString 时 CGo 段错误
- arrays - 订阅后如何将 JSON 值保存在变量/数组中?
- r - R中带有插入符号的随机森林的多级特征重要性
- r - 谁能在 geom_smooth() 中更详细地解释 preictdf()
- c++ - 将 QPolygon 变成 QPushbutton
- python - 如何以pythonic方式将原始json转换为所需格式