Install. repair and uninstall .Net Framework v4.0

.NET Framework 4 Client Profile (32-bit) – silent repair

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

.NET Framework 4 Client Profile (32-bit) – unattended repair

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive/norestart

.NET Framework 4 Client Profile (32-bit) – silent uninstall

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

.NET Framework 4 Client Profile (32-bit) – unattended uninstall

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

.NET Framework 4 Client Profile (64-bit) – silent repair

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

.NET Framework 4 Client Profile (64-bit) – unattended repair

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

.NET Framework 4 Client Profile (64-bit) – silent uninstall

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

.NET Framework 4 Client Profile (64-bit) – unattended uninstall

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

.NET Framework 4 Full (32-bit) – silent repair

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

.NET Framework 4 Full (32-bit) – unattended repair

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

.NET Framework 4 Full (32-bit) – silent uninstall

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /q /norestart

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

.NET Framework 4 Full (32-bit) – unattended uninstall

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

.NET Framework 4 Full (64-bit) – silent repair

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

.NET Framework 4 Full (64-bit) – unattended repair

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

.NET Framework 4 Full (64-bit) – silent uninstall

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /q /norestart

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q

.NET Framework 4 Full (64-bit) – unattended uninstall

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

Fixed incorrect command lines for uninstall of the .NET Framework 4 extended.

How to disable SharePoint Mobile Views

Well, all of us must agree that SharePoint mobile views are for collaboration sites and cannot be used for publishing sites specially for Internet facing web sites. So what to do. You have 2 options now:

  1. Disable Mobile Views and use one master page for all pages as described in http://kyleschaeffer.com/sharepoint/v5-responsive-html5-master-page/
  2. Customize Mobile Views using Mobile Home page redirection as described in http://msdn.microsoft.com/en-us/library/ms441925.aspx.

I read on multiple blogs that you have to go to $:\inetpub\wwwroot\wss\VirtualDirectories\portal.contoso.com80\App_Browsers\compat.browse folder and disable mobile view per mobile browser. Yes you can do this but if you want to disable it for all mobile browsers, there is an easy way. You can disable it in your web.config by adding following in the section configuration/system.web:

<browserCaps>
  <result type=”System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”/>
  <filter>isMobileDevice=false</filter>
</browserCaps>

SharePoint 2010 Publishing Sites and Mobile Views Authentication Issue

We recently faced an issue with our SharePoint Internet Portal. The Site was published on Internet, but when browsed on Mobile phones, especially Iphone. Whenever you browsed the portal through a mobile device, its throws the authentication window, where you need to provide user id and password.

By default, making a site in SharePoint anonymous not works for mobile users. But this is a very common requirement for Internet Facing web sites, meaning we cannot use SharePoint for Internet? As I started googling, I came to this msdn discussion which concluded same, but there should be some way. There is saying, “Where there is a will there is a way” and there is a way:).

Disable ViewFormPagesLockDown feature from your site collection, since it is by default enabled on publishing sites. Lockdown mode is a feature that you can use to secure published sites. When lockdown mode is turned on, fine-grain permissions for the limited access permission level are reduced. When this feature is enabled, it stops anonymous users accessing any of the layout pages. In case of mobile view, when auser accesses Intranet site,  SharePoint redirects the user to /_layouts/mobile/mblwp.aspx to determine the correct rendering template to be applied. Since it is an application page, LockDown mode will not let the anymous user access the page and he/she will get 401 unauthorized.

Now you know the solution for this, disable the ViewFormPagesLockDown using below powershell command, re-apply permissions (enable anonymous access) and finally recycle IIS to be on safe-side.

Disable-SPFeature -Identity "ViewFormPagesLockDown" -URL http://internet

Here you go!

Update Master Page after update-spsolution

Well if you are a “TRUE” developer, you would prefer to deploy your customizations using SharePoint features rather than backing-up from development and restoring in production environment. So your master pages and css will be part of a feature within a solution package. So what about updates. Will the update-spsolution powershell command update the old master page with the updated one? Yes it will on file system not within SharePoint database, meaning it will not update the master page deployed to a site collection but will be available for the new site collections. So how to update it for the old site collections. You can use powershell deployment script to do the job for you once you have updated the spsolution. Following powershell function will update the master page deployed to a site collection with url $url where $pageUrl is the masterpage URL within the site collection:

function Update-MasterPage([string] $url, [string] $pageUrl)

{

$web = Get-SPWeb $url

$file = $web.GetFile($pageUrl);

$file.RevertContentStream();

write-host “Successfully reverted to definition $($pageUrl)…”

}

You can read master page URLs and Site collection URLs either from a csv or XML. Following function reads master page URLs from a CSV and calls above function:

function Update-MasterPages([string] $url, [string] $csvFile)

{

foreach($page in $data)

{

Update-MasterPage $url $page.Url

}

}

where $csvFile contains the CSV file Path and $url contains Site Collection URL

SSAS errors: Errors in the metadata manager. The dimension with ID of ‘xxx’ referenced by the ‘yyy’ cube, does not exist.

While working on an SSAS solution, my Visual Studio crashed. When I restarted it and tried to deploy database, it started giving me error:

After some bit of googling, came to the following article. SSAS errors: Errors in the metadata manager. The dimension with ID of ‘xxx’ referenced by the ‘yyy’ cube, does not exist.. Once I removed old database from database directory which is “$:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data” and restarted the Analysis Service on target instance, I was able to deploy the solution.

Unable to delete SharePoint 2010 ContentType “Contenty type in use.”

Recently I was asked to revamp an existing SharePoint solution using content types and lists for storage. As part of restructuring, we changed content types ans list definitions. To ensure a clean environment, we removed old content types/list definitions/lists from QA using followig steps:

  • deleted all lists referencing the content type
  • emptied the site level and site collection level recycle bin
  • deactivated the feature from the UI and command-line using -force
  • uninstalled the feature from the command-line using -force
  • uninstalled the solution

Once we were done with above steps, we were sure all references to content types have been removed and to be on safe side checked content type listting. When we checked content types and site columns, stranglely, some of the content types and site columns were still listed and were not removed. When we tried to remove these content types, we got an error “Can’t delete content type, content type still in use”. After some research and googling, I found this article to check content type usage using following SQL query:

SELECT  SiteId, sys.fn_varbintohexstr(ContentTypeId) AS ID, WebId, ListId, IsFieldId, Class
FROM    ContentTypeUsage
WHERE   (sys.fn_varbintohexstr(ContentTypeId) LIKE ‘ID%’)

where ID is the old content type ID. It lists few lists ID which do not exist in the site and after ensuring these lists are not referenced even in AllUserData and AllLists tables, I deleted these records, then deleted content types manually from Site Settings->Content Types, this time I didn’t receive any error. Once content types are deleted, I intalled new solution containing revamped content types/list definitions/instances. It worked pefectly this time.

If you still face any issue, check this article as sometimes SharePoint will let you disable feature without removing all contained content types and you have to rely on unsupported database update to fix SharePoint bug.