• Coolest thing I have found in server 2012 – Management OData IIS Extensions

    Am I interpreting Management OData IIS Extensions correctly? This means I can write an iOS app to run my custom enterprise PowerShell scripts?

    Now I can justify iOS dev training! Cool.


  • Run PowerShell as system

    .\psexec -i -s Powershell.exe

    Found this from here:


  • Sharepoint 2010 URL for a Calendar’s Week and Month Views

    This may be a post for myself, and everyone may already know this, but I couldn’t find it quickly in a google search. I wanted to have a link to the “Week” view of a SharePoint 2010 calendar, but could not find the parmters to pass. Here they are:

    ?CalendarPeriod=week
    ?CalendarPeriod=month
    ?CalendarPeriod=day

    And to have a specific day:

    ?CalendarDate=8/24/2012


  • Windows Server 2012 can mount ISOs

    About time.


  • Windows Server 2012 Hyper-V can Import Non-Exported VMs

    About time.


  • A PowerPoint 2010 pptx file from a network share opens read-only

    Credit for this one goes to @xrobx99. He did all the work behind this post. I felt that it was such an obscure “bug”, that maybe my posting of the solution might help someone that is expereincing the same issue.

    The problem we were having was that when a user would open a large PowerPoint (.pptx) file from a network share,  it would always open as read-only. Looking like this :

    Now, if you try and search for PowerPoint 2010 and read-only, all I can say is, good luck. You quickly get lost in “your permissions are wrong” ,and “people telling you to right click and deselect Read-only”. We had been trough all of that, and we could not lick the problem.

    The symptoms we were experiencing were:

    • If a user double clicks on a large pptx in a network share through windows explorer, the file is opened read-only
    • If a user right clicks the file and selects open through windows explorer, the file opens correctly
    • If the file is opened either by “double click” or “right click open” on the local machine, the file opens correctly
    • If the file is opened either by “double click” or “right click open” in the PowerPoint file open dialog on either a network share or local machine, the file opens correctly

    The solution that @xrobx99 figured out is that if you disable the “Preview Pane” and the “Details Pane”, the file will open correctly every time. Of course you can disable these via group policy:

    User Configuration/Administrative Templates/Windows Components/Windows Explorer/Explorer Frame Pane/Turn off Details Pane
    And
    User Configuration/Administrative Templates/Windows Components/Windows Explorer/Explorer Frame Pane/Turn off Preview Pane
    

    @xrobx99 concluded that if you leave these two panes enabled, windows explorer will open the file to generate a tumbnail, and if you double click the file during that time, it will open read-only.

    Hope that helps some one.


  • How I went about creating two related lists using JavaScript, Client Object Model and SharePoint 2010-Part3

    This is the final part of these previous, posts. They setup everything (I hope) so give them a quick peak.

    At this point we have the following:

    • We are editing a “new” meeting item in the MeetingList’s EditFrom.aspx page
    • We have a modal dialog box open that contains the AttendeeList’s NewForm.aspx
    • A QueryString has been passed to the modal dialog page with the related ID and List ID

    Now I want to take the QueryString values and put them into the correct fields in the AttendeeList’s NewForm.aspx page (and hide these fields so the can’t be messed with) (also remember that this is all taking place in a modal dialog):

    • First I am going to hide the fields that are going to contain the related List and related item ID
     $('nobr:contains("RelatedList")').closest('tr').hide();
     $('nobr:contains("RelatedItem")').closest('tr').hide();
     
    • Next I need to loop thought the QueryString and grab all the values passed, and if they match the name of an exiting field, I am going to add them to the input box of the field (taken from here). Since the QueryString values RelatedList and RelatedItem match the hidden fields above, their values get put into their input boxes.
    LoopThroughQueryString()
    function LoopThroughQueryString() {
        var queryString = unescape(location.search);
        if (!queryString) {
            return {};
        }
        queryString = queryString.substring(1);
        var pairs = queryString.split("&");
        for (var i = 0; i < pairs.length; i++) {
            var keyValuePair = pairs[i].split("=");
    	$('input[type=text][title='+ keyValuePair[0]+ ']').each(function() {
            $(this).val(keyValuePair[1]);
            });
        }
    }
    
    • Now, when I hit save int he modal dialog, the MeetingList’s related item’s ID and related list ID are added to the new attendee.

    Goal met. Two lists with related items. Phew that was a lot.


  • How I went about creating two related lists using JavaScript, Client Object Model and SharePoint 2010-Part2

    In Part1, I talked about how I wanted to relate items in two lists using the ID of an item in the first list. The setup for this article is here, hopefully it makes sense.

    At this point, I have a  MeetingList item that I am editing, and the ID of the current item is in the current QueryString. This is becasue I used this code in the previous post to redirect to this page:

    window.location.href = "/Lists/MeetingsList/EditForm.aspx?ID="+ oListItem.get_id();
    

    Now I want to add an attendee to this meeting. Here are the steps of how I went about this:

    • I needed to add a “Add new attendee” button to the MeetingList EditForm.aspx page.  I used this jQuery method to add a new row after an existing field.
    
    NewAttendeesRow='<tr id="NewAttendeesRow"><td nowrap="true" valign="top" width="190px" class="ms-formlabel">Add Attendees</TD><td valign="top" class="ms-formbody" width="400px"><img src="/MediaLibrary/plus_icon.gif"> Add NEW attendee</div></td></tr>';
    
    $('nobr:contains("Meeting Subject")').closest('tr').after(NewAttendeesRow); //There is an exisitng field in the MeetingList named "Meeting Subject"
    
    
    • This button, when clicked would fire off a function to open a modal dialog box which will create the related attendee/item in the AttendeeList
    
    $('#NewAttendeesRow').click(function() {
    ExecuteOrDelayUntilScriptLoaded(openModalDialog,"SP.js");
    });
    
    function openModalDialog() {
        var options = SP.UI.$create_DialogOptions();
        options.url = "/Lists/NewAtendee/NewForm.aspx?IsDlg=1&RelatedList="+_spPageContextInfo.pageListId+"&RelatedItem="+GetQueryStringParams('ID');
        options.dialogReturnValueCallback = Function.createDelegate(
                            null, modalDialogClosedCallback);
        SP.UI.ModalDialog.showModalDialog(options);
    }
    
    • This code above opens a modal dialog and passes two values via the QueryString values, the RelatedList and the RelatedItem.
      • The RelatedList value comes from the parent list (MeetingList) using the built in variable _spPageContextInfo.pageListId
      • The RelatedItem value comes from the QueryString of the current MeetingList item we are editing using this function (not sure where I found this)
    function GetQueryStringParams(sParam)
    {
        var sPageURL = window.location.search.substring(1);
        var sURLVariables = sPageURL.split('&');
        for (var i = 0; i < sURLVariables.length; i++)
        {
            var sParameterName = sURLVariables[i].split('=');
            if (sParameterName[0] == sParam)
            {
                return sParameterName[1];
            }
        }
    }
    
    • We end up with the MeetingList’s EditFrom.aspx page, and a modal dialog box that contains the AttendeeList’s NewForm.aspx, with related ID and related List being passed to it.

    Part 3 will finish off my workaround.