PowerShell v2.0+将计算机添加到域全局组



我使用的是PowerShell 2.0版本,想知道如何将域计算机添加到域全局组中。

我也想知道是否有一个好的网站去,有V2命令和例子。

我知道这有点晚了,但是,您可以使用PowerShellActive Directory模块在PowerShell 2.0中做到这一点:

Import-Module activedirectory
$globalGroup = "Your_Global_Group"
$computerName = "Your Computer Name"
$computerObj = Get-ADComputer $computerName -properties *
Add-ADGroupMember -Identity $globalGroup -Members $computerObj.DistinguishedName

注意:您需要打开Active Directory windows功能才能使用activedirectory模块。这可以在windows功能中的"远程服务器管理工具"选项卡下找到。

链接:对于AD模块中的Cmdlet的

最新更新