Ramblings From The Litter Tray of Life

Archive for the ‘Windows’ Category

Getting rid of null IP addresses in BGInfo

Posted by graycat on 30 September 2011

I love BGInfo and install it on all my Windows servers. It makes things so much easier when you can see key information right there on the desktop whilst you’re working on remote machines. However it has run into a few issues with Windows Server 2008 where it produces null responses for things like local IP address or DNS servers.

After a  bit of playing around with WMI I’ve found that these checks make for a much cleaner display than the built in ones.


First thing’s first you’ll have to create a new custom check, call it something meaningful like “IP Address2” or whatever and select WMI then Browse. Once into the WMI selections from the WMI Class drop-down menu select Win32_NetworkAdapterConfiguration and then the Class Property drop-down menu, select IPAddress. At this point you will see a lot of null addresses in the evaluation window. To clean this up simply add the following onto the end of the query: Where IPEnabled=TRUE


This should then remove all those pesky bits that you don’t need and bring BGInfo back to looking all nice and clean.

I’ve taken this a bit further an used the same approach with the DNS servers like this: SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration WHERE IPENABLED=TRUE


An easy fix in the end.

Posted in Windows | Leave a Comment »

A Quick Method of Recovering Deleted User Accounts

Posted by graycat on 15 May 2011

Now I’m sure it’s all happened to us before that an active user account has been deleted by accident at some point. Sometimes it’s due to inactivity or an admin taking their eye off the ball at the wrong moment. Regardless though, it happens and you’ve got to get it back.

The worst case scenario is that the account was actually in use at the time and you have to get that user back and working RTFN. This isn’t so tough if you’re in a contingious network where AD, server OS and Exchange versions all match up. If not, it’s a bit trickier.

Here’s how I do it:

1. Download a copy of ADRestore and install it on the relevant machine.

ADRestore is a fantastic little app that is provided “as is” by one of Microsoft’s MVP. It works really well at enumerating usually hidden objects in AD and allowing basic restoration of them.

2. Point ADRestore at your DC of choice and enumerate objects.

This will hopefully find your deleted account for you. It works due to the method that AD deals with deleting an object. Namely that the object is marked for deletion but only actually deleted during it’s scheduled maintenance run. Until then the object is simply hidden so can be reset.

3. Once you’ve restored the account back into AD you’ll need to reset the account’s password and enable it.

4. Reconnect the mailbox

If you’re using Exchange 2000/2003 then you can easily see the orphaned mailbox within the store and reconnect it via a right-click. However, if you’re using Exchange 2007/2010 you may find that the mailbox does not display under the “disconnected mailbox” section. This is again reliant on scheduled maintenance runs however if you’re in a rush you can run the following PowerShell command:

Clean-MailboxDatabase “Database Name”

Though if you have a few mailbox databases on the server, you may need to run Get-MailBoxDatabase to get the full name of the target db.

At this point you can right-click the disconnected database and reconnect it to the recovered mailbox.

5. Reset the group memberships.

Due to the tombstone process removing all group membership, you’re going to have to go back into the account and add them back in.

6. Check it all works.

I usually grant myself Full Access to the mailbox and check it through OWA just to make sure the e-mail is up and running. Send a few messages back and forth is always a good idea. You can also try running a CLI or shortcut as the recovered user to make sure it has indeed come back as required. After that all you’ve got to do is wait for replication to take place.

Posted in IT, Windows | Tagged: , , , | Leave a Comment »