Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell对法规遵从性搜索执行操作_Powershell - Fatal编程技术网

Powershell对法规遵从性搜索执行操作

Powershell对法规遵从性搜索执行操作,powershell,Powershell,我创建了一个新的合规性搜索,并启动了合规性搜索,现在我想对该合规性搜索执行一个操作以清除结果。然而,我不断得到的标志清除是不可用的 PS C:\WINDOWS\system32> New-ComplianceSearchAction -Purge -PurgeType SoftDelete -SearchName "TEST delete a meeting" A parameter cannot be found that matches parameter name 'Purge'.

我创建了一个新的合规性搜索,并启动了合规性搜索,现在我想对该合规性搜索执行一个操作以清除结果。然而,我不断得到的标志清除是不可用的

 PS C:\WINDOWS\system32> New-ComplianceSearchAction -Purge -PurgeType SoftDelete -SearchName "TEST delete a meeting"
A parameter cannot be found that matches parameter name 'Purge'.
    + CategoryInfo          : InvalidArgument: (:) [New-ComplianceSearchAction], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-ComplianceSearchAction
    + PSComputerName        : nam05b.ps.compliance.protection.outlook.com
我还尝试按照下面的检查对标志重新排序,仍然是相同的错误:

PS C:\WINDOWS\system32> New-ComplianceSearchAction -SearchName "TEST delete a meeting" -Purge -PurgeType "SoftDelete"
A parameter cannot be found that matches parameter name 'Purge'.
    + CategoryInfo          : InvalidArgument: (:) [New-ComplianceSearchAction], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-ComplianceSearchAction
    + PSComputerName        : nam05b.ps.compliance.protection.outlook.com
    enter code here

老问题,但我会回答它,以防它能帮助其他路过的人

错误“找不到与参数名称匹配的参数…”可能会产生误导。如果您的语法正确(您的语法正确),则通常意味着您没有足够的权限运行该commandlet的操作。根据answers.microsoft上的问题:

要删除邮件,个人必须是组织的成员 管理角色组或被分配搜索和清除管理 角色

更多细节

你可能会想,“为什么它不直接告诉我我没有权限?”当你明白为什么会出现这个错误时,它就变得更有意义了。请记住,您的会话无法查看(由于缺少更好的术语)您没有权限访问的参数或commandlet。因此,根据您尝试执行的操作,PowerShell可能会告诉您“这不是一个有效的命令”或“这不是一个有效的参数”,而事实上这些命令和参数都是有效的,如果您没有运行它的权限,您的会话将无法看到它们。如果您在O365 PowerShell会话中连接到错误的URI(例如outlook URI而不是法规遵从性URI),也会发生这种情况