使用 powershell cmd-let/REST API 获取 Azure AD AuditLogs
Get Azure AD AuditLogs using powershell cmd-let/REST API
我需要获取有关对目录角色(例如全局管理员)所做更改的信息group 或 remove,D) 已添加用户的组的名称。我在 Azure 门户上更新了 AD 模块,现在我有 AzureADPreview,我正在使用 cmd-let --> Get-AzureADAuditDirectoryLogs
。作为输出,我只能得到:A) B) 和 C)。我检查了输出中的所有 "Id",但没有找到目录角色 ID。是否有捕获此信息的方法 --> (D) 使用提到的 PowerShell 命令?下面,我使用的命令:
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
并且在输出中仍然没有看到有关用户已添加到的组的信息。
不知道为什么没有返回群名。
但组的对象 ID 将显示在结果中。
使用Get-AzureADGroup -ObjectId {Object ID}
获取其名称信息。
我需要获取有关对目录角色(例如全局管理员)所做更改的信息group 或 remove,D) 已添加用户的组的名称。我在 Azure 门户上更新了 AD 模块,现在我有 AzureADPreview,我正在使用 cmd-let --> Get-AzureADAuditDirectoryLogs
。作为输出,我只能得到:A) B) 和 C)。我检查了输出中的所有 "Id",但没有找到目录角色 ID。是否有捕获此信息的方法 --> (D) 使用提到的 PowerShell 命令?下面,我使用的命令:
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
并且在输出中仍然没有看到有关用户已添加到的组的信息。
不知道为什么没有返回群名。
但组的对象 ID 将显示在结果中。
使用Get-AzureADGroup -ObjectId {Object ID}
获取其名称信息。