如何在 Active Directory 中为用户添加分发组?

发布于 2024-09-05 19:20:35 字数 123 浏览 1 评论 0原文

如何从 Active Directory 中的 Powershell 添加分发组?

我在活动目录中有用户,我想将用户添加到特定组中,而不是去服务器,因为该部分将被外包。

那么如何为特定用户添加分发组。

How to add the distrubtion group from Powershell in Active Directory ?

I have user in active directory and i want to add the user into particular group rather than going and server because that part is going to be outsourced.

so how to add the distrubution group for particular user.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦情居士 2024-09-12 19:20:35

这是基本代码:

$group = [adsi]"LDAP://CN=Group1,OU=Groups,DC=domain,DC=com"
$group.member.Add('CN=User1,OU=Users,DC=domain,DC=com')
$group.SetInfo()

Here's the basic code:

$group = [adsi]"LDAP://CN=Group1,OU=Groups,DC=domain,DC=com"
$group.member.Add('CN=User1,OU=Users,DC=domain,DC=com')
$group.SetInfo()

天赋异禀 2024-09-12 19:20:35

如果您有可用的 ActiveDirectory 模块,“Add-ADGroupMember”在这里很有用。 Powershell 3.0 及更高版本默认提供此功能。使用 Get-Help 了解语法。

'Add-ADGroupMember' is useful here if you have ActiveDirectory module available. Powershell 3.0 and later have it available by default. Use Get-Help for syntax.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文