我正在使用微软的o365 REST客户端库(https://github.com/Microsoft/o365rwsclient),并且能够让许多API调用正常工作,但在"SPOOneDriveForBusinessFileActivity“方面没有任何进展。而且,我没有在o365的https://reports.office365.com/ecp/reportingwebservice/reporting.svc web服务原子提要中看到它的广告。
查看https://github.com/Microsoft/o365rwsclient/blob/master/TenantReport/SPOOneDriveForBusinessFileActivity.cs中的源代码,它似乎是一个有效的函数,但是当使用来自c#应用程序的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());
}
}
}
}发布于 2015-03-31 19:46:27
在与微软的O365支持团队交谈后,可以看到OneDrive for Business中的文件活动似乎是一个尚未部署的内部测试特性(因此能够在REST中看到它)。
https://stackoverflow.com/questions/28995574
复制相似问题