Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > Administration > Scripts > Adsi > Create a Global Security Group

ActiveXperts Network Monitor

Quicklinks


NOTE: ActiveXperts Network Monitor supports SNMP based checks. It ships with free SNMP GET and SNMP TRAP utilities. It also offers many SNMP scripts (PowerShell and VBScript). Download Now »


Create a Global Security Group - VBScript sample

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.


Description

Creates a global Active Directory security group named HR-Employees.

Example(s)

Const ADS_GROUP_TYPE_GLOBAL_GROUP = &h2
Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000

Set objOU = GetObject("LDAP://ou=HR,dc=NA,dc=fabrikam,dc=com")
Set objGroup = objOU.Create("Group", "cn=HR-Employees")

objGroup.Put "sAMAccountName", "HRStaff"
objGroup.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP Or _
    ADS_GROUP_TYPE_SECURITY_ENABLED
objGroup.SetInfo