Get-ADPrincipalGroupMembership -Identity not accepting variable

后端 未结 1 1096
醉酒成梦
醉酒成梦 2021-01-25 11:53

Working in a few different domains, that have different naming schema\'s. So I\'m writing a script that goes into each domain, and checks on their group membership.

Firs

1条回答
  •  借酒劲吻你
    2021-01-25 11:55

    Format-* cmdlets were made for displaying data to a user. Do not use them when further processing of the data is required/intended.

    Change

    ... | select samaccountname | Format-Table -HideTableHeaders | Out-String
    

    to

    ... | select -Expand samaccountname -First 1
    

    and your problem will disappear.

    0 讨论(0)
提交回复
热议问题