• Getting Error: This Setup Requires Internet Information Server 5.1 or higher and Windows XP and higher when installing setup project on windows server 2008 and IIS 7

     

    Introduction:

    I was getting the error:

    This Setup Requires Internet Information Server 5.1 or higher and Windows XP and higher when I was trying to install a setup project on windows server 2008 with IIS 7.0.

    After 1 hour of searching, I discovered there was some configuration problems with the Conditions Editor (Requirements on Target Machine)

    Capture0

    Walkthrough:

    • Go to the setup project setup and Launch the Conditions Editor.

    Untitled

    • Right click on the IIS Condition and view the properties

    image

    • Check Condition Formula; it should as the following:

    (IISMAJORVERSION >= "#5" AND IISMINORVERSION >= "#1") OR IISMAJORVERSION >= "#6"

    In the above case, the minimum IIS Version required is 6.

    If you want to install on IIS Version 7.5 and above then use the below condition formula:

    (IISMAJORVERSION >= "#7" AND IISMINORVERSION >= "#5")

  • How to Query Custom View in Event Viewer using C# Code

    Introduction:

    I want to talk about how to filter events from the custom views in windows event viewer; that will give you more ability to drill down and give you more advance filtration options using C# Code.

    Below is an example how to use the same custom view and setting the options in your server side code.

    Walkthrough Scenario:

    Querying the custom view needs to create a dynamic XML Query; a good start to generate the basic XML Query is by generating one using the event viewer:

    image

    image

     

    Now the extra filtration will be using the Event Level and the Time Generated:

    queryString = "<QueryList>" + "<Query Id=\"0\" Path=\"Microsoft-Windows-Application Server-System Services/Admin\">" + "<Select Path=\"Microsoft-Windows-Application Server-System Services/Admin\">*[System[Provider[@Name='Microsoft-Windows-Application Server-System Services' or @Name='Microsoft-Windows-Application Server-System Services Event Collector' or @Name='Microsoft-Windows-Application Server-System Services Hosting' or @Name='Microsoft-Windows-Application Server-System Services IIS Manager' or @Name='Microsoft-Windows-Application Server-System Services Power Shell' and *[System[(" + ddlFilterByType.SelectedItem.Value.ToString() + ") and TimeCreated[timediff(@SystemTime) &lt;= " + ddlFilterByTime.SelectedItem.Value.ToString() + "]]]]]]</Select> " + "<Select Path=\"Microsoft-Windows-Application Server-System Services/Debug\">*[System[Provider[@Name='Microsoft-Windows-Application Server-System Services' or @Name='Microsoft-Windows-Application Server-System Services Event Collector' or @Name='Microsoft-Windows-Application Server-System Services Hosting' or @Name='Microsoft-Windows-Application Server-System Services IIS Manager' or @Name='Microsoft-Windows-Application Server-System Services Power Shell' and *[System[(" + ddlFilterByType.SelectedItem.Value.ToString() + ") and TimeCreated[timediff(@SystemTime) &lt;= " + ddlFilterByTime.SelectedItem.Value.ToString() + "]]]]]]</Select> " + "<Select Path=\"Microsoft-Windows-Application Server-System Services/Operational\">*[System[Provider[@Name='Microsoft-Windows-Application Server-System Services' or @Name='Microsoft-Windows-Application Server-System Services Event Collector' or @Name='Microsoft-Windows-Application Server-System Services Hosting' or @Name='Microsoft-Windows-Application Server-System Services IIS Manager' or @Name='Microsoft-Windows-Application Server-System Services Power Shell' and *[System[(" + ddlFilterByType.SelectedItem.Value.ToString() + ") and TimeCreated[timediff(@SystemTime) &lt;= " + ddlFilterByTime.SelectedItem.Value.ToString() + "]]]]]]</Select> " + "</Query>" + "</QueryList>";

    *[System[(" + ddlFilterByLevel.SelectedItem.Value.ToString() + ") and TimeCreated[timediff(@SystemTime) &lt;= " + ddlFilterByTime.SelectedItem.Value.ToString() + "]]]

    The values for the dropdown list to filter by level will be set as the following:

    <asp:DropDownList ID="ddlFilterByType" runat="server" Height="16px" Width="160px"> <asp:ListItem Text="All Levels" Value="0,1,2,3,4,5" /> <asp:ListItem Text="Critical" Value="Level=1" /> <asp:ListItem Text="Error" Value="Level=2" /> <asp:ListItem Text="Warning" Value="Level=3" /> <asp:ListItem Text="Information" Value="Level=4" /> <asp:ListItem Text="Verbose" Value="Level=5" /> </asp:DropDownList>

    The values for the dropdown list to filter by Time will be set as the following:

    <asp:DropDownList ID="ddlFilterByTime" runat="server" Width="160px"> <asp:ListItem Text="Any Time" Value="0" /> <asp:ListItem Text="Last Hour" Value="3600000" /> <asp:ListItem Text="Last 12 Hours" Value="43200000" /> <asp:ListItem Text="Last 24 Hours" Value="86400000" /> <asp:ListItem Text="Last 7 Days" Value="604800000" /> <asp:ListItem Text="Last 30 Days" Value="2592000000" /> </asp:DropDownList>

    Now we need to initialize an instance of the EventLogReader by specifying and EventLogQuery:

    EventLogQuery eventsQuery = new EventLogQuery("Application", PathType.LogName, queryString); EventLogReader logReader = new EventLogReader(eventsQuery);

    Read the EventLogReader by looping through the EventRecord:

    for (EventRecord Instance = logReader.ReadEvent(); null != Instance; Instance = logReader.ReadEvent()) { String EventID = Instance.Id.ToString(); }
  • Moving SharePoint Databases to Another Server (Without Reconfiguring SharePoint)

    Introduction

    Moving / Migrating Microsoft SharePoint Server Databases from one server to another might be difficult as you need to reconfigure all the related DB(s) to point at the new server. This might be acceptable if we are talking about the SharePoint Content Databases, but how about the below scenarios:

     

    Scenario # 1:

    Moving the SharePoint Configuration DB(s) or the SharePoint Service Application DB(s)?

     

    Scenario # 2:

    Lets consider another scenario, where you want to move the SharePoint DB(s) from a Single Standalone SQL Server to a Highly Available Cluster Server, or maybe even configure it to use on of the new features such as SQL Server AlwaysOn.

    Suggested Solution:

    The answer to the above scenarios might not be as straight forward as it seems, as you might need to reconfigure each DB & Service Separately, so how about suggesting the use of SQL Server Aliases as it could be consider a good starting point for both of the above scenario.

     

    Walkthrough Scenario

    To start take a backup of the SharePoint Server DB(s) that you want to move, this can be easily done using Microsoft SQL Server Management Studio. After the backup is complete restore the Database(s) on the new server.

     

    Note:

    • More information about SQL Server DB Backup & Restore can be found here.
    • This approach will not migrate SQL Server other components such as SSRS or SSAS ... etc. however it could be considered a good start to the migration process.
    • After Defining the SQL Sever Alias the Database on the Source Server will not be accessible and can be removed.

    After successfully restoring the SharePoint DB(s) we need to start configuring the SQL Server Alias. To achieve this goal we need to do the following steps on All the SharePoint Servers in the Farm; such as WFE, APPS ...etc.:

    Go to Start >> Run >> Type CliConfg.exe and the below screen will appear:

    Select the Alias Tab and click Add:


    Select TCP/IP from the Network Libraries and Enter the following Values:


    Server Alias: This is the New SQL Server Name Network Name 

    • In Case of SQL Server FCI then this could be the cluster name
    • In Case of SQL Server AlwaysOn AG this could be the SQL Listener Name

    Server Name: This is the Old SQL Server Network Name

    Port Number (if needed)

     

    And that's its, you will see the new SQL Server Alias added as shown and you are ready to start using the new Database.

     


     

    Don't forget to apply these changes to all the SharePoint Servers in the farm. hope you found it useful

     

    Additional References

    Below are some useful references that provides more information about the items mentioned in the above post:

    Creating a SQL Server alias using the SQL Server Client Network Utility

    Plan Your SharePoint Farm Right with a SQL Server Alias

    Create SQL Server Alias – CliConfg.exe

  • VHD Disk Requirements in Windows Azure Pack (WAP)

    There are some prerequisites for VHD Disks that need to be ready before decide to present VHD Disk in WAP to be used why Virtual Machine Provisioning that will save you a lot of troubleshooting time if you verify all as follows:

    1. Library Share that hosts the VHD must be added to the list of Read-Only shares in Cloud Properties in VMM.
    2. The VHD must have “FamilyName” property configured.
    3. The VHD must have “release” property set in the format like n.n.n.n (e.g. 1.0.0.0).
    4. The VHD must have the Operating System property set.
    5. VHD must have the required Tags by Gallery item, the Tags requirements can be found in Gallery item’s readme, this property can be configured only through VMM PowerShell using set-scvirtualharddisk cmdlets, knowing that Data VHD Disk does not require Tag.

    More resources with more details for each step that include videos as well can be found here:

    Troubleshoot Gallery Item:

    http://blogs.technet.com/b/privatecloud/archive/2013/11/27/troubleshooting-windows-azure-pack-and-gallery-items-part-2.aspx

    Troubleshoot WAP:

    http://blogs.technet.com/b/privatecloud/archive/2013/11/08/troubleshooting-windows-azure-pack-spf-amp-vmm.aspx

    Troubleshoot SPF:

    http://blogs.technet.com/b/scvmm/archive/2013/11/12/general-troubleshooting-list-for-windows-azure-pack-wap-and-spf-integration.aspx

    As a conclusion, you should be aware about all the above prerequisites that need to be verified before start testing creating VM using VHD Disk or from Gallery.

  • Using Host Integration Server COBOL Import Wizard

    Introduction

    Host Integration Server allows application integration with the Mainframe system using the Transaction Integrator (TI) component. The method to implement this integration involves building what is called a TI assembly. TI Assembly is actually built using the definition of the interface between the Mainframe program and the definition of the input and output COM areas. This involves in many cases reading large COBOL files and manually adding them to the TI library. The HIS development tools have added the import utility to simplify importing from COBOL copy book files but as we will see in this post this still have many challenges and I will provide in this post a systematic approach to facilitate importing a COBOL copy book file.

    Discussion

    COBOL copy books are the way Mainframe programs define the inputs and outputs. You can think of these as the signature of C# methods. These are mainly text files with specific structure. You can find more details about the definition of the structure of the COBOL copy book files here. A COBOL copy book file would look something like the below:
    clip_image002
    Now usually you would receive two COM area definitions like the above, one for the input COM area and another for the output (if they are different) from the Mainframe team. So the challenge here is how to use the HIS import utility to import these into one method in the TI assembly. Usually when you try to import the import wizard would crash and would not give you enough description of where was the problem so you would end up adding these things manually and that would be ok for smaller programs (like the above) but for more complex programs where you have more than 20-50 fields in input and outputs that would be a very tedious task. The section below would provide a simple approach and walkthrough on how to import these files and use the import wizard successfully every time.

    Solution & Walkthrough

    The HIS import wizard is very sensitive to the spaces and structure of the COBOL copy book file. So for example a following misalignment would fail the import.
    clip_image004
    So the first thing you need to do when dealing with COBOL copy books is to align them perfectly. To do this I recommend using a tool such as Notepad ++ as it understands this type of file and it actually shows you very helpful vertical guidelines.
    clip_image005
    So this simplify spotting misalignments.
    The second thing you need to do is to merge the inputs and outputs COM area definitions in one COBOL copy book file while aligning the outputs as if it is part of the input and I will show you later how these would be separated. Just give it a name with the same program name while adding any suffix such as “-OUT” to it. Please also note that every line has to be terminated with a dot.
    clip_image006
    Now that you have created and saved the COBOL copy book file open Visual Studio and create a new client TI library in a TI project. Now import it as follows:

    1-    
    clip_image007

    2-    
    clip_image009

    3-    
    clip_image010

    4-    
    clip_image012

    5-    
    clip_image013

    6-    
    clip_image014

    7-    
    clip_image016

    8-     Now the method is created as follows:
    clip_image018