2017-02-13 17 views
0

我只是想創建一個測試應用程序,它可以使用python管理活動api下載AD日誌(專門查找登錄/註銷)。我希望爲此使用客戶端憑證流,並已上傳相同的證書。身份驗證成功,我得到JWT令牌。office365管理活動api沒有內容可供下載

我可以訂閱Azure廣告內容。

GET /api/v1.0/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/activity/feed/subscriptions/list HTTP/1.1 
[{u'status': u'enabled', u'webhook': None, u'contentType': u'Audit.Exchange'}, {u'status': u'enabled', u'webhook': None, u'contentType': u'Audit.AzureActiveDirectory'}] 

但是沒有可供下載的內容。

GET /api/v1.0/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/activity/feed/subscriptions/content?contentType=Audit.AzureActiveDirectory HTTP/1.1 

這產生一個空的答案,200 OK。

我想知道在我的最後能夠下載日誌什麼是缺少的。有沒有人面臨類似的問題?

回答

0

這聽起來像你想donwload Azure的AD的一些審計日誌作爲官方文件Azure Active Directory audit report events表示,由於AAD審計報告事件。

所以你需要按照官方教程Getting started with the Azure Active Directory reporting API來獲得這些審計報告事件。但根據audit api reference,API端點應如下所示,而不是您當前使用的端點。

https://graph.windows.net/contoso.com/activities/audit?api-version=beta

the get started tutorial引用,雖然寫在PowerShell中幾乎示例代碼,有a python sample code,你可以參考一下,然後按照改寫他人在Python容易。

希望它有幫助。任何問題,請隨時讓我知道。

+0

彼得,我正在尋找所有登錄事件,審計日誌沒有這些信息。只有通過signins API(https://graph.windows.net/madzcar.onmicrosoft.com/activities/signinEvents?api-version=beta)報告可疑的登錄信息,這也是開發者版本不具備的高級功能。 https://msdn.microsoft.com/zh-cn/office-365/office-365-management-activity-api-reference#retrieving-content正是我​​所期待的,因爲它爲我提供了所有應用程序下的登錄事件office365。但正如我上面所說,沒有可供下載的內容 – madzcar