Posts

Showing posts from July, 2013

Finding the Error Type for Use with Trap and Try/Catch

I've read tons of web pages over last few years looking at error handling in PowerShell. Many of the blogs and examples assume that you already know the error type that you are looking for. Finally today I found an example of viewing the error type so that you can identify it and use it with Try/Catch or Trap. To view the error type, first generate the error. This stores the error in the variable $error[0]. To view the error type use the following: $error[0].exception.gettype().fullname You can use this with Try/Catch to catch different error messages and perform different actions based on the specific error type. Try {      code to try } Catch [ fullnameOfErrorType ] {      stuff to do for that error type } Catch {      stuff to do for a non-defined error type }

Passing Pipeline Objects byPropertyName Fails

In class this week, the text had the following example of a Powershell command that should work: Get-ADComputer -Filter * | Select-Object @{name='ComputerName';expression={$_.name}} | Get-Service The text claimed this would work and I initially thought it would. Here was my theory..... Get-ADComputer retrieves the computer objects from Active Directory. Those computer objects have a property 'Name' that we can convert to a property named 'ComputerName'. Then the list of ComputerName property values is passed to Get-Service which has a ComputerName parameter that accepts pipeline input by property name. However, like all good students, my class wanted to see it work. So, we tried it out, and it didn't work. It failed with the following error: Get-Service : Cannot find any service with service name '@{ComputerName=VAN-DC1}' Further in there was a clue: ObjectNotFound: (@{ComputerName=VAN-DC1}:String) The problem relates to how parameters are passed thr

EventID 5139 and Kerbauth.dll Error

I recently reinstalled Exchange on a computer that has been installed into the incorrect domain. To do this Exchange 2010 was uninstalled, the computer joined to the other domain, and Exchange 2010 reinstalled. During the installation process, all appeared good. However, the  Exchange Management Console and Exchange Management Shell were unable to connect locally on the new server. They tried to connect locally, timed out, and then connected to another Exchange 2010 server. The following errors were in the event logs: Event ID 5139 A listener channel for protocol 'http' in worker process '1028' serving application pool 'MSExchangePowerShellAppPool' reported a listener channel failure. The data field contains the error number. Event ID 2280 The Module DLL D:\Microsoft\Exchange Server\V14\Bin\kerbauth.dll failed to load. The data is the error. The source of this error turned out to be a line in the Windows\System32\inetsrv\config\applicationHost.config file. This

Dust Protection for Server

We have a client with two physical locations in the same town. To provide offsite backup, we create a system that replicates virtual machines to the second site. The second site is a machine shop that is quite dusty. Plan A was to locate the server in a large utility room. However, it turns out that in the summertime, that utility room hovers at about 30C (86F). This is much warmer than I'm comfortable with. So, on to Plan B which is the air conditioned office area which is still dusty, but much cooler. To host the server in the office area, we need some kind of box to house it in that can filter out dust. In my research, I found that the standard for this rating is IP 54 or NEMA 12 . Those are two different standards that say the case makes the computer safe from dust and light splashing. I did some research and here are the best options I found. APC NetShelter CX . This is a nice looking cabinet that is sound proof and comes in various sizes. The smallest of these is an 18U box

Exchange Without a DMZ or Reverse Proxy?

For many years I've been implementing Exchange server in SMB environments without using a DMZ or reverse proxy to control access to Exchange services. At least since Exchange 2010 came out, I've been arguing that they don't really add much security value and that none of my customers  (nor any others I've heard of) had any issues with doing this. Large companies have fairly rigid security policies. One of these policies is typically that no network traffic is passed directly to the LAN from the Internet. There needs to be some sort of reverse proxy in a DMZ (perimeter network in MS speak). In classes where I teach Exchange, the students from larger organizations typically believe strongly in these policies. They are risk adverse and this is the way it's always been. And many times, they have no control over this policy. Well, a beautifully written article from Greg Taylor on the Exchange Team lays it all out for you to consider. From my perspective, it solidifies wh

Exchange 2013 Corrupted Health Mailboxes

While in the process of removing a database from an Exchange 2013 server, I got the following error: Failed to remove monitoring mailbox object of database " DBname ". Exception: Active directory operation failed on Servername . This error is not retriable. Additional information: Access is denied. Active directory response: 000000005: SecErr: DSID-031520B2, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0. The database was removed, but there seemed to be some sort of Active Directory error when deleting the monitoring mailboxes associated with the database. Next I tried to view the monitoring mailboxes by using: Get-Mailbox -Monitoring This showed me mailboxes with the following error: WARNING: The object domainname /Microsoft Exchange System Objects/Monitoring Mailboxes/HealthMailbox biglongGUID has been corrupted, and it's in an inconsistent state. The following validation errors happened: WARNING: Database is mandatory or UserMailbox. After doing some searching, this probl

Exchange 2013 Hidden Mailboxes

Image
In the graphical/web-based interface for Exchange 2013, the list of recipients does not include utility mailboxes such as: discovery search mailbox arbitration mailboxes I recently had an issue at a client where rather than trying to fix an Exchange server having issues, we just replaced it and moved the mailboxes. However, before I could actually uninstall Exchange 2013 from the old server, I needed to move the mailboxes that did not appear in the graphical interface. In the Exchange Management Shell (EMS), the discovery search mailbox is retrieved by the Get-Mailbox cmdlet. So, you can use the following to move the discovery search mailbox: Get-Mailbox -Server RetiringServer | New-MoveRequest -TargetDatabase DBonNewServer To get a list of the arbitration mailboxes, you need to use the -Arbitration switch with the Get-Mailbox cmdlet as shown in the screenshot below: We had not implemented these, but other things that might trip you up are: archive mailboxes (use the -Archive switch) p

Tool for SMART Status

Image
I have an inexpensive test server that includes Intel's built in RAID functionality on the motherboard (Intel Rapid Storage Technology enterprise). This is a simple RAID controller that allows me to run RAID 10 on the server and have a bunch of virtual machines. However, it has a tendency every few months or so, to drop a drive from the array. When a drive drops, I want to see the SMART status of the drive. This allows me to see the physical status of the drive and determine whether the drive is failing. However, the Intel management tool for the controller does not show the SMART status for the individual drives. Kind of a big oversight in my mind. Also, many tools that you can download to view SMART status don't work when RAID is enabled. Today I found a nice open source utility for Windows to view the SMART status that works with this RAID controller. It is hddguardian. You can get it here: http://code.google.com/p/hddguardian/ Here is a screenshot: