powershell

Query Size and Free Space of Windows Volume Mount Points

I have been tasked with writting a script to analyze our servers on a daily basis. I found this most excellent server inventory script that pulls virtually every conceivable value from a server.

Now, on our Exchange cluster, we've used Volume Mount Points for the resources. This means that a 9gb drive with eight 330gb folders (or mount points) to SAN storage. If I simply pull the drive freespace, I get ~6gb (local hard drive), even though the mount points each show over 100gb free.

Convert and configure Exchange 2007 conference room mailbox

Having recently migrated all of our department to Exchange 2007, we were excited to take advantage of the new conference room functionality! No more Outlook Resource configuration, no more faulty Auto-Accept script! Microsoft has FINALLY programmed in full-fledged resource mailbox functionality into Exchange.

Powershell Quick report - all smtp email addresses

Attending a class this week for Exchange 2007. The question came up to export all SMTP email addresses for all mailboxes. In the lab environment, I worked up this script.


$data = get-mailbox | %{ $dname = $_.displayname;$em=$_.emailaddresses -replace("smtp:",",");$dname+$em}

I have not tested this in a production environment, so I am not sure what will display for users with other than SMTP email addresses.

Create mailboxes from a CSV file

Takes a CSV file, reads headers and creates mailbox based on values.
Requires two columns in CSV, UserPrincipalname and Name. The UPN can be the SAMAccount value renamed. It will append the variable $UPNDomain to end.

Also requires both Quest ActiveRoles PowerShell tools (to create AD Account) and Exchange 2007 Management tools to set mailbox quota limits.

Find All Mailboxes with Mixed up Quota settings

Invariably, when you let your local admins create mailboxes using a web interface, you will get some odd settings.

One of things that I've noticed, when running PowerShelll queries, is all the mailboxes with incorrect quota settings. Users with Send Receive limits lower than the Notification settings. Tired of these alerts, I created the following to dump those mailboxes to a CSV.

Find ALL DLs that a specific person manages

Friend is working on the dirty deed of removing a series of accounts from AD. As part of that clean-up he is to find all the distribution lists that each account is assigned manager on. Using the Quest ActiveRoles Powershell tools, you can quickly find these unfortunate people using:


$selectUser = Get-QADUser "John Doe"
Get-QADGroup -SizeLimit 0 -ldapFilter '(&(mail=*)(managedby=*))' | where {$_.managedby -eq $selectUser} | select displayname, managedby

PowerShell Power Story

I hadn't fully realized the power and simplicty of PowerShell until recently. My manager had asked if a script could be written that would take a CSV file of mailbox names, and hide them or unhide them. My co-worker, well-versed in VBScript, generated a 220 line solution that did just that. When I got into the office, I took that as an invitation to flex the PowerShell

PowerShell - Enumerate SENDAS Permissions on all mailboxes

We are working on a security review of our Exchange environment. Part of that is to review who has permissions to access what mailboxes.

That's why I put together this little script. Using the Exchange 2007 Management shell, it reads our Exchange 2003 and 2007 environments, processing all the mailboxes. It outputs a single CSV file containing each instance where someone else (not SELF and not a SID) has permissions to a mailbox.

Powershell - Enumerate Delegate Rights for a mailbox

Troubleshooting Outlook delegate permissions is a pain. I found the easiest way to get a user's delegates is to create a profile, open their mailbox and check each person.

That's why I created this script. Using the Quest Powershell addons for AD, it reads the delegate permissions for a specified mailbox, then looks up the display name for each delegate or mailbox they are a delegate for.

PowerShell - Find all enabled AD users

A friend is working on a script to pull active LCS accounts from his AD. One last bit of information that he that was troubling him was enabled/disabled AD accounts.

Syndicate content