Virtual machine “xName” could not be started because the hypervisor is not running!

After an update to Windows 10 version 1703 (mostly I guess it was the cause, some referring to booting error as I already tried to work with an android emulator that changed the configurations of the booting), when I tried to open my SharePoint VMs through Hyper-V Manager I have the following error:

Virtual machine “Domain’ could not be started because the hypervisor is not running.”

I have checked the error details and Microsoft has mentioned one thing regarding changing in the booting configurations, I have also checked the running services and everything was fine, so directly I have checked Windows Boot Manager and I have found the cause of the error!

Follow the below steps, and you will solve your problem too:

  • Run Command Prompt as Administrator
  • Run the command BCDEdit

Scroll to the end, and you will see like below that hypervisorlaunchtype is turned Off!

 

 

  • Now Run the command: BCDedit/set hypervisorlaunchtype auto
  • Run again BCDedit
    to check the effect of the command, now you can see it has turned to Auto, but you will need to reboot your machine to take effect.

     

 

After rebooting, everything is like before:

Advertisements
Posted in SharePoint General | Leave a comment

#SharePoint site collection is in Read Only mode!

Every day, the Administrator do his normal stuff as usual, but sometimes when he tries to take a backup for a site collection, the progress of backing up data is too slow, then he canceled the process and tried another one, while he received a call from end user that his site is turned into Read Only!

The normal diagnostic is checking “Configure quotas and locks” from Central Administration, but after a quick look you will find it disabling all its options like below:

So what’s the solution?!

Fortunately, Microsoft provides us with a very easy solution by a few lines of PowerShell commands:

  • Open SharePoint Management Shell using Administrator account
  • In the PS prompt type accurately the following lines:
