I am going to get right to it today. I really don’t like Microsoft Exchange. I think it is a bloated, convoluted, over-priced product. Welcome to being a Microsoft admin :).

I was recently tasked with doing a bit of investigative work on an Exchange server and determining what all was using the box for mail services. To that end, I needed to answer two questions…

What mailboxes are currently in use?
What is currently using this machine as an SMTP server to send mail out?

Below I am going to provide the powershell commands I had to figure out which helped me answer those questions. (more…)

I have been working on email stuff on and off for the last… forever.

One of the very handy and easy to use tools to have in one’s pocket for testing email functionality with a particular SMTP server is the ability to quickly send email through a selected server from the command line. Just like using telnet to test ports makes day-to-day IT life easier vs. having to grab and install some extra tool, so also does the ability to shoot emails off from a CLI.
(more…)

This is a quick snippet for all of you working with RDS in Server 2012+… and bemoaning the fact that Microsoft took something relatively simple and made it horribly convoluted…

In Powershell you can manually set a Session Host Server to use a specific licensing server and mode. To do so you run the following on the session host server.

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList("servername.contoso.local")

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.ChangeMode(VALUE)

First two commands specify the licensing server you want. Hence change servername.contoso.local to your environment. That’s only the first half though. You then need to set the licensing mode and that is what the second two commands do. Where it says VALUE you can enter in either a “2” or a “4” depending on the type of licensing you have.

2 = Per Device
4 = Per User

Hope this saves someone else some headache… I think the MS approved way to do this is probably to use group policy but this is a quick and dirty method if you just need to get a machine working quickly.

I work with a lot of IIS servers. Keeping track of what sites are present on which servers can sometimes be a daunting task. Heretofore I have been dealing with the rather obnoxious and time consuming process of checking sites and bindings by looking at each one in the IIS console. The other day I thought to myself, surely there must be a more effecient way to do this from the CLI via PowerShell… There is… I quickly found the following code on Stack Overflow after a Google search: (more…)

I found myself creating security groups for different servers in one of my domains over and over again and using the GUI can get a bit tedious. So I decided to write a quick powershell script that provides an interactive prompt asking for the server name, group type (select from options) and then from there creates a security group called “SERVERNAME-GROUP” in Active Directory. In my case, I had three different groups for each server, local “Admins”, local “Users”, and finally a special group for database admins used in Microsoft SQL Server. This requires the Active Directory module for powershell and must be run from a Domain Controller.

Below is the powershell code: (more…)