我目前的问题是,当我想将组添加到组时,它会给我一个ParameterBindingException。这是我目前所拥有的:
$MissingGroup = 'GGroup01'
$getADGroupSplat = @{
# find all groups where `$MissingGroup` is NOT a member of
LDAPFilter = '(!memberof={0})' -f (Get-ADGroup $MissingGroup).DistinguishedName
SearchBase = 'OU=xxxxxxxxxxx,DC=xxxxxxxxxxxxx,DC=xx'
}
$Group = Get-ADGroup @getADGroupSplat
$actualGroup = $Group | Where-Object {$_.Name -like "GGroup_A0*_Security"} | Format-List Name
Add-ADGroupMember -Identity $MissingGroup -Members $actualGroup
有人能帮帮我吗
错误是:
Add-ADGroupMember : Der Parameter "Members" kann nicht gebunden werden. Objekt vom Typ "Microsoft.ActiveDirectory.Management.ADPrincipal. Der Adapter kann den Wert
der Name-Eigenschaft nicht festlegen." kann nicht erstellt werden.
In Zeile:1 Zeichen:61
+ ... -ADGroup -Identit $CitrixGG | Add-ADGroupMember -Members $actualGroup
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Add-ADGroupMember], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.ActiveDirectory.Management.Commands.AddADGroupMember
错误是德语。
1条答案
按热度按时间hc8w905p1#
问题是
Format-List
。是用来把数据写到屏幕上的。下面是更新后的代码: