0

我正在使用 Microsoft 的 o365 REST API 客户端库 ( https://github.com/Microsoft/o365rwsclient ) 并且已经能够使许多 API 调用正常工作,但我对“SPOOneDriveForBusinessFileActivity”没有任何运气。另外,我没有看到它在https://reports.office365.com/ecp/reportingwebservice/reporting.svc的 o365 Web 服务原子提要中做广告

以下是事件应返回的描述:https: //support.office.com/en-gb/article/Understanding-the-User-activity-logs-report-80d0b3b1-1ee3-4777-8c68-6c0dedf1f980

查看https://github.com/Microsoft/o365rwsclient/blob/master/TenantReport/SPOOneDriveForBusinessFileActivity.cs中的源代码,它似乎是一个有效的函数,但是当从 ac# 应用程序(下)使用 o365rwsclient 库时,我得到了404 错误(未找到 URL)。

有什么想法吗?此报告是否已实施(Powershell cmdlet 或直接 REST 调用也可以接受)- 如果是,我如何访问它?

using Microsoft.Office365.ReportingWebServiceClient;
using System;

namespace O365ReportingDataExport
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            ReportingContext context = new ReportingContext();
            //If you enter invalid authentication information, Visual Studio will throw an exception.
            context.UserName = @"PUT YOUR OFFICE 365 USER EMAIL ADDRESS HERE";
            context.Password = @"PUT YOUR OFFICE 365 USER PASSWORD HERE";
            //FromDateTime & ToDateTime are optional, default value is DateTime.MinValue if not specified
            context.FromDateTime = DateTime.MinValue;
            context.ToDateTime = DateTime.MinValue;
            context.SetLogger(new CustomConsoleLogger());

            IReportVisitor visitor = new CustomConsoleReportVisitor();

            ReportingStream stream1 = new ReportingStream(context, "SPOOneDriveForBusinessFileActivity", "stream1");
            //Calls VisitReport 
            stream1.RetrieveData(visitor);

            Console.WriteLine("Press Any Key...");
            Console.ReadKey();
        }

        private class CustomConsoleLogger : ITraceLogger
        {
            public void LogError(string message)
            {
                Console.WriteLine(message);
            }

            public void LogInformation(string message)
            {
                Console.WriteLine(message);
            }
        }

        private class CustomConsoleReportVisitor : IReportVisitor
        {
            public override void VisitBatchReport()
            {
                foreach (ReportObject report in this.reportObjectList)
                {
                    VisitReport(report);
                }
            }

            public override void VisitReport(ReportObject record)
            {
                Console.WriteLine("Record: " + record.Date.ToString());
            }
        }
    }
}
4

1 回答 1

0

在与 Microsoft 的 O365 支持团队交谈后,似乎能够在 OneDrive for Business 中查看文件活动是一项仍在内部测试中(因此能够在其 REST API 中查看)尚未部署的功能。

于 2015-03-31T19:46:27.007 回答