vbscript

VBScript- Create Distribution Groups (DL) from CSV

I needed a quick script to create a series of distribution lists on an Exchange environment. I thought, "Cool, a chance to flex my PowerShell muscles!" From that I found new-qadgroup from the quest tools set and new-distributiongroup from the Exchange tools. After quite a bit of muddling around, I was never able to recreate my script.

Requirements I was trying to meet:

  1. Read all data from a CSV file (easy import-csv)

Lookup email addresses from CSV in AD

Scenario: I was given a list of 15,000 email addresses and asked if they were still valid in our Exchange environment.

Easy method: I ran a simple VBScript that does an LDAP query against each email address. This worked great, except that it took close to 5 seconds per email address to query our environment. (~20 hrs!) The over-all run time was going to be too extreme.

Grant External Account Permissions to Modify Delegates

This HTA applet allows you to grant extended AD permissions to a specific user. I use it to assign permissions to the Associated External Account of an AD user rights to modify their own delegates.

I found what values I needed by configuring a single user with permissions, then using Richard's DACL export script to dump that user. I then modify the script (see line 248) to match the permissions I want to grant.

Creating a REALLY BIG file!

I ran into an occurrence where I needed to create a really big file. I was having an issue with a backup procedure failing at only 16gb. After extensive troubleshooting, I thougth that maybe the issue was with the hard drive. The backup solution would reach the 18gb mark and fail due to some inconsistency.

So, where I can I find a big file?

  1. Copy an existing large file off another server or workstation - great, but all the large files are open and I didn't want to shut something down.

Assign Secondary Account Permissions to Distribution Lists in Exchange 2003

Screen Shot of HTA in action.

The company I am working for has a slightly different security model than I've seen before. It is probably because the largest Exchange server I've supported previously only had 3,000 mailboxes. This one supports 10x that number, with plans to grow to over 100,000 mailboxes by this time next year.

Purging a list of Mailboxes from Exchange 2003

The migration process used to move a number of mailboxes created a couple hundred dead mailboxes objects in our environment. Their mailbox information needed to be cleared before their mailboxes could be migrated to the server for the final time. To fix this, I looked into a script. First I found the script at TelnetPort25, here. This script goes through the entire environment and purges all deleted and non-system mailboxes.

Dynamic Interesting Desktops

One of my first contract jobs was for a small IT company in the area. I worked with them for about 4 months before a permanent, salaried position came along. (Sorry, I like having someone else pay for the benifits) One of the most memorable things the owner shown me was his background.

Script to Simplify life

During my work day, I probably send a 20-30 email messages. Each time I typically look up someone's email address, copy it to the (keyboard) buffer (CTRL+C), click on a shortcut I have to open a new email, then paste the email address into the new message. I thought, what if my new email shortcut, would test the keyboard buffer and then automatically paste the address for me?

Server Inventory Script

I have been working on a number of projects lately where I need to touch most of the servers in our environment; be it changing DNS servers, or querying event logs, I needed a way to get every live server out there.

The attached script will query AD for all servers, then if pingable, it will attempt to gather more info via WMI. The final result is output to a CSV file in the C:\ root of the local computer.

  • Server name
  • OS version
  • Last Service Pack # applied (not patch version)
  • MAC Address, IP and DNS configuration for each active NIC

Query AD for Printer info

Expanding on my code to query single printer information, I found I could pull all networked printers from Active Directory(AD). This will help in cleaning up the naming standard for all our printers. Hopefully making DNS cleaner by using a single standard for host(A) records. Final file is written to c:\printer-info.csv. The attached script will return the following:

  • Printer name
  • Server name - where hosted
  • Port - name of printer port (local or network)
  • Share name
Syndicate content