【问题标题】:Add-ADGroupMember cannot find global groupsAdd-ADGroupMember 找不到全局组
【发布时间】:2012-08-15 13:40:36
【问题描述】:

我正在运行一个简单的命令:

导入-CSV $myfile | ForEach=Object {Add-AdGroupMember -Identity $mygroup -Members $_.Alias}

如果我所指的组是通用的,它可以工作,但如果它是全球的,则不行。是否需要使用开关来使其找到全局组?

【问题讨论】:

    标签: powershell active-directory


    【解决方案1】:

    我会尝试这样的:

    $myGroup = Get-ADGroup ... #Play with the search scope, etc until you can get $myGroup set.  It's a better cmdlet for searching for groups because of those options.
    

    使用此页面了解更多详细信息:http://technet.microsoft.com/en-us/library/ee617196 - 然后,一旦 $mygroup 是您想要的,下一行就可以正常工作,或者可以修改为:

    Import-CSV $myfile | % {$myGroup | Add-AdGroupMember -Members $_.Alias}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      • 1970-01-01
      • 2017-06-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-29
      • 2017-03-25
      相关资源
      最近更新 更多