1. Home
  2. Docs
  3. Scense Embedded Scripting...
  4. Scense Scripting Examples
  5. Active Directory

Active Directory

Sample script using Active Directory Service Interfaces

Add active directory group to local administrators group

This script will add the specified domain group to the workstations’ Administrators group.
The script uses the ‘Workstation’ service.

Sub Scense_Main()
    Dim dsGrp

    'Bind to the local administrators group
    Set dsGrp = GetObject("WinNT://" & Workstation.ComputerName & "/Administrators,group")

    'Add the AD group
    dsGrp.Add ("WinNT://MYDOMAIN/MYGROUP,group")

    'Clean up
    Set dsGrp = Nothing
End Sub