Compare Active Directory and System Center Configuration Manager Active Devices
Applies to: Windows PowerShell 3.0+, SCCM
The purpose of this script is to check a list of computers provided by a text file against Active Directory and System Center Configuration Manager to determine whether or not they are active. You might use this script if you manage System Center Configuration Manager and frequently need to validate devices that are active in both Active Directory and System Center Configuration Manager.
To use this script we’ll need to place valid values for all the parameters called after the function in line 57 of the script. The information we’ll require is; the server name of the system center configuration manager server, the site code used by that configuration manager server and the location of the text file that contains the computer names you wish to check. The text file should contain one computer name per line for the script to work. Modify line 57 to match your environment, below is an example. The computer running this script requires both the Active Directory Module and System Center Configuration Manager Module be available.