Blogs


  • How to change the product key on a Windows 2008 R2 Server Core


    By default the windows server 2008 core comes with a dummy product key that you must change before 28 days or so.

    To change the product key run this command

    start /w slmgr.vbs -ipk ABCDE-FGHIJ-KLMNO-PQRST-UVWXY

    where ABCDE-FGHIJ-KLMNO-PQRST-UVWXY is your product key

    To activate the product key run

    start /w slmgr.vbs -ato

    to check the license and the activation state you have run this

    start /w slmgr.vbs -dli

    found this useful information in this site:

    http://blogs.dirteam.com/blogs/sanderberkouwer/archive/2008/04/01/activating-server-core.aspx


    Continue reading...



  • How to deactivate ValidateRequest


    Microsoft offers by default a way to prevent any person entering in our input box some weird character that causes harm to our website, for example any script:

    When you click the button we'll have this:

    This is good to avoid some scripts entry in a blog for example, but this is not good when you have to save in the database an auto generated password (p<!kj1fg) with this rare characters. In this case you don't need this. To deactivate this you have two ways:

    -If you need it in certain pages, add ValidateRequest="false" in the Page section:

    -If you need it in all pages, add in the web.config pages section this:

    In any of these options you need to add this in the web.config httRuntime section:

    Enjoy it!

    Original source:

    http://stackoverflow.com/questions/2673850/validaterequest-false-doesnt-work-in-asp-net-4


    Continue reading...



  • Word Automation in ASP.NET


    Automating Microsoft Office Word 2010 is very easy and very detailed for any windows application or even when running an ASP.NET application inside the Web Server that comes with Visual Studio 2010 looks to be easy. However when we deploy our solution to a windows server 2003 or 2008 nothing works. The tweak is to touch some registry values and configure some DCOMs as explained on this post

    http://forums.asp.net/t/1358207.aspx/1

    • First, use regedit (from the SysWOW64 folder) to search the registryfor the CLSID(s) related to the command "WINWORD.EXE /Automation" , you might find more than one of them.

      (in my case this was: {000209FE-0000-0000-C000-000000000046} and {000209FF-0000-0000-C000-000000000046})

      Under those keys in HKEY_CLASSES_ROOT\CLSID\, add a string value AppID = {same value as the IDs}

      Then under HKEY_CLASSES_ROOT\AppID\ create a new key (folder) for each of these IDs, and inside each of them add a string value: RunAs = Interactive User

      Next go to Dcomcnfg (from the SysWOW64 folder) and search for those IDs. (there might be a third ID related to Winword.exe), in my case this was {00020906-0000-0000-C000-000000000046}.
      Note all those IDs, then right click on each of them, Properties, Security, and edit both the launch & access permissions to add and give Network Service and Interactive full permissions.


    Continue reading...



  • Redirect To A Custom Page After Completing A List Form


    As we know, Sharepoint make us easy let the end user populate a list with data though List Forms.

    These are out-of-the-box features that Sharepoint design for us.

    Well, using these Forms I came across with the fact that after submit the form, Sharepoint redirect you to the List that the form belongs to.

    This is a problem. Generally we don't want the user read the information on this list.

    So, how can we avoid it and redirect the user to a custom page?.

    Go to the page where you have placed the List Form.
    At the end of the Url you will have to add the following Query String.
     

    • ?Source=%2F Containing Folder%2FPageName%2Easpx&RootFolder=

    Note that the query string is basically the url of our custom page, using '%2F' instead '/' and '%2E' instead of '.' .



    You will se that after submit this form you will be redirected to you custom page.

    So, what remains for us to do is add the query string to the link that calls the page. For example:



     

    NOTE: You will find on internet different solutions to do this same thing, for example, replacing the 'save' button with this Input control:

    <input type="button" value="submit" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}" />

    This input seems to work, but when you add validators to the fields, it fails to check the conditions before to redirect you to the custom page.

    Continue reading...



  • Simple Column Validation in Sharepoint 2010


    In Sharepoint 2010 we can easily validate the column values entered into list items.

    We have two levels of validation:

    1. Column level
    2. List level
    Both of them use Sharepoint Formulas. Here you can find a complete list of formulas and functions

    and the description of each of them:

    http://officebeta.microsoft.com/en-us/sharepoint-foundation-help/CH010372694.aspx

    I will show two simple examples of how to use column validation, at column level and at list level.

    Example 1 : Column Level Validation.

    1. Create a new column on a list, click 'column validation':

    2. Into the 'Formula' text area add a validation Formula. For example, I'll add a very simple E-mail format validation:

      Note that into 'User message' text area you can enter the message you want the user see when the validation is not passed.

    Example 2 : List Level Validation.

    1. In the List Settings, click on 'Validation Settings'.

    1. Into the 'Formula' text area add a validation Formula. For example, this formula check that Value3 is the biggest and Value2 is bigger than Value1*.

    About Conflicts:

    We have to take into account that Sharepoint evaluate firstly the 'Column Level' Formulas and then the 'List Formulas'.

    So, what if List and Column level validations are in conflict?.

        For example:

            •On the one hand we have the following List level Validation:

                [Column1]>[Column2]

            

            •On the other hand we have the following Column level Validation:

                [Column1]=100

                [Column2]=200

    As a result of the conflict, in this case, it will impossible to submit a list item.

    References:

    http://officebeta.microsoft.com/en-us/sharepoint-foundation-help/CH010372694.aspx

    http://blogs.pointbridge.com/Blogs/2010wave/Pages/Post.aspx?_ID=5


    Continue reading...



  • Using Forms To Fill In A List


    Using Forms To Fill In A List

    As we know, Sharepoint 2010 offers us many out-of-the-box features that make us easier the development of our web site.

    One of this features are the Forms that Sharepoint design for us to populate a list with data.

    Suppose you want to add a form in your site so the people can leave you a message. Well, this is what you have to do:

    1 - Create a list with the columns you want the user complete.

    2 – Right, at this point we will need to use the Sharepoint Designer. You have to open the page you want to place the Form and insert a 'Custom List Form'.

    To do this follow these steps:

        • Go to 'Insert Tab' at the Ribbon.

        •Under Control Section select 'Sharepoint'.

        •Select 'Custom List Form…' , at the bottom of the window.

        •Select the list you want to the user fill in.

        • Sharepoint will insert into your page the same form that it is used to add an item to the list. This form can be customized.

        •After this you are done. The user can complete the form and submit it directly to your Sharepoint list!


    Continue reading...



  • Redirect To A Custom Page After Completing A List Form


    Redirect To A Custom Page After Completing A List Form

    As we know, Sharepoint make us easy let the end user populate a list with data though List Forms.

    These are out-of-the-box features that Sharepoint design for us.

    Well, using these Forms I came across with the fact that after submit the form, Sharepoint redirect you to the List that the form belongs to.

    This is a problem. Generally we don't want the user read the information on this list.

    So, how can we avoid it and redirect the user to a custom page?.

    1. Go to the page where you have placed the List Form.
    2. At the end of the Url you will have to add the following Query String.

      • ?Source=%2F Containing Folder%2FPageName%2Easpx&RootFolder=

    Note that the query string is basically the url of our custom page, using '%2F' instead '/' and '%2E' instead of '.' .

    You will se that after submit this form you will be redirected to you custom page.

    So, what remains for us to do is add the query string to the link that calls the page. For example:

    NOTE: You will find on internet different solutions to do this same thing, for example, replacing the 'save' button with this Input control:

    <input type="button" value="submit" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}" />

    This input seems to work, but when you add validators to the fields, it fails to check the conditions before to redirect you to the custom page.

    References : http://www.graphicalwonder.com/?p=666


    Continue reading...



  • Installing Hyper-V in a windows 2008 R2 Server Core Setup


    Ok, so I have a goal to install a new server with only the Hyper-V role on windows 2008 server core setup which is the best recommended way to take all the advantages of the Server resources and hardware.

    My surprise was that after installing the Windows 2008 R2 Core server I only got a command prompt window!!!

    So, how do I enable Hyper-V, looking at different blogs I found this one which told me the right steps.

    http://blogs.technet.com/b/jhoward/archive/2008/03/29/how-to-add-the-hyper-v-role-to-a-windows-server-2008-server-core-machine.aspx

    Thanks John!

    Basically the command to run at the command prompt is

    ocsetup Microsoft-Hyper-V

    Ok, so after restarting the server I got the same command prompt back again, how do I open the Hyper-V manager?

    You will need to use another client computer with for example windows 7 and download and install the Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1)http://www.microsoft.com/download/en/details.aspx?id=7887


    Continue reading...



  • How to refresh the ribbon of the Homepage Grid in CRM 2011


    As we know in an Entity Form of CRM 2011, if we want to refresh the ribbon to reactivate the enable rules or the display rules for example, we call the method refreshRibbon() of the object Xrm.Page.ui. But what happen if we try this method in the ribbon of the Homepage Grid of an Entity? We'll find that the Xrm.Page.ui returns null and therefore won't have the method previous mentioned. Then, what we have to do to refresh the ribbon in the Homepage Grid for example when another button in the Ribbon needs to update the rules when it is clicked?

    This method is not supported by Microsoft. Use it under your own risk.

    Is very simple. The only thing we have to do is to call the click event of the refresh button of the entity grid in our function:

    function RefreshHomeRibbon(){

          var refresh = document.getElementById("refreshButton"); // this will be the table container

          if(refresh != null) {

            refresh.children[0].children[0].children[0].children[0].onclick(); // call click event in the <a> tag

            //       <tbody>      <tr>         <td>        <a>    

            // Sometimes you need to call twice to take effect

            refresh.children[0].children[0].children[0].children[0].onclick();

              }

    }

    The refresh object will return an html table. To access the click event you need to enter the <a> tag children and call it.

    And finally call this function in yours (RibbonButtonClick here):

    function RibbonButtonClick(){

         var a = b + c;

         RefreshHomeRibbon();

    }

    Enjoy it!


    Continue reading...



  • CRM Activity Feeds for Onpremise


    Lately there is a new solution released by Microsoft called Activity feeds which is available not only for CRM online but you can also install it on premise versions of Dynamics CRM 2011.

    If you want to install this solution you must be sure you have the Rollup Updates 5 installed on your CRM. 

    You can download this solution from the CRM marketplace at
    http://dynamics-crm.pinpoint.microsoft.com/en-US/applications/microsoft-dynamics-crm-activity-feeds-12884926310
     

    With the CRM 2011 activity feeds solution you can also setup the user's picture profile.



    Click on Edit





    Browse the image you want to use for your profile and click OK



    Now you have updated the image for your user profile.

    Continue reading...