Friday, June 24, 2011

Error 2147504141 - Hub Transport Role Install Failed

From the series "the error is between the chair and the keyboard":

I tried installing Microsoft Exchange 2010 SP1 on a Hyper-V 2008 R2 virtual machine.
The Hub Transport Role installation kept failing with error 2147504141.

The solution: 


1. Install SP1 for 2008 R2 and all available updates.
2. Install corresponding prerequisites.

1) Add role - Active Directory Services
2) Configure Active Directory
3) Add role - Active Directory Lightweight Services
4) Add feature - Windows Process Activation Service
    - Process Model
    - Configuration APIs
5) Add role - Web Server (IIS)
    - Security - Basic Authentication
    - Security - Windows Authentication
    - Security - Digest Authentication
    - Performance - Dynamic Content Compression
    - Management Tools - IIS 6 Management Compatibility (include all items under this service)
6) Add feature - PowerShell
7) Enable Net.Tcp Port Sharing from services.msc.
8) Apply the 2010 Office System Converter (not the 2007!!!!)

Here is an extremely helpful link:
http://www.igetmail.com/how-to-setup-exchange-2010/how-to-complete-the-setup-of-exchange-2010.html#continue

3. Do this before installing Exchange:
Run following commands from Exchange setup CD to prepare AD for Exchange 2010

1) To prepare legacy Exchange permissions in every domain in the forest that contains the Exchange Enterprise Servers and Exchange Domain Servers groups, run the following command.
setup /PrepareLegacyExchangePermissions or setup /pl
2) From a Command Prompt window, run the following command.
setup /PrepareSchema
3) From a Command Prompt window, run the following command.
setup /PrepareAD /OrganizationName:"First Organization"
4) From a Command Prompt window, run one of the following commands:
setup /PrepareDomain


http://www.infotechguyz.com/exchange2010/PrepareADforexchange2010.html
This worked :D. Running the 4 setup commands before installing will make it work like a charm.

4. Continue with the Exchange installation.
Installation should be successful now.

5. Try fixing errors using this link:
http://msexchangeguru.com/2011/08/13/2147504141/
Did not work for me though..

Thursday, June 23, 2011

Error: You must close all dialog boxes before you can close Exchange Management Console.

If you are getting following error when trying to close Exchange Management Console,











here is what you have to do:

1. Go to Control Panel -> Programs -> Uninstall a program -> View installed updates.
2. Search for Internet Explorer 9 -> Uninstall.
3. Restart.

Now closing the Exchange Management Console should work.

It looks like a fix was made: http://blogs.technet.com/b/exchange/archive/2011/10/17/a-fix-for-the-interoperability-issues-between-exchange-2007-and-2010-emc-and-ie9-is-now-available.aspx

Friday, June 17, 2011

QTP and Outlook

Here are some useful QTP functions for working with Outlook:

' #1 ========================== Send email with attachment from Outlook ======================
Public Function SendEmail(ByRef receiver, ByRef subject, ByRef body, ByRef attachment)
    Dim objOutlookMsg,objOutlook
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    objOutlookMsg.To = receiver
    objOutlookMsg.CC = ""
    objOutlookMsg.BCC = ""
    objOutlookMsg.Subject = subject
    objOutlookMsg.Body = body
    objOutlookMsg.Attachments.Add attachment
    objOutlookMsg.Send
End Function

' #2 ========================== Read email from Outlook ==================================
 Public Function ReadEmail(ByRef Subject)
   Dim objOutlookRead,objOutlook,objFolder
    'Subject="this is the message body"
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookRead = objOutlook.GetNamespace("MAPI")
    Set objFolder=objOutlookRead.GetDefaultFolder(6)
    For each item1 in objFolder.Items
        If item1.unread  Then
'            item1.unread = false
            If InStr(item1.body, Subject) then
                 ReadEmail=True
            else
                ReadEmail=false
            End if
        End If
    Next
    wait 2
End Function

' #3 ========================== Delete email from Outlook =================================
Public function DeleteEmail(ByRef Subject)
   Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookRead = objOutlook.GetNamespace("MAPI")
    Set objFolder=objOutlookRead.GetDefaultFolder(6)
    For each item1 in objFolder.Items
        If InStr(item1.body,Subject) then
            item1.delete
        End If
    Next
    wait 2
End Function

