Showing posts with label computer management. Show all posts
Showing posts with label computer management. Show all posts

Friday, November 21, 2008

Script to Audit Disk Usage

This is a very basic script, which connects each server in a given list, then collects and reports the disk usage information for the fixed disks on each system. Script displays the drive letter, disk size, used and available disk space information on the screen and writes to a tab separated text file. I selected the tab separated file format for portability: You can easily copy and paste the contents to an Excel sheet. Script uses WMI to connect to the servers and collect the data, so please be aware that you will either need to shutdown Windows Firewall or add a "file and printer sharing exception" on the target systems.

I have tested the script on Windows XP, Windows Vista, Windows 2003 and Windows 2008. I hope the script will be very handy for easily creating disk usage reports on multiple servers and/or workstations. This script uses a very similar logic to my service account audit script. Only difference is in the WMI query section.

Usage:

cscript q_FixedDrv.vbs filename

For example:

cscript q_FixedDrv.vbs serverlist.txt

To download the script and sample serverlist.txt file, click on "I agree", you will be forwarded to the download site. Modify the serverlist.txt file to fit your test environment, then start the script. If the result you get is satisfactory, then create another list file which includes your production servers/workstations. If you have any feedback regarding this script, feel free to contact me using the comment link. I really want to know if you like it or hate it.

Wednesday, October 31, 2007

Script to Update Computer Description

A while ago, a colleague asked me if there was a way to centrally update the "Description" fields of workstations with their users' names. The desktop support team was remotely managing a couple of different organizations, and some of them had no method or documentation for matching the user names and the computer names. Although as an alternative approach, Bginfo from sysinternals (now part of Microsoft - http://www.microsoft.com/technet/sysinternals/utilities/bginfo.mspx) could be used to display the information on each desktop, the other way for desktop technicians was to look at the description of the computer from the network browser.

As a solution, I wrote a script. I started with a vbscript file, then ported it to HTA to make it reusable. It basically checks the current logged-on user, determines the user's logon name and display name from AD and updates the computer description field either with the logon name or with the display name.

It requires read rights from AD and local administrator rights on the workstations. It only updates if the "Description" is empty. It does not do any changes if no logged-on user can be detected on the workstation. It lets the admin to choose from Display Name or samAccountname attributes of the user to update the Computer Description field.

Please remember that this script is written for and tested on Windows XP systems. If workstations are protected by windows firewall, file sharing exception should be enabled.
Even before attempting to use the script, make sure you read and understand the disclaimer section in the right column. Do not even think of using this script in your production environment before testing and approving in a lab.

If you're ready for download and agree with the disclaimer terms, click on "I Agree" to reach the download page. Copy this file to your test environment and start testing. It requires an input file which lists of computer names, and of course your AD (test) domain name. Test it and if you have any ideas or questions, feel free to contact me using the comment link.

I hope you find this script useful. I will try to post similar scripts for various tasks.

Update to the post:
Somehow, the old free file hosting company decided that these utility scripts cause "abuse/copyright violations" and decided to remove them. Instead of trying to convince them that these scripts belong to me and has nothing to do with abuse, I simply moved them over to another (and better) file hosting service. Sorry for the inconvenience, and thanks for warning me about the dead links.