Ken Andersen's blog about technology related subjects.
Monday, March 6, 2017
Dell OMSA Email Alerts via PowerShell
The SMTP server at my work has become quite unreliable. This is why I wasn't receiving email alerts from my Dell servers in my previous post. Also, in a web application that we host, students weren't getting email alerts that they should have been receiving. We changed that web application to use Office 365's SMTP server and email alerts have become reliable again. On the Dell servers, I was using an application I found called DellSMTPNotify.exe It worked great when our own SMTP server was reliable. It was time to take advantage of the more reliable SMTP server of our hosted Office 365 Exchange setup, but you have to use TLS encryption over SMTP to use Office 365. The DellSMTPNotify program does not support SSL or TLS encryption over SMTP as far as I can tell. It was time to investigate other solutions.
I found a PowerShell script called OMSA-Notify that someone had already written. You can, indeed, use PowerShell to send email over an encrypted connection. I just needed to figure out how to modify the OMSA-Notify script to suit my needs.
I got everything configured, so I thought, but the script just wasn't working. PowerShell just seemed to be sitting idle and would eventually give a timeout error. That's when I realized I was trying to connect to an SMTP server on the public internet, but I was running all of this on a server that was behind a proxy server. I thought I would just try and configure PowerShell to use the proxy server to send my SMTP commands, but that didn't work either. My research led me to the conclusion that SMTP commands can't be send over an HTTP proxy without installing some sort of relay program. I was at a dead end.
Later on, however, it hit me that I could setup a remote PowerShell session to one of our servers that is using a public IP address in front of the proxy server. My co-worker had already setup something similar in a PowerShell script that connects to our Microsoft Data Protection Manager server to setup automatic backups from individual client machines. To setup a server to accept remote PowerShell sessions, you simply need to run "enable-psremoting" from a PowerShell session running as Administrator. That should do it.
After getting remote PowerShell setup, my script was still failing. The smtp.send command wouldn't work because the mail message wasn't being passed to the remote session properly. I then had to setup the passing of parameters into the remote PowerShell session and actually construct the mail message in the remote session. You simply use the "-ArgumentList" parameter to send local variables to the remote PowerShell, as seen in the Invoke-Command line in the script.
Invoke-Command -Session $RoutableServer -ScriptBlock $ScriptBlockContent -ArgumentList $body, $AlertType, $env:COMPUTERNAMEThis was a fun project to figure out. I'm really happy to have server alerts coming to my inbox again. Here's a pastebin of the full modified OMSANotify.ps1: http://pastebin.com/wvvkNaVk
Wednesday, February 22, 2017
I'm So Glad That RAID Exists

I just discovered at work that a drive in one of our production servers failed about a month ago. The server kept humming along like nothing was wrong at all.
I had email reporting setup to alert our team when there is a failure. Apparently it isn't working anymore. I'll have to look into the alerting system.
With this post I just want to express my gratitude that RAID exists. The acronym RAID stands for Redundant Array of Independent Disks. It allows you to essentially combine many hard disk drives into one large drive. However, that isn't all. RAID has redundancy built in, if you pick the right configuration. In a RAID array your data is spread across all of the disks, which allows for all of the disks to work together for better performance. Parity data is also written to each disk. Parity data is the critical part. This type of data is really many calculations performed and stored on each drive. Parity data allows all of the data on one drive to be reconstructed should a drive fail.
I won't go into detail on how RAID exists in this post. There's plenty of places on the web that explain RAID. It will suffice to say that we configured our RAID array in RAID level 6. This essentially creates double parity across all of the drives. Double parity allows two drives to go dead and still have intact data.
We have a replacement drive coming tomorrow. I'll get that installed and then our array will be back in an optimal state. Right now it is basically doing calculations every time data is requested.
Our users don't even have any idea that a drive in our server has been offline for over a month. I'm really glad RAID exists.
Friday, February 7, 2014
Conversion from VMware ESXi to Microsoft Hyper-V
When I started at my current position we were running mostly physical servers, but we had a couple of virtual servers running on Microsoft Virtual Server 2005. One of the first things I helped with was to get those virtual servers migrated to VMware Server 2.0. After running on VMware Server for a year or so, we realized that it just wasn't going to fill our needs. It had not been updated for a very long time and it appeared that VMware was going to drop support for it. We then decided to migrate to VMware ESXi. It was a very good product for us. The performance of our virtual machines definitely improved significantly. However, just after getting everything migrated over and running smoothly, the state of Utah dropped their contract with VMware. We made the decision to migrate to Hyper-V.
In all honesty, we struggled in our test conversions from ESXi to Hyper-V. System Center Virtual Machine Manager 2012 looked to have all of the functionality we needed to perform the conversions built in to it. In all of our test conversions the process would make it to 90% or so and then fail with a cryptic error message.
Finally, we decided to give up on the built-in functionality and use VMware Converter. We shut down the virtual machine we were trying to convert and exported the ESXi VM to a VMware Workstation VM. After that it wasn't a problem at all to import the VMware Workstation VM into System Center Virtual Machine Manager and get it up and running. The process was very smooth once we followed the VMware Converter workflow. Every VM converted and imported just fine.
I was reluctant to move to Hyper-V, but we are very pleased with it. The one item that completely blew me away is how much better Microsoft's backup solution is. We were using the built-in VMware Data Protection product before. It was very unreliable for us. The worst part is that restore operations would take hours. Now we are using Microsoft's System Center Data Protection Manager. It is much more intuitive and restoring a complete VM takes only a matter of minutes.
Microsoft, you've earned one more fan here with Hyper-V.
Friday, November 7, 2008
Server Virtualization
That brings us to my strategy at present. I put a new hard disk drive in my server and installed a minimal Gentoo installation. Then I installed VMware Server on it and built a Windows Server virtual machine. It's been running great for about six months now. If anyone ever manages to do something bad to my server again I just have to roll back to my latest snapshot of the server and I am good to go. There's no dealing with installing the operating system and reconfiguring PHP/Apache and all the other server goodies.
I highly recommend server virtualization to even the casual home server administrator. If you aren't doing it, you should! Go get [url=http://www.vmware.com/products/server/]VMware's free server[/url] now!
Thursday, June 19, 2008
VMware and File Sharing on Windows Vista
I finally tracked down the culprit! It was VMware! VMware Workstation installs two other network adapters, vmnet1 and vmnet8. These are only used when you configure your virtual machines to use NAT or host-only networking. I don't use these configurations, I only use bridged networking. After disabling these adapters I now have Windows file sharing working perfectly on Vista!
It sure makes me happy when I can access the files on my work computer like I should be able to :)
(Image taken from vmware.com)
© The Ramblings of Ken Powered by Bootstrap , Blogger templates and RWD Testing Tool



