[英]How do I use the Get-MgReportTeamUserActivityUserDetail Graph Powershell command?
I'm trying to work out how I can automate some Teams activity reports using the Get-MgReportTeamUserActivityUserDetail PowerShell Graph SDK cmdlet我正在尝试弄清楚如何使用 Get-MgReportTeamUserActivityUserDetail PowerShell Graph SDK cmdlet 自动生成一些 Teams 活动报告
https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.reports/get-mgreportteamuseractivityuserdetail?view=graph-powershell-1.0 https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.reports/get-mgreportteamuseractivityuserdetail?view=graph-powershell-1.0
I'm stumped on a couple of things我对几件事感到困惑
How should I be using the -OutFile parameter?我应该如何使用 -OutFile 参数?
The basic command I'm running is this (creds left blank intentionally....)我正在运行的基本命令是这个(creds 故意留空....)
Import-Module Microsoft.Graph.Reports
$Cert = "xxx"
$ClientID = "xxx"
$TenantID = "xxx"
Connect-MgGraph -ClientID $ClientID -TenantID $TenantID -CertificateThumbprint $Cert
Get-MgReportTeamUserActivityUserDetail -Period "D7" -Outfile "c:\users\x\documents\x.csv"
Thoughts?想法?
I'd then want to get this into an automation runbook to grab the report on a set basis but am getting stuck well before that?: :)然后我想把它放到一个自动化运行手册中,以便在设定的基础上获取报告,但在那之前我就卡住了?::)
I ran a similar command and it worked as expected.我运行了一个类似的命令,它按预期工作。
The command expects you to pass the path that already exists and not the file, the file name you specify here would be automatically created.该命令希望您传递已存在的路径而不是文件,您在此处指定的文件名将自动创建。 if the file already exists then it will override.
如果文件已经存在,那么它将覆盖。
Lastly, make sure the environment you are running has the appropriate permissions like read and write the directory in which you are trying to save the file最后,确保您正在运行的环境具有适当的权限,例如读取和写入您尝试保存文件的目录
Get-MgReportTeamUserActivityUserDetail -Period "D7" -Outfile "C:\Users\myname\Documents\testx.csv" Get-MgReportTeamUserActivityUserDetail -Period "D7" -Outfile "C:\Users\myname\Documents\testx.csv"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.