Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Hyper-V 2016 Server - Add USB Hard Drive to Virtual Machine

I wanted to use an USB3 External Hard Drive to a Virtual Machine on my server which was running Windows Hyper-V 2016 Server.  From searching on the internet it seemed you needed to make the Hard Drive offline, however not much information on how to actually do this.  In the end this is my solution:-

Exit to Command Line from Hyper-V server [14]

Then enter disk management called diskpart [diskpart]:-

List the volumes [list volume]:-

Find the one that is the Hard Drive you wish to make offline.  In this case it is Toshiba Ext, Volume 4. 

So select the correct volume [select volume 4]:-

I like the make sure it is actually selected as I don't want to down my server.

So list the volumes again [list volume].  Notice the * next to Volume 4 indicating that it is selected:-

Make the disk offline [offline disk]:-

After this in Hyper-V manager you can now create a new Hard Drive selecting an actual Physical Hard Disk, in this case my Toshiba USB3 HD:-

Fix - Unable to install Dot Net 3.5 (.Net) on Windows Server 2012 R2

Tried to install Microsoft SQL Server 2012 on a Windows 2012 R2 and had the following error:-

The following error has occurred:

Error while enabling Windows feature : NetFx3, Error Code : -2146498298 , Please try enabling Windows feature : NetFx3 from Windows management tools and then run setup again. For more information on how to enable Windows features , see http://go.microsoft.com/fwlink/?linkid=227143

OK simple enough I thought, so I just used PowerShell and ran:-

Install-WindowsFeature –name NET-Framework-Core

but that got to about 68% and failed.  OK maybe it needed the media (DVD/ISO) of the original VM creation.  So again tried the following PowerShell:-

Install-WindowsFeature –name NET-Framework-Core –source Z:\Sources\SXS

but again got to about 68% and failed - very odd as never had issues installing .Net 3.5 before on a modern server.  Looking around the internet it seemed if you had any of the following KB's installed from the Windows update it was a good idea to remove first:-

  • KB2966826
  • KB2966827
  • KB2966828

But I didn't have these installed as a fairly new server build.

FIX:-

The fix was fairly simple.  On the Server open Group Policy and open the following:- Local Computer Policy -> Computer Configuration -> Administrative Templates -> System

Find the Setting that says:-

Specify settings for optional component installation and component repair

Click Enabled and tick the box that says:-

Download repair content and optional features directly from Windows Update instead of Windows Server Update Services (WSUS)

Click apply and OK, then back in PowerShell run:-

Install-WindowsFeature –name NET-Framework-Core

And thankfully .Net 3.5 will now be installed.

Microsoft SharePoint 2016 Prerequisites Installation on Windows Server 2012 r2

Tried to install a fresh copy of Microsoft SharePoint on Windows Server 2012 r2 and had the following prerequisite failed:-

OK so looks like we need to install a few things:-

Install Windows Identity Foundation
Open Powershell (as Administrator)
Add-WindowsFeature windows-identity-foundation

Reboot

Install the Microsoft Identity Extensions
http://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/r2/MicrosoftIdentityExtensions-64.msi

Install Microsoft Sync Framework Runtime v1.0 SP1 (x64)
http://download.microsoft.com/download/E/0/0/E0060D8F-2354-4871-9596-DC78538799CC/Synchronization.msi

Windows Server AppFabric
Download the Windows Server AppFabric exe and save it to your Server. Then run the PreRequisiteInstaller from the SharePoint 2016 ISO (CD) using the following command line (as Administrator):-
prerequisiteinstaller.exe /appFabric:[Dir where you saved the AppFabric exe]\WindowsServerAppFabricSetup_x64.exe

Note- it will do a reboot after installation.

Install Microsoft ODBC Driver 11 for SQL Server
https://download.microsoft.com/download/5/7/2/57249A3A-19D6-4901-ACCE-80924ABEB267/ENU/x64/msodbcsql.msi

Install Microsoft WCF Data Services 5.6 (rename this download to WcfDataServices56.exe)
http://download.microsoft.com/download/1/C/A/1CAA41C7-88B9-42D6-9E11-3C655656DAB1/WcfDataServices.exe

Install Microsoft Information Protection and Control Client (MSIPC)
http://download.microsoft.com/download/9/1/D/91DA8796-BE1D-46AF-8489-663AB7811517/setup_msipc_x64.msi

Install IIS 6 Management Compatibility component
Open PowerShell (as Administrator)
Add-WindowsFeature Web-WMI

Reboot

The following maybe needed, but it was not for me.
CU 1 for AppFabric 1.1 (KB2671763):
http://download.microsoft.com/download/7/B/5/7B51D8D1-20FD-4BF0-87C7-4714F5A1C313/AppFabric1.1-RTM-KB2671763-x64-ENU.exe

Then try installing SharePoint 2016 again and all should be well.

