Updated Error Code Lookup Tool

The Microsoft error code lookup tool (which no Windows admin should be without) got updated today: http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&displaylang=en&tm. While it says it’s for Exchange, it really covers Exchange, Windows and a number of other Microsoft products. You can plug an error code in and this tool will give you whatever definitions it finds in the headers compiled into it. If you’ve ever seen an event that says “the error code is in the data”, or you get a message that “unknown error 0x80045500” has occurred and you have no idea what to do, this is where to start. I keep the … Continue reading Updated Error Code Lookup Tool

Getting Total Installed Memory with WMI

Getting the amount of memory installed in a machine with WMI is a bit confusing particuarly if you only read the docs partially. I was initially using Win32_ComputerSystem::TotalPhysicalMemory, but the documentation warns  “Be aware that, under some circumstances, this property may not return an accurate value for the physical memory. For example, it is not accurate if the BIOS is using some of the physical memory.” The suggested alternative is Win32_PhysicalMemory::Capacity. This was an easy switch in my script, but, I was getting numbers I knew were wrong for the machines I was querying. The part I didn’t read was … Continue reading Getting Total Installed Memory with WMI

Script to Reset Local Administrator Passwords

I realized I hadn’t posted this one answering a newsgroup post this morning. The attached script will iterate through a list of workstation names in a text file, ping them, and if the ping returns then reset the local administrator account password to whatever is defined at the top of the script. This is pretty basic and would potentially need some customization. You might want to adapt it to iterate through an OU or set of OUs instead and get the computer names from there, or perhaps set different administrator passwords on the machines. Feel free to leave any questions/comments/etc … Continue reading Script to Reset Local Administrator Passwords

Script to Collect Local Administrators Membership from List of Machines

Another script I wrote the other day, this one will take an input file called workstations.txt and produce a CSV which is easy to view in Excel and look at the local administrators group membership for the list of machines. The script could easily be modified to get the list from Active Directory although he framework I usually use for these is setup for a text file so I just export a list if AD is my source. The script will attempt to ping the machine before connecting in order to try and determine availability. If you have firewalls or … Continue reading Script to Collect Local Administrators Membership from List of Machines

Script to Collect Basic Inventory Data From Machines

This is another useful script I sometimes use when I need to collect some basic inventory data from a list of machines. The attached vbscript takes an input file called workstations.txt and produces an comma separated output file called workstationinventory.txt. You can modify the two constants at the top of the file as noted below if you want to change this: The script currently only outputs a limited set of information but the framework is there to extend it to collect really anything available via WMI. The fields currently exported are: Make Model BIOS Version Operation System Serial Number To … Continue reading Script to Collect Basic Inventory Data From Machines

Script to Create Home Folders for OU

I thought I’d share the script attached at the end of this post as it’s something I’ve seen requests for below. The script will take all of the users in a given OU (or really any subtree), and create a home folder for them and stamp the path and drive letter on the user object in Active Directory. By default it only grants the users modify permissions on the account. If you want to change this modify the xcacls call around line 54. There are a few constants which need to be configured at the top of the script which … Continue reading Script to Create Home Folders for OU

SecureCRT Script for Mass Changing Cisco Switch/Router Passwords

Attached to this post is a simple script which connects over either Telnet or SSH to a list of devices and resets the enable password, local password for the vty lines, and the console password. The script will login either with a username/password pair or with just a password. The script is setup to work with Cisco IOS devices, but customizing it for CatOS or some other vendor would not be difficult. SecureCRT has a handy automation API which lets you build on the protocol support in it to automate tasks over the protocols it supports. As a Windows user, I … Continue reading SecureCRT Script for Mass Changing Cisco Switch/Router Passwords

Script to Dump Exchange Mailbox Info to Spreadsheet (CSV)

I found another useful script I wrote last year on my hard drive this evening. It's attached at the bottom of this post. This script will dump quite a bit of useful information about each mailbox on a particular server or set of servers to a CSV file which you can in turn import into Excel and create a spreadsheet from. I typically would import data into a SQL Server table using DTS (Data Transformation Services) if I needed to do alot of computation or data mining. Excel gets very slow when doing tasks that really require an index over a … Continue reading Script to Dump Exchange Mailbox Info to Spreadsheet (CSV)

Nagios NSClient Agent Rollout Script

I'm a big fan of Nagios as a monitoring solution in environemnts large and small. The price can't be beat and the community around it is pretty good too. I have a zip attached to this post which contains a script I wrote to deploy the nsclient agent to a list of hosts specified in a text file. The script requires two utilities from the Sysinternals PSTools package. There are two empty files in the zip named psexec.exe.goeshere and psservice.exe.goeshere. You should delete these and replace them with psexec and psservice from the Sysinternals site. There is also a folder called DeployFolder in the … Continue reading Nagios NSClient Agent Rollout Script