Archive for the ‘WMI’ Category

Active Directory quick queries

Saturday, January 31st, 2015

Here is reference to a few quick AD queries.

Dump of AD:

List of Domain Controllers:

List of FSMO holders:

List of Global Catalog holders:

List of Sites:

Site where myDC belongs:

List of preffered bridgeheads:

Domain Controller which authenticated my:

All users:

Total number of users:

All active users:

Locked users:

VBS scripts to query everything

Wednesday, December 24th, 2014

There are a few simple scripts developed by me to automate somehow regular reporting against set of servers. Result is usually presented in csv file to use it quickly in Excel or similar calculation software.

Scripts to query WMI:

Script to report installed roles and features:

getRoles.zip

usage: cscript /nologo getRoles.vbs servers.txt

Example of input file: servers.txt

Example of output file: getRoles_26-09-2014_12-30-14.csv

Script to report info about installed services:

getServices.zip

usage: cscript /nologo getServices.vbs servers.txt

Example of input file: servers.txt

Example of output file: getServices_19-11-2013_07-30-15.csv

Script to report information about capacity of local disks:

getCapacity.zip

usage: cscript /nologo getCapacity.vbs servers.txt

Example of input file: servers.txt

Example of output file: getCapacity_01-10-2013_13-01-51.csv

Script to report activation status:

getActivationStatus.zip

usage: cscript /nologo getActivationStatus.vbs servers.txt

Example of input file: servers.txt

Example of output file: getActivationStatus_17-06-2013_10-12-18.csv

Script to report about sharings:

getSharings.zip

usage: cscript /nologo getSharings.vbs servers.txt

Example of input file: servers.txt

Example of output:

Scripts to query registry:

Script to report installed software:

getSoftware.zip

usage: cscript /nologo getSoftware.vbs servers.txt

Example of input file: servers.txt

Example of output file: getSoftware_12-06-2013_13-51-58.csv

Script to report status of WSUS:

getWSUS.zip

usage: cscript /nologo getWSUS.vbs servers.txt

Example of input file: servers.txt

Example of output:

Scripts to query LDAP:

Script to enumarate groups where user, specified in input file, belongs to directly (nesting level = 0) and indirectly (nesting level > 0):

getMemberOf.zip

usage: cscript /nologo getMemberOf.vbs users.txt

Example of input file: users.txt

Example of output:

Feel free to use them.