PS C:\Users\Admin> $SiteUrl = new-object Microsoft.SharePoint.Administration.SPSiteAdministration(‘http:// sitecollectionurl’)
PS C:\Users\Admin> $SiteUrl.ClearMaintenanceMode()

 

After that the Read Only message and state will be ended, and you can take backup or do regular work.

Posted in SharePoint General | Leave a comment

Download all Microsoft #Build2016 conference videos and slides

For whom missed the great conference of Microsoft Build 2016, here you are the chance to download all the conference without following each link or running out of time!

I have re-developed a PowerShell script to do so, thanks to Vlad Catrinescu whom first made a script for downloading SharePoint conference videos (https://absolute-sharepoint.com/2014/03/ultimate-script-download-sharepoint-conference-2014-videos-slides.html)

You can save the following code as (Build2016.PS1) file and then execute it with PS normally, if PowerShell refused to execute it You just need to change theExecution policy on your computer using a simple Powershell command.

Set-ExecutionPolicy RemoteSigned

This will allow you to run scripts that have been written by “a trusted publisher” (Microsoft determines who is trusted and who isn’t).

Here you are the code:

# Script: DownloadMSBuild2016.ps1
# Version: 1.0 - 2016-04-02
# Author:Hossam kamal (Sr. SharePoint Developer, blog: https://sharepointhero.wordpress.com/)
# Originally published as a SharePoint Conf script by: Vlad Catrinescu (http://absolute-sharepoint.com/2014/03/ultimate-script-download-sharepoint-conference-2014-videos-slides.html)
# I Customized it for Microsoft Build 2016 Conference



Write-Host "###############################################################################################"  -ForegroundColor Yellow
Write-Host "                                                                                               "  -ForegroundColor Yellow
Write-Host "                     Download Microsoft Build 2016 Videos and PPTX                            "  -ForegroundColor Green
Write-Host "                by Hossam kamal (Sr. SharePoint Developer, blog: https://sharepointhero.wordpress.com/)                    "  
Write-Host "                                                                                               "  -ForegroundColor Yellow
Write-Host "         Based on the SharePoint Conference download script by Vlad Catrinescu                 "
Write-Host "                                                                                               "  -ForegroundColor Yellow
Write-Host "###############################################################################################"  -ForegroundColor Yellow

[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath 
$rss = (new-object net.webclient)

# Grab the RSS feed for the MP4 Mobile quality downloads
# Microsoft Build  Conference 2016 Videos and Slides
$a = ([xml]$rss.downloadstring("https://s.ch9.ms/Events/Build/2016/RSS/mp4")) 
$b = ([xml]$rss.downloadstring("https://s.ch9.ms/Events/Build/2016/RSS/slides")) 

#High quality for the videos or if you want mp3 replace the bellow links with the upper
# $a = ([xml]$rss.downloadstring("https://s.ch9.ms/Events/Build/2016/RSS/mp4high")) 
#$a = ([xml]$rss.downloadstring("https://s.ch9.ms/Events/Build/2016/RSS/mp3")) 


$downloadlocation = "C:\Build2016"

	if (-not (Test-Path $downloadlocation)) { 
		Write-Host "Folder $fpath dosen't exist. Creating it..."  
		New-Item $downloadlocation -type directory 
	}
set-location $downloadlocation

#Download all the slides	
$b.rss.channel.item | foreach{   
	$code = $_.comments.split("/") | select -last 1	   
	
	# Grab the URL for the PPTX file
	$urlpptx = New-Object System.Uri($_.enclosure.url)  
    $filepptx = $code + "-" + $_.creator + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
	$filepptx = $filepptx.substring(0, [System.Math]::Min(120, $filepptx.Length))
	$filepptx = $filepptx.trim()
	$filepptx = $filepptx + ".pptx" 
	if ($code -ne "")
	{
		 $folder = $code + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
		 $folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
		 $folder = $folder.trim()
	}
    if ($folder.EndsWith("."))
         {
            $folder = $folder.substring(0, ($folder.Length) - 1).trim()
         }

	else
	{
		$folder = "NoCodeSessions"
	}
	
	if (-not (Test-Path $folder)) { 
		Write-Host "Folder $folder dosen't exist. Creating it..."  
		New-Item $folder -type directory 
	}
	
	#text description from session 
	$OutFile = New-Item -type file "$($downloadlocation)\$($Folder)\$($Code.trim()).txt" -Force  
    $Category = "" ; $Content = ""
    $_.category | foreach {$Category += $_ + ","}
    $Content = $_.title.trim() + "`r`n" + $_.creator + "`r`n" + $_.summary.trim() + "`r`n" + "`r`n" + $Category.Substring(0,$Category.Length -1)
   add-content $OutFile $Content

	# Make sure the PowerPoint file doesn't already exist
	if (!(test-path "$downloadlocation\$folder\$filepptx"))     
	{ 	
		# Echo out the  file that's being downloaded
		$filepptx
		$wc = (New-Object System.Net.WebClient)  

		# Download the MP4 file
		$wc.DownloadFile($urlpptx, "$downloadlocation\$filepptx")
		mv $filepptx $folder 

	}
	}

#download all mp4 mobile quality only
# Walk through each item in the feed 
$a.rss.channel.item | foreach{   
	$code = $_.comments.split("/") | select -last 1	   
	
	# Grab the URL for the MP4 file
	$url = New-Object System.Uri($_.enclosure.url)  
	
	# Create the local file name for the MP4 download
	$file = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
	$file = $file.substring(0, [System.Math]::Min(120, $file.Length))
	$file = $file.trim()
	$file = $file + ".mp4"  
	
	if ($code -ne "")
	{
		 $folder = $code + " - " + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "").Replace("|", "").Replace('"',"").Replace("*","")
		 $folder = $folder.substring(0, [System.Math]::Min(100, $folder.Length))
		 $folder = $folder.trim()
	}
    if ($folder.EndsWith("."))
         {
            $folder = $folder.substring(0, ($folder.Length) - 1).trim()
         }
	else
	{
		$folder = "NoCodeSessions"
	}
	
	# Make sure the MP4 file doesn't already exist

	if (!(test-path "$folder\$file"))     
	{ 	
		# Echo out the  file that's being downloaded
		$file
		$wc = (New-Object System.Net.WebClient)  

		# Download the MP4 file
		$wc.DownloadFile($url, "$downloadlocation\$file")
		mv $file $folder
	}
	
		
	}

If you want a downloaded copy of .PS1 file you can download it from here:

https://www.dropbox.com/s/whazl6x0nncr8yw/MSBuild2016VideoAndSlides.ps1?dl=0

Enjoy J.

Posted in SharePoint General | Leave a comment

The tool was unable to install application server role, web server (IIS) role error in #SharePoint 2013

When installing SharePoint 2013, if the server is online, then we regualarly use the (prerequisiteinstaller) to download and configure the prerequisites, but sometimes it will not work for you, due to many reasons, may be the Windows Server version or any other.

One of the common problems is the error of (The tool was unable to install application server role, web server (IIS) role),


After trying many solutions I have found a funny one J

When tracing the log file of the error I found the prerequisiteinstaller.exe is trying to access an exe file within C:\windows\system32, the file name was ( ServerManagerCMD.exe), while the actual name within the same folder was (ServerManager.exe), the solution is very simple, copy that file (ServerManager.exe), and paste it to desktop or wherever, then rename it to be (ServerManagerCMD.exe), yet you can copy it and paste it to the path referred in the log file (C:\windows\system32), don’t worry the old one still function, then go to your prerequisiteinstaller.exe file and you will notice it will work like magic with you :


Don’t worry if the ServerManager console open with you, you can close it and continue working no problem.

And finally:

Posted in SharePoint General | 2 Comments

#SharePoint 2013 Installation Problem, Error when installing AppFabric 1.1 on Server 2012 64bit

One of the Common errors that someone may face while installing SharePoint 2013 prerequisites of AppFabric application, is the error of:

“AppFabric installation failed because installer MSI returned with error code : 1603 ”

(Step 1)

This error may occurs due to many reasons, one of them is PSModulePath corruption, you may try to check the ” EnvironmentVariables“, and check the value of PSModulePath; find it here:

System Properties -> Environment Variables -> System Variables.

And check its value to be exactly like that: ( %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\) without braces, if it was written correctly if not, just correct it, and then try your setup gain, if it not working for you, then you should do the following:

(Step 2)

Open you Server Manager and from Tools menu open Computer Management:

 

Or just type in Run command: Compmgmt.msc , and it will open Computer Management for you.

Then check groups and find if these two groups are existed : AS_Administrators and AS_Observers Security Groups , if so,  just delete them, as it was added by AppFabric setup program and recheck your installation again, it should now work for you:

And the result after doing the above steps should be like that:

Posted in SharePoint General | Leave a comment

Adding World Clock, and Exchange Rates Web Parts to #SharePoint

One of the most required accessories web parts to SharePoint portals is “World Clock web part” and ” Exchange Rates web part”, today I’m going to show you how to implement both with your SharePoint environment.

  • Adding World Clock:

First, you should know that there are dozens of free or purchased versions of this web part, but why to purchase when you can make one J

SharePoint Object Model provide us with a class library for Regional Settings which include local and global time zones, you can find it within ” Microsoft.SharePoint.dll under the class property  ” SPRegionalSettings.GlobalTimeZones “:

  • Create a new Visual Web part
  • Add a Grid View control to the web part, and name it: grdWorldClock
  • In the .CS file for the visual web part add the “Microsoft.SharePoint” name space
  • In the page load section add the following code:

    protected
    void Page_Load(object sender, EventArgs e)

    {

    SPTimeZoneCollection timeZoneColl = SPRegionalSettings.GlobalTimeZones;

    // Creating table 

    DataTable dt = new
    DataTable();

    // Adding Columns

    dt.Columns.Add(“Description”);

    dt.Columns.Add(“Time Zone”);

    foreach (SPTimeZone tz in timeZoneColl)

    {

    DateTime currentLocalDateTime = DateTime.Now;

    DateTime currentDestDateTime = tz.UTCToLocalTime(currentLocalDateTime.ToUniversalTime());

    // Adding Rows

    DataRow dr;

    dr = dt.NewRow();

    dr[“Description”] = tz.Description.ToString();

    dr[“Time Zone”] = currentDestDateTime.ToString();

    dt.Rows.Add(dr);

    }

    // Connecting Data Source to our GridView

    grdWorldClock.DataSource = dt;

    grdWorldClock.DataBind();

    dt.Dispose();

    }

  • Just deploy your solution to your farm and you will see the results like below:

With some UI tweaks you can enhance the interface and make it better view, also you can make it as a dropdown list and the results changes upon click.

Also there is a fast solution using a ready made code from the well know site “Clock Link”, and here you are the link to code:

http://www.clocklink.com/gallery/view/world001

You can add it within your Embedded Code area:

Then insert the following code:

Then the result will be like that:

Enjoy J.

 

  • Now how to add an Exchange Rates web part.

It’s very simple, just go to The Money Converter web site http://themoneyconverter.com and from the upper side select Exchange Rates, then from the table there select your currency preference, I have picked up SAR, http://themoneyconverter.com/SAR/Exchange_Rates_For_Saudi_Riyal.aspx

Then from the left side select RSS feeds which is automatically generated for SAR, http://themoneyconverter.com/rss-feed/SAR/rss.xml.

Now add an RSS Viewer web part to your desired page:

Then in the property menu add the RSS link like below:

Then after adding it the web part will load the exchange rate data for your selected currency like below:

 

You can also enhance the preview by tweaking UI.

Posted in SharePoint General | Leave a comment

Reporting with Visual Studio and Crystal Reports

Well, today I have a good chance for review a book of a friend of mine Engineer: Mahmoud ElKoush, the book about Reporting with Visual Studio and Crystal Reports, really the book is very useful though it’s simple but it’s powerful, I totally recommend this book for whom have no time for reading and needs a quick reference for reporting, as today projects’ full of BI and Reporting Services, which is very important for decision making, and data representing.

As a Sr. SharePoint Developer I found my needs on this, and I’m sure you will too.

You can find this book here:

http://bit.ly/1hWaKer

Enjoy J

 

Posted in SharePoint General | Leave a comment