Excel Automation as a Scheduled task on Windows Server 2012 R2

Migrating some Excel Automated code using C# off an old Windows 2003 Server onto Windows Server 2012 R2 and using Scheduled Tasks to run I notice it was failing.  User linked to the Scheduled Task has correct permissions and it is being run with highest privileges.  Excel installed and I can run the code manually fine as that user.  Plenty of threads about the issue but the only thing that worked was:-

FIX

Windows 2008 +

Add 2 directories:-

%windir%\System32\config\systemprofile\Desktop

and

%windir%\sysWOW64\config\systemprofile\Desktop

Windows 2012 r2

Add 2 extra directories:-

%windir%\SysWOW64\config\systemprofile\Documents

and

%windir%\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache


SQL Server Database Backup Failure Operating system error 665

Had a SQL Server 2005 FULL Backup failure each night for the largest database (around 45GB).  Looking at the SQL Server Logs I notice the following error:-

BackupMedium::ReportIoError: write failure on backup device 'D:\BACKUP\SERVER_DATABASE_FULL_20160103_202215.bak'. Operating system error 665(error not found).

Looking at possible solutions:-
  • Backup HD drive is heavily fragmented, but as this is a SAN then that is not really possible.
  • Drive is compressed
Checking the drive and yes it was compressed so the network guys turned this off and bingo all we managed a full nightly backup.

Windows Server Essentials Connector just hanging after entering account

Following on from my post:-

Connecting Windows 10 to Windows Server 2012 R2 Essentials

I found running the Windows Server Essentials Connector Configuration Wizard was hanging after I entered the account and password details.  No error messages appeared, just stopped working.

Looking at the connector logs:-

C:\ProgamData\Microsoft\Windows Server\Logs (ProgramData is a hidden folder but it exists on Windows 10).

I opened the most recent txt file in this case it was called ClientDeploy.txt and noticed lots of errors relating to:-

DNS_ERROR_RCODE_NO_ERROR

A bit strange as the browsers work.

Fix:-

The fix was a bit simple really, the DNS setting on the Wifi was set to Automatic and pointing to the routers IP lets say 192.168.1.1 however I needed to change the DNS setting to use the IP of the server lets say 192.168.1.2.  Re-running the Essentials Connector and it went straight through.  I changed the DNS setting back to be Automatic and everything works as it should.

Installing Intel Graphics driver on Windows Server 2012 R2 Essentials

Setting up a Desktop PC as a Windows Server 2012 R2 Essentials Server and not able to install the default Graphic card driver from HP.  The setup will not work either from the Intel website, but this is an old i7 processor using the onboard Intel HD 2000 graphics processors.

Fix:-

First you need to install the Windows Server Essentials Experience

Server Manager -> Manage (Tab) -> Add Roles and Features

Click through until "Server Roles" and then tick the "Windows Server Essentials Experience" (near the bottom)


Server might need a restart

Then download the driver direct from Intel here I am using the x64 bit driver from:-

Intel HD Graphics 2000 for 2nd Generation Intel Core Processors

Just run the setup and all should install correctly.

Getting WiFi to work on Windows Server 2012 R2 Essentials

So I setting up an old Desktop PC as a Windows 2012 R2 Essentials Server.  I wanted to use WiFi to set it up as I am not near a network port, but every time I enabled the disabled WiFi adapter it kept disabling itself again.  Even using a USB WiFi card didn't work so a little poke around and it was a simple fix to get working.

Fix:-

You need to install the Wireless Lan Service in Server Features.

So Run Server Manager -> Manage (Tab) -> Add Roles and Features

Click through the wizard until you get to Features Section and tick "Wireless Lan Service" (near the botttom).


Might need a restart.

OK but wait the WiFi adapter is still disabled.  Quick check in Services:-

Server Manager -> Tools (Tab) -> Services

and I noticed the WLAN AutoConfig was not started.  Start this and bingo you can now connect using WiFi.


Connecting Windows 10 to Windows Server 2012 R2 Essentials

So setting up a new home server using latest Windows Server 2012 R2 Essentials.  Tried to connect to the domain using the Server Web Connect e.g. http://[ServerName]/Connect and I can see the webpage and download the connection exe e.g. ComputerConnect[ServerName].exe but I get the following error when running it:

Windows Server Essentials Connector Configuration Wizard

An Unexpected error has occurred. To resolve this issue, contact the person responsible for you network.

Fix:-

Seems like the Web Connect doesn't yet work for Windows 10. So you need to install the KB from Microsoft and install it on your Windows 10.

Windows Server Essentials Connector for Windows Server 2012 R2

Once installed in Windows 10 you have a new App.

Click Start, All Apps

Scroll down to "Windows Server Essentials" and run "Windows Server Essentials Connector Configuration Wizard".  Then run through the setup and all should be good.