Tuesday, July 14, 2009

Scripting - List all user accounts in AD domain

This script lists all objects in the domain that are user objects.

Option Explicit

Dim oDomain, oObject

Set oDomain = GetObject("WinNT://domain.local")

For Each oObject in oDomain
If oObject.Class = "User" Then
WScript.Echo oObject.Name
End If

No comments:

Post a Comment