Name: Get List of Machines from Active Directory Security Group
Description: This script queries Active Directory and retrieves a list of machines contained in a given security group.
Category: Group Policy
Target Type: Console
Script Version: 220.127.116.11
Prerequisites: Windows Server 2008 R2 or Windows 7
Modifies the target machine: No
Minimum ITScripts engine version required: 18.104.22.168
Inputs: The name of the Active Directory (AD) security group, the output file name and location, and the AD server name (optional)
Outputs: Writes a list of computer names from the security group to a text file.
Possible Operations Monitor results include:
"WMI connection to the target machine failed. Access is denied."
"WMI connection to the target machine failed. The machine may be offline or firewalled."
"gpoName is required. Please provide a gpoName."
"fileOutputLocation is required. Please provide a fileOutputLocation."
"fileOutputLocation (<file location>) is either an invalid path or the file name extension is not a.txt file. Please enter a valid file path. (example: C:somedirectoryoutputfilename.txt)"
"You cannot save the output file to C:Windows or its subfolders. Please enter a valid file path. (example: "C:somedirectoryoutputfilename.txt")"
"<AD Server> is not a string input"
"A problem occured querying active directory. Error message: <error details>"
"No results were found. Error message: <error details>"
"No computer objects found under <gpoName>."
"Success: <filelocation> has been created."
"Success: <filelocation> has been updated."