Configuring a group type for a new Active Directory entry in VB.NET

I am trying to set the group type for a new Active Directory entry through VB.NET and DirectoryServices to create a distribution list.

How do I access ADS_GROUP_TYPE enumerations?

In particular, I am after ADS_GROUP_TYPE_GLOBAL_GROUP.

+3
source share
3 answers

You are right, you cannot access transfers.

Oddly enough, this constant should not be an object, you can make it int32 -

Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = & H2

0
source

Add a link to com ActiveDS Dll and import the namespace using ActiveDS, after which you will get the above enumeration value.

+1

I don’t think I can access the enumerations through .NET, so instead I created the specific constant that I needed. What is my code worth for:

        Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2
        adNewGroup.Properties("groupType").Value = ADS_GROUP_TYPE_GLOBAL_GROUP

Refactoring is welcome!

0
source

Source: https://habr.com/ru/post/1696403/


All Articles