Active Directory Scripts | Desktop Scripts | Folder Scripts | Spybot Auto Install | Classes


This is a collection of scripts that I have written.  They may prove to be useful to you.  There is absolutely no warranty with these scripts and you use them at your own risk.  I am not responsible for any harm that may result from these scripts. By downloading any script from this page you are agreeing that you understand that. - Matthew Hull
Active Directory Scripts Return to Top

!! Hot !!

 
AD Report 1.02.vbs Created: 11/18/03
Scans an Organizational Unit and  reports information about the users in that OU.  It will output the data to a CSV file.  You can use this to check user properties such as home folder, script, and profile path information.  Then it will check the username format for errors, verify that the user has a home folder and report the size of the home folders.  The script is dynamic in what it reports, for example if the users don't have a setting for home folders it won't check to see if a folder exists or try to report the size.  It will also attempt to determine your username format.

 
Count Exchange Accounts 1.0.vbs Created: 1/28/05
This script will count the number of mailboxes on your exchange server.  It pulls the server name from the first account with a mailbox in the Domain Admins group.

 

Display FSMO Roles 1.0.vbs

Created: 4/27/04

This will query Active Directory for the name of the FSMO role holders and display them to the user.  PDC Emulator, RID Master, Schema Master, Infrastructure Master, Domain Naming Master.


 

Fix Display Names 1.02.vbs

Created: 7/13/04

Loops through an Organizational Unit and changes the displayname and CN attributes to lastname, firstname format.  It looks at the display name for it's information.  In order to run this properly the display name has to be in firstname lastname format.  If it detects a comma in the display name it will skip that user.  It also can run in a report mode so you can see what it would do to the users before it runs.  Use caution when running this script it has potential to mess things up big time.

 

Note: ADHelper.wsc required


 

Fix Printers 1.0.vbs

Created: 7/26/04

This script will help you fix network printers after a server has been renamed.


 

 

Import Phone Numbers into AD 1.0.vbs !! New !!

Created: 8/31/05

This script will read a CSV file in the format lastname,firstname,phone number and try to locate the user in Active Directory and if found it will add the phone number.  This script is lacking in error detection, use at your own risk.

 

Note: ADHelper.wsc required


!! Hot !!

 

Import Users 1.0.vbs

Created: 4/29/04

Imports users into Active Directory from a CSV file with the users listed in lastname, firstname format.  The script will generate passwords, make home folders, and add users to groups.  You can run the script in a report only mode to verify the users before they are entered.  You should use Clean CSV File 1.0.vbs to prepare an import file before you run the script. If there are errors in the import file the script will not run.

 

Note: ADHelper.wsc required


 

Last Logon Report - Computer.vbs - Written by Richard L. Mueller

Created: 4/27/04

This script was not written by me but I did modify it a little.  It will now run without needing to be edited.  It will scan all your Domain Controllers and report when each computer account last logged onto the domain.  This can be useful when tracking down orphaned computer accounts.


 

Last Logon Report - User.vbs - Written by Richard L. Mueller

Created: 7/13/04

This script was not written by me but I did modify it a little.  It will now run without needing to be edited.  It will scan all your Domain Controllers and report when each user account last logged onto the domain.  This can be useful when tracking down orphaned user accounts.


 

Modify Logon Hours 1.0.vbs

Created: 8/16/04

This script will loop through each user in an OU and set their logon hours setting using the Net User command.

 

Note: ADHelper.wsc required


 

Modify TS Settings 1.0.vbs

Created: 8/5/04

This script uses a program called TSCMD from a company called System Tools, to modify all the users terminal services settings in an OU.

 

Note: ADHelper.wsc required


 

OU Password Reset 1.01.vbs !!Recently Updated !!

Created: 5/20/04

Use this to reset everyone's password in an Organizational Unit.  You can assign everyone the same password or have the script generate a unique password for each user.  The script will create a log file with the passwords.

 

Note: ADHelper.wsc required


 

Remove Users Without Folders 1.0.vbs !! New !!

Created: 9/1/05

This script will delete any user that doesn't have a home folder. The idea is that you would have run the script "Delete Empty Folders 1.0.vbs" first.  This way anyone who has never used their account can be removed.  USE AT YOUR OWN RISK - THIS IS DESIGNED TO DELETE USER ACCOUNTS!!!!

Note: ADHelper.wsc required


 

Replicate Two DC's 1.0.vbs

Created: 7/21/04

This will replicate two domain controllers.  When you run the script it will prompt you for the name of the source and destination servers.


 

Set Mailbox Limits 1.0.vbs

Created: 7/8/04

