June 12, 2012

Remove VMware Workstation or Player when Hyper-V is installed

Challenge

Time to go all in with Windows 8 and migrate development environments to Hyper-V.

When you’re migrating from VMware to Hyper-V, and you happen to install Hyper-V before uninstalling VMware Workstation or Player, you will get warning that VMware uninstall cannot proceed while Hyper-V role is installed on the server or workstation.

Solution

Modify file C:\ProgramData\VMware\VMware Player\Uninstaller\bootstrap.lua, or C:\ProgramData\VMware\VMware Workstation\Uninstaller\bootstrap.lua using text editor and comment out line

CheckForMSHyperV()

with two dashes, so it will become

--CheckForMSHyperV()

Then save file and rerun the uninstall and it will succeed.

 

Technorati Tags: ,

June 7, 2012

SharePoint: Web part title bar colors using jQuery, part 2

Challenge

How to set web part title bar colors so that different web parts have different colors? How about making it easy also for content editors who have no HTML/JavaScript/jQuery skills?

Solution

Sure thing. Instead of hard coding the colors to web part titles, let’s append name of the color in front of the web part title. Then with jQuery, let’s set the color accordingly, and finally remove the color definition when the page has been rendered.

  1. First, create web part with title [PURPLE]Actual title.
    1. [PURPLE] is the name of the color you want this web part’s title bar to have
  2. Add CEWP to your page, or by other means register the following JavaScript on your page. CEWP must be located after the web parts that are modified as I don’t want to use document.ready as users might notice old colors for a moment when pages reload before the JavaScript kicks in.

    $('td[title^="[PURPLE]"]').siblings().andSelf().addClass("WPTITLEPURPLE");
    $('td[title^="[PURPLE]"]>h3').addClass("WPTITLEPURPLE");

    $('td[title^="["]').each(function ()
      {
        $("#" + $(this).attr('id').replace('Title', 'Caption')).prev().html(function (index, oldhtml)
        {
            return oldhtml.substr(oldhtml.indexOf(']') + 1);
        });
      });

jQuery starts with selector is used (^=) to search for web part titles with color definitions. The color is set with background-color in a CSS class, which in this example is WPTITLEPURPLE. Last part of the jQuery above removes the color definition text from the web part titles.

As you might guess, further improvement on this would be to define the color in the web part title using actual colors, e.g., [#CCCCCC], [rgb(123,123,123)], or even with actual names of the colors, like [blue]. One could then use RegExp to get the real color and inject that to correct elements using jQuery. Downside of this is that branding might be adversely affected as any color could be used; also some content editors might not be familiar with these types of color notations.

See part 1 if your web parts and titles are relatively static or content editors like to work with jQuery.

 

Technorati Tags: ,

SharePoint Online: Grant permissions for Delegated Administrators

Challenge

After setting up a company as delegated administrator of a Office 365 tenant, I noticed that I couldn’t modify SharePoint Online content and sites of the tenant. This is obvious as they didn’t have any permissions to SharePoint in the first place. What wasn’t so obvious, was the user account or group that should be used when granting permissions to the delegated admins.

Solution

  1. Go to https://XYZ.sharepoint.com/_layouts/groups.aspx page on your site
  2. Find a group named Foreign Principal for ‘DELEGATE’ in Role ‘Company Administrator’ (GUIDS)
    1. ‘DELEGATE’ is the name of the company that was set as delegated admin for the Office 365 tenant
    2. (GUID) isn’t really a GUID, but a alphanumerical string containing dashes, that looks like GUID
    3. Example: Foreign Principal for 'Sulava Oy' in Role 'Company Administrator' (123456aa-5eaf-34ga-a11b-5b0adf095e9a5b13a072-5e7a-6b35-6b35-a9b3e7ae45aa)
  3. Click on the group name
  4. Copy Account string of the group, e.g., c:0ǵ.c|tenant|654321aa-5e7a-6b35-6c71-23456d4564dd
  5. Paste the account name to Site Collection Administrators group, or wherever you wish to grant permissions for the Delegated Admins
Technorati Tags: ,