将组添加到Active Directory VB.NET中的组 [英] Adding group to a group in Active Directory VB.NET

查看:92
本文介绍了将组添加到Active Directory VB.NET中的组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我遇到一个代码vb.net的问题,它会返回消息:



System.DirectoryServices.DirectoryServicesCOMException(0x80072035):服务器不愿意处理请求。



此代码:



Hi,

I'm having problem with one code vb.net that returns the message:

"System.DirectoryServices.DirectoryServicesCOMException (0x80072035): The server is unwilling to process the request."

This code:

Dim g1 As String = "DL_GROUP1"
Dim g2 As String = "DL_GROUP2"
Dim group As New DirectoryEntry("LDAP://" & GetDNGroup(g2))

group.Properties("memberOf").Add(GetDNGroup(g1))
group.CommitChanges()





但使用此表格时代码运行没有问题:





but when using this form the code running without problems:

Dim g1 As String = "DL_GROUP1"
Dim g2 As String = "DL_GROUP2"

Dim group As New DirectoryEntry("LDAP://" & GetDNGroup(g1))
group.Properties("member").Add(GetDNGroup(g2))
group.CommitChanges()





使用此属性memberOf极为重要。



最好的问候,
$ b $bJoãoPaulo



Is of extreme importance the use this properties "memberOf".

Best Regards,
João Paulo

推荐答案

你可以'修改 memberOf 。它是ReadOnly,计算属性,而不是属性。



您必须添加要添加到目标组的成员的ADSPath。这与您现在正在进行的操作相反,即将目标组添加到组的memberOf列表中。
You can't modify memberOf. It's a ReadOnly, calculated attribute, not a property.

You have to add the ADSPath of the member you want to add to the target group. This is opposite from what you're doing now, which is to add the target group to the memberOf list of a group.


这篇关于将组添加到Active Directory VB.NET中的组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