Loops through each user in an Organizational Unit and sets their mailbox limit settings.  You can also use it to clear or disable the settings.

 

Note: ADHelper.wsc required


 

Swap First and Last Names 1.0.vbs

Created: 7/28/04

Swaps the first and last name property of each user in an OU.  This was written to fix a problem caused by a bug in Fix Display Names 1.02.vbs (The bug has been fixed)

 

Note: ADHelper.wsc required


 

SWS Settings 1.0.vbs

Created: 4/27/04

Scans the domain for information needed to switch Symantec Web Security to LDAP mode and displays the information to the user.  This makes it easier to set up SWS.


 

 

User Mod Add 1.0.vbs

Created: 8/9/04

This script will loop thru each user in an OU and set certain properties.  The properties it can set are Description, Home Directory, Home Drive, Profile Path and Script.

 

Note: ADHelper.wsc required


 

User Mod Delete 1.0.vbs 

Created: 8/9/04

This script can be used to clear certain properties in all users in an OU.  The properties it can clear are Description, Home Directory, Home Drive, Profile Path and Script.

 

Note: ADHelper.wsc required


Desktop Scripts Return to Top


 

AutoLogon 1.0.vbs

Created: ???

This script will set a user to auto logon to a computer.  It modifies the appropriate registry setting to do this.  This was written for an elementary where they wanted all the computers to log in with a generic elem account.


 

Change Background Color 1.0.vbs

Created: ???

This script was written for a school that wanted to change the background color on all the PC's in a lab.  They were going to need to change the background colors often so this script was created to allow the teacher to easily do this.  She would change the settings in the script on the server and when the students logged in the background color changed.


 

Change Script Type 1.0.vbs

Created: ???

This is a small simple script that will change your script engine to cscript or wscript.  I wrote this when I was working with a script that needed cscript and most of my others use wscript.  It allowed me to quickly switch between them.


 

Display Computer Name 1.0.vbs

Created: 8/9/04

Shows the name of your computer.  We have users run this from a web server so they can easily get their computer name when we do remote support.


 

Display Logon Server 1.0.vbs

Created: 10/10/03

Use this to show the logon server and the currently logged in user.  I wrote it to learn how to deal with environmental variables.


 

Fix Sync Warnings 1.0.vbs

Created: 5/12/04

In Windows 2k/XP with offline files enabled the computer may pause with a sync warning.  This script will change a registry setting so the warning will still show but the computer will continue to shut down.


 

Force Classic Start Menu 1.0.vbs

Created: 8/9/04

This was used to force a Windows 2003 terminal server to have all users see the classic start menu.


 

Guessing Game 1.0.vbs

Created: ???

Just for fun.  This was an early script that tested a lot of the skills I had been learning.  There is no action in this game.  It is a little boring.


 
Map Network Drives 1.0.vbs Created: 12/13/04
Maps network drives on a workstation.  If it fails it logs a warning in the event viewer.  This is a derivative of the Printer Install 2.0 script (see below)

 

Mod Proxy 1.0.txt

Created: ???

Modifies the proxy settings on a computer.  This was created for a school that was having a problem with Group Policies.  It should work with Windows 9x/Me as well although I haven't tested it.


 

Network Drives 1.01.vbs

Created: 10/11/03

This will display all the network drives on your computer with a description.  You can use it to document your network drives.  The user then can run the script and see what network drives they have and what they are for.


 

Outlook 2003 Fix 1.0.vbs

Created: ???

By default Outlook 2003 blocks certain types of file attachments.  You can use this script to allow some of them in.


 

Outlook XP Fix 1.0.vbs

Created: ???

By default Outlook XP blocks certain types of file attachments.  You can use this script to allow some of them in.


 

Password Generator 1.0.vbs

Created: 5/1/04

Just a small script that will generate a list of passwords.


!! Hot !!

 

Printer Install 2.0.vbs

Created: 12/18/03

Installs network printers on a workstation.  If it fails it logs a warning in the event viewer.


!! Hot !!

 

Printer Uninstall 2.0.vbs

Created: 12/18/03

Uninstalls network printers from a workstation.  If it fails it logs a warning in the event viewer.


 

WSH Version 1.0.vbs

Created: ???

Displays the version of Windows Scripting Host on a computer.  I wrote this one to find out what version was installed on different Windows 95 computers.


Folder Scripts Return to Top


 

Archive Students Data 1.0.vbs !! New !!

Created: 9/3/05

