Archive for category Windows Scripting

DSQuery Operating System Service Pack Version

I had a requirement recently to get the service pack versions for all workstations on the domain. I tried a few different options but the easiest option was to use the extremely useful dsquery tool.

Without further ado, this is the command:

dsquery * -scope subtree -attr “cn” “operatingSystem” “operatingSystemServicePack”  -filter “(&(objectclass=computer)(objectcategory=computer)(operatingSystem=Windows XP*))” -limit 100000

The output of this command would be as follows:

cn                 operatingSystem                      operatingSystemServicePack
WRK001    Windows XP Professional     Service Pack 1
WRK002    Windows XP Professional     Service Pack 2
WRK003    Windows XP Professional     Service Pack 3

Where, cn is the workstation name and the others are self explanatory.

Share your handy little tips and tricks!

, , , , ,

No Comments

Active Directory Password Expiry Reminder Email

If you have managed an Active Directory installation that has a large number of users who connect to the network infrequently, you may have faced a problem where the user’s password expires when they are away from the network and possibly leaving them in a situation where they are not able to reset their password remotely.

I recently was in this situation and had to write a script to intimate users about an impending password expiry. Here is what the script does:

Read the rest of this entry »

, ,

9 Comments

Active Directory Audit Script

Paul Bergson wrote this brilliant script that queries active directory and gives you a wealth of information that can be used to audit active directory.

I have slightly modified this script and added a few lines to get information like the email address and the exchange home server of the user using the mail and msExchHomeServerName attributes.

You can download the modified script here.

How the script works:

Read the rest of this entry »

, , ,

1 Comment