Comments

Windows Killing a Process Without Taskmanager

So you have domain admin rights, but that server just wont play with remote desktop … you suspect a hung process what do you do?

Have someone log into the console (if they can) ?

Or surely there is another way …

Windows XP (Surprisingly) has a command line tool set for just such an event, in this case the two commands. (Via command line Start > Run CMD)

TASKLIST

and

TASKKILL

Just run off the list of processes using TASKLIST and kill the “offending” process with TASKKILL, if you can not figure out how to do that by reading the documentation via the links above, then I really do not recommend you use this method.

Comments

Exchange 2007 Legacy Mailboxes

This one comes via Kerm.

We have an Exchange 2003 and Exchange 2007 server working side by side, with the 2003 server on the PDC (Primary Domain Controller).

Due to this when creating a new AD account from the PDC, even if you set the mailbox as being on the 2007 server, the mailbox will still show as “Legacy Mailbox”, to correct this you will need to launch the Exchange management shell and run the following command line:

set-mailbox -identity “mbox_alias” -ApplyMandatoryProperties

et voila job done.

Comments

IPM_SUBTREE Outlook and the Vanishing Emails

Outlook is one of those programs we all love to hate at some point in time, particularly when it does something completely random like say lose that selection of emails you were trying to move to another folder, if you can find these emails i.e. one was flagged and showing up under “flagged for follow up”, the “in folder” field displays IPM_SUBTREE.

Let’s start with some conceptual background (In that this is how I logically see this working due to the errors that have occurred).

Your exchange mailbox is effectively a database, however in the more traditional sense of a “Containers” model.

i.e.

Grandparent > Parent > Child is a standard logical representation of programmatic relationships, in this case however it is more relevant to think of the structure as if it were a file system, with folders (containers).

i.e.

C:\Grand_Parent\Parent\Child

Ok so that’s the “container” concept out of the way, now for the moving procedure, from what I can tell all mail is stored within the IPM_SUBTREE, this essentially is the CHILD object which contains a subset of further folders, inbox etc … (Grandchildren)

When copying / moving email to a folder in outlook (Grandchild object), the email is first copied / moved to the IPM_SUBTREE (Child) folder, if an error occurs for any reason however that is where it stays!

The IPM_SUBTREE and higher up folders / containers are not visible in outlook, so to the end user these emails are lost.

To the sys admin however you now know they are simply “misplaced”, to recover these you need a program that can see the IPM_SUBTREE, this is available from https://support.microsoft.com/?kbid=887724 “MFCMAPI_BIN.exe”

You will need to run this from the computer that is having problems, the user will also most likely need local administrative rights on that machine, alternatively as a Domain Administrator, set yourself with full rights to the problem mail box, and create a new outlook profile.

After downloading the .exe you will be prompted to extract the program, i.e. to C:\MFCMAPI, now run it:

C:\MFCMAPI\MFCMapi.exe

Once started Click Session > “Logon and Display Store Tables”

You will them be prompted for a profile to use (Default: Outlook)

The top line in the Display Name field should read: “MailBox - Username”, click to select this line and right click to bring up the context menu, now click “Open Store”

You will be presented with a new window, on the left there will be a tree navigation displaying “Root - Mailbox”, expand this list and click on IPM_SUBTREE, right click and select “Open Contents Table”, again you will get a new window, ideally with nothing listed, if items are listed, select them and right click copy messages.

Now close the window, right click the destination folder i.e. inbox, and “Open Contents Table”, in the new window right click anywhere in the list and select “Paste Messages”, you may also be prompted to choose whether to move or copy the messages.

Follow the prompts and once complete the messages will be in the destination folder.

Any problems leave a comment.

Comments

iCluster Update

No joy so far, and despite my postings to the local freecycle groups my list postings have been rejected as being “too extravagant” …

Ok so I can understand their reasoning with it being a request for 1st gen iPhones … still dissapointing as the intention is in fact to recycle them into a working cluster …

Ho hum …

Comments

PHP Portscanning

This is another old proof of concept I had several years ago, you can infact use PHP to scan ports, bare in mind the legality of this is still somewhat hazy therefore if you must portscan I recomend you only do so on Systems you operate.

Disclaimer: This tutorial is provided for informational purposes only.

UPDATE: Project file now available from https://svn.blog.oneiroi.co.uk/branches/port_scanning/trunk/port_scanning.php

Sample output:

----- PORT SCAN 11 TCP PORTS -----
HOST: 127.0.0.1
DATE: Thu, 19 Jun 2008 08:43:13 +0100
PORT 80 OPEN
PORT 81 CLOSED
PORT 82 CLOSED
PORT 83 CLOSED
PORT 84 CLOSED
PORT 85 CLOSED
PORT 86 CLOSED
PORT 87 CLOSED
PORT 88 CLOSED
PORT 89 CLOSED
PORT 90 CLOSED
PORT 87 CLOSED
PORT 88 CLOSED
PORT 89 CLOSED
PORT 90 CLOSED

NOTE: The current timeout is 0.5s per socket meaning you have a potential runtime of (($endport - $start_port) * 0.5) seconds. Make sure this does not excced your max execution time, or in the construct add:

$time = (($endport - $start_port) * 0.5) + 5;
set_time_limit($time);

This will increased the max execution time with a 5 second buffer.

Please also note in most cases of “shared” hosting you will not be able to crate socketed connections, they will either be blocked by the hosting providers firewall, or disabled at the php runtime, therfor not giving an accurate result.

Again please note this is a proof of concept, you may freely distribute the code under the MIT licence