Generating Lists of Computer Names with PowerShell

PowerShell is particularly good for automating tasks that need to be performed on multiple computers, and many cmdlets are designed to allow multiple computer names to be specified. In many cases, the most difficult task is getting together a list of computers to use with some of the cmdlets and scripts available. There are several []

Quest PowerShell Cmdlet Cheat Sheet

Getting through the inital learning curve of using PowerShell for administration tasks can be frustrating. This is especially true when someone is on the phone waiting for a password reset and you’re reading through the online help or flipping through a book. I’ve had enough of these situations that I created a quick reference with []

Adding Domain Groups to Local Administrators Group with PowerShell

A common way to add domain groups to the local administrators group on a computer is with the net command. This worked well for me until I ran into groups with names longer than 20 characters. That’s right, the NET.EXE /ADD command does not support names longer than 20 characters. If net localgroup /add is []

Query Active Directory with PowerShell

This function queries Active Directory for users matching the specified parameter and generates a PSObject with certain properties from the returned objects. The collection of returned objects can be piped to additional PowerShell cmdlets for sorting, formatting or exporting.

The script can be called, the function placed in a profile or the script can []

Exporting Exchange Global Address List to Excel with VBScript

This vbscript exports an Exchange GAL to an Excel spreadsheet. The important line to change is objCommand.CommandText which must be modified to reflect your Active Directory domain and the address book field you want to search for. Any information about the user object can be retrieved by additional modification of the script. An example of []

Creating computer accounts in Active Directory

At my organization, users have one computer they log into. To help keep track of who was on what computer, we put our user’s names in the description of each computer account. This becomes a little labor intensive when we get a shipment of new computers to be deployed, so of course we automate computer []

Add Domain User or Domain Group to Local Administrators Group

This script will add a domain user or group to the local administrators group of a remote computer. Make sure to change YourDomain to your WinNT domain name. Also change Administrators if you need to add the user or group to a different local group.

To use at a command prompt: add_admin.vbs [computer] [user] []

Creating Lists of Computer Names

Very often you will want to run a script against a list of computers. I’ve found that the most flexible way is to grab computer names from a text file. When your scripts pull input information from a text file, there are many options available for how you create that text file. This vbscript will []

Creating AD computer accounts from a CSV

This is an updated script that creates computer accounts in Active Directory. This script uses a comma separated values file as an input instead of two text files.