问题描述
我还是 PowerShell 的新手。 我在从 Office 365 导出所有 pst 文件时遇到问题,
显示的错误: New-MailBoxExportRequest :术语“New-MailBoxExportRequest”未被识别为 cmdlet、函数、脚本的名称 文件或可运行的程序。检查名称的拼写,或者如果包含路径,请验证路径是否正确并且 再试一次。
这里是我的 PowerShell 脚本
$credential = Get-Credential
Install-Module MSOnline
Connect-MsolService -Credential $credential
Get-Msoluser
$ServerPath="\\KK\Users\"
Get-Msoluser -All |Export-Csv $ServerPath"user.csv"
$Users = Import-Csv $ServerPath"user.csv"
foreach ($User in $Users)
{
Write-Host $User.displayName-ForegroundColor Cyan
$filename = $User.dislayName
New-MailBoxExportRequest -MailBox $User.displayName -FilePath $ServerPath+"$filename.pst"
# Get-MailBoxExportRequestStatistics -Identity $User.displayName | Format-List
}
我使用的是 Windows Powershell ISE 并以管理员身份运行。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)