' #4 ========================== Download Email Attachment from Outlook ======================
Public Function DownloadAttachment
      Dim objOutlookRead,objOutlook,objFolder
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookRead = objOutlook.GetNamespace("MAPI")
    Set objFolder=objOutlookRead.GetDefaultFolder(6)
    For each item1 in objFolder.Items
        If item1.unread  Then
            For each att in item1.attachments
                FileName="C:\Documents and Settings\administrator\Desktop\"&att.FileName&"1"
                att.saveasfile FileName
            Next
        item1.unread = false
        End If
    Next
    wait 5
End Function

' #5 ========================== Check Email Attachment exists in Outlook =====================
Public Function CheckForAttachment(ByRef attachment)
    Dim objOutlookRead,objOutlook,objFolder
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookRead = objOutlook.GetNamespace("MAPI")
    Set objFolder=objOutlookRead.GetDefaultFolder(6)
    For each item1 in objFolder.Items
        If item1.unread  Then
            For each att in item1.attachments
                FileName=att.FileName
                If InStr(FileName, attachment) then
                 CheckForAttachment=True
                else
                 CheckForAttachment=false
                End if
            Next
        item1.unread = false
        End If
    Next
    wait 5
End Function

To be continued...

Thursday, June 16, 2011

Verify all WebCheckBoxes are checked in a WebTable

When testing a web application I wanted to check if all checkboxes in a webtable are checked.
Here is one simple solution that worked for me:

'count table rows
webtable_rows=Browser("version:=internet explorer 8").Page("title:=test*.*").WebTable("class:=rgMasterTable").RowCount


'count checked checkboxes
Dim oDesc
Dim colObject
Set oDesc=Description.Create
oDesc("micclass").value="WebCheckBox"
oDesc("checked").value=1
Set colObject=Browser("version:=internet explorer 8").Page("title:=test*.*").WebTable("class:=rgMasterTable").ChildObjects(oDesc)
checked_count=colObject.count

'if checked checkboxes number is equal to the rows number then all checkboxes are checked (in my case each row has a checkbox with property "checked" equal to 1 when checked and 0 when unchecked)
If webtable_rows=checked_count then
    reporter.ReportEvent micPass, "All rows selected",""
else
    reporter.ReportEvent micFail, "Not all rows are selected",""
End If

Note: Initially I wanted to do a for i=1 to webtable_rows and verify the checkbox on each row is checked, but I did not manage to make it work like this.

Wednesday, June 15, 2011

Setup previously failed while performing the action "Uninstall". You cannot resume setup by performing the action "Install"

To get rid of this anoying error:
1. Go into the registry and delete the watermark and action key located here:
HKLM\SOFTWARE\Microsoft\ExchangeServer\v14\AdminTools
2. Resume Install/Uninstall.

Monday, June 13, 2011

Web Testing Add-ons from Firefox and Chrome

There are many useful add-ons for Web Applications Testing. Here are a few from Firefox and Google Chrome.

Firefox:
Web Application Security Penetration Testing
- https://addons.mozilla.org/en-US/firefox/collections/adammuntner/webappsec/

Chrome:
Let's make the web faster
- http://code.google.com/speed/tools.html

Have fun!

Monday, June 6, 2011

Message size limits in Exchange 2007 and 2010

1. Go to Start -> Programs -> Microsoft Exchange Server 2007/2010 -> Exchange Management Console.
2. Organization Configuration -> Hub Transport -> Global Settings -> Right-click on Transport Settings -> Properties.
3. Edit Maximum receive size (KB):, Maximum send size (KB):, Maximum number of recipients: -> Apply -> Ok.



Friday, June 3, 2011

Install Virtual SMTP Server on 2008 Server

Here are the steps you need to follow in order to install SMTP Virtual Server:

1. Open Server Manager from Start menu.
2. Go to Features -> Add Features -> check SMTP Server.

















3. Next -> Next -> Next.
4. Click Install.

















5. Wait until install is complete and click Close.


6. Open IIS 6.0 Manager under Administrative Tools -> Internet Information Services 6.0.

7. Right-click [SMTP Virtual Server] and Properties.

8. Go to Access tab -> click on Relay.


9. Select Only the list below and click on Add button.

10. Enter IP Address 127.0.0.1 for relay.


11. Send a manual email through telnet to confirm everything working successfully. Telnet is also installed from Server manager -> Add Features).
- Open Command Prompt and type: 
telnet localhost 25 (Enter key)
HELO (Enter key)
mail from: anyuser@anymailserver.com (Enter key)
rcpt to: anotheruser@anymailserver.com (Enter key)
data (Enter key)
mail test (Enter key)
- You should see something similar to this:


Now you have a new Virtual SMTP Server.


Note: Virtual SMTP Server is available only for IIS6.