【发布时间】:2020-12-27 00:07:55
【问题描述】:
我正在尝试清除 365 组的成员资格,但删除命令不接受通配符,因此选择使用“get-user”并将其放入“foreach”中。然而这个错误。你能帮忙吗?
#get list
$users = Get-UnifiedGroupLinks –Identity "testgroup" -LinkType Members
#empty list
foreach($user in $users){
Remove-UnifiedGroupLinks –Identity "testgroup" –LinkType "Members" –Links $user
}
错误
Cannot process argument transformation on parameter 'Links'. Cannot convert value "System.Collections.ArrayList" to type "Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]". Error: "Cannot
convert the "Mr User" value of type "Deserialized.Microsoft.Exchange.Data.Directory.Management.ReducedRecipient" to type "Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter"."
+ CategoryInfo : InvalidData: (:) [Remove-UnifiedGroupLinks], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-UnifiedGroupLinks
+ PSComputerName : outlook.office365.com
【问题讨论】:
-
刚接触 SO 你可能不知道这一点,但习惯于点击左侧的 ✓ 图标 accept the answer that solved your problem。这将有助于其他有类似问题的人更轻松地找到它,并有助于激发人们回答您的问题。
标签: powershell office365 exchange-server