This script will read in a CSV and compare the list of users to users in an OU. If the user isn't in the CSV then their data is moved to an archive folder and their account is deleted. If you have an OU that has users in it this can be used to remove users that aren't needed anymore. The CSV would contain the users who are supposed to be in the OU in a lastname, firstname format USE AT YOUR OWN RISK - THIS IS DESIGNED TO DELETE USER ACCOUNTS!!!!

 

Note: ADHelper.wsc required


 

Clean Profiles 1.0.vbs

Created: 10/17/03

The will clear all the users profiles on a computer except for some of the key ones.  It will then report the amount of space that was freed.  This has been used in computer labs at the end of the year to clean the computer or to troubleshoot group policy problems.


 

Clean Remote Profiles 1.0.vbs 

Created: 8/9/04

Same as the Clean Profiles script except it will clean all computers in an OU.  It uses DelProf from Microsoft to remove the profiles.  It will also create a log with the computers it cannot contact.


 

Compact MDB.vbs - Written by Danny Lesandrini

Created: ???

Compacts an access database.  The computer you run it on needs to have access installed.


!! Hot !!

 

Copy Favorites Logoff 1.0.vbs

Created: 7/21/04

This can be used as a solution to the lack of Favorites redirection in Active Directory.  When the user logs off their favorites are copied from the local profile to their home folder.  Use this with Copy Favorites Logon 1.0


!! Hot !!

 

Copy Favorites Logon 1.0.vbs

Created: 7/21/04 

This can be used as a solution to the lack of Favorites redirection in Active Directory.  When the user logs on their favorites are copied from their home folder to their local profile.  Use this with Copy Favorites Logoff 1.0


 

Copy Files 1.0.vbs 

Created: ???

All this does is copy files and folders from one place to another.


 

Delete Empty Folders 1.0.vbs !! New !!

Created: 9/1/05

This script will delete all the empty subfolders in a folder. This is used to remove empty student folders.  USE AT YOUR OWN RISK - THIS IS DESIGNED TO DELETE DATA!!!!


 

Folder Size 1.0.vbs

Created: ???

This will report the size of all subfolders in a folder.


 

Home Folders Check 1.0.vbs

Created: ???

You can use this script to verify that users in an OU have home folders.


 

Make Folder From OU 1.01.vbs

Created: 10/11/03

Creates a folder for each user in an OU using the users username as the folder name.  Then it sets up the permissions on each folder.


 

Make Folders From Group 1.01.vbs

Created: 10/11/03

Creates a folder for each member of an group using the users username as the folder name.  Then it sets up the permissions on each folder.


!! Hot !!

 

Modify Folder Ownership 1.01.vbs

Created: 5/23/04

This script is designed to use the SubinACL program found in the Windows 2000 Resource Kit to reset Ownership on users home folders. It will assign ownership of all files and folders in each users folder to the proper account.


!! Hot !!

 

Modify Permissions 1.0.vbs

Created: 11/09/03

This script can be used to reset permissions on users home folders.  It can take the folder name and use it as a username and assign permissions accordingly. 


 

 

Move Home Folders 1.01.vbs

Created: 7/26/04

This script just moves home folders from one location to another.  It will update the users home folder settings in there profile and fix the permissions on the new folders.  This proves to be very useful when moving home folders from one server to another.

 

Note: ADHelper.wsc required


 
Move Unwanted Files 1.0.vbs Created: 12/21/04
This script can be used to scan student home folders and remove files you don't want them to have.  It will move the files to another directory then log where they came from.  You can also have it replace the file with a text file stating that the file was removed.

 

Orphaned Folder Check 1.1.vbs

Created: 11/06/03

Loops through home folders and verifies the folder has a user associated with it by querying Active Directory.  You can use Orphaned Folder Check 1.0.vbs to have it verify against users in one OU.  This one can be useful if you have multiple OU's and users are sometimes moved between them.


 

Set Quota for Users in OU 1.0.vbs !! New !!

Created: 8/31/05

This script will set a quota limit for everyone in an OU. NOTE: This version works but can use some improvements, like an exception list and it could easily be made to run on multiple OU's at once. Maybe with the next version.

 

Note: ADHelper.wsc required


SpyBot Auto Install Return to Top


 

SpyBotInstall.bat / RunSpyBot.bat / SpyBotSD13.exe / ZIP File

Created: 6/28/03

Use this to automatically install Spybot.  There is a readme in the zip file that explain how to implement it.


Classes Return to Top


 

ADHelper.wsc

Created: 7/12/04

A lot of the scripts require this object.  This object can be used to get an group or OU object just by using the name of the OU.  To install this object place it in your System32 folder, then right click on it and choose register.


Active Directory Scripts | Desktop Scripts | Folder Scripts | Spybot Auto Install | Classes