Category Archives: Windows Server

Using Hyper-V Manager to remotely connect to a Windows Hyper-V Server 2016

Scenario: You want to use Hyper-V Manager from a domain-joined Windows 10 Professional client computer to connect to a Windows Hyper-V Server 2016 which is a Workgroup computer (i.e. not domain-joined).

I struggled for a couple of hours with this configuration, and read plenty of googled blog posts about how to do it. I wrote this post to document, the exact steps I finally followed to get this working as simply as possible.

(This post deals strictly with Windows Hyper-V Server 2016 and Windows 10 Professional,  so do not assume these same steps work on Hyper-V Server 2012 or any prior version of Windows client OS prior to Windows 10.)

Let’s start with the Server

I’ll assume you’ve installed Hyper-V Server 2016 (the free thing from Microsoft which can host Hyper-V virtual machines. This is a non-GUI install of the Windows Hyper-V Server OS, and while you can administer it from the terminal window on the server, most people will want to manage it remotely from a client machine using Hyper-V manager GUI tool from another client machine running Windows 10 Professional or perhaps a full Windows Server 2016 machine.

After installing, I left mine as a Workgroup computer because I did not want to join it to a domain, at least not just yet.

I’ll leave the basic setup from the blue sconfig.cmd screen up to you. I’m not going to walk you through all these baby steps in this post. The bottom line is that once you’ve enabled Remote Management and Remote Destkop, you can RDP from the client machine into the server (using the server IP address until you add fqdn in the your client hosts file later).

Your server “desktop” should look like this:

 

From Powershell at Server

(https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/remotely-manage-hyper-v-hosts)

1. Enable-PSRemoting

2. Enable-WSManCredSSP -Role server

From the admin command window:

(From: https://www.ivobeerens.nl/2015/08/28/manage-hyper-v-in-a-workgroup-remotely/)

3. Set-NetFirewallRule -DisplayGroup 'Windows Management Instrumentation (WMI)' -Enabled true -PassThru

4. Set-NetFirewallRule -DisplayGroup 'Remote Event Log Management' -Enabled true -PassThru

Next 3 from the blue sconfig.cmd menu:

5. Enable remote ping from clients to server:
From sconfig.cmd menu on Hyper-V Server 2016, select:
“4) Configure Remote Management” then
“3) Configure Server Reposonse to Ping”

You should now be able to ping the server from any client machine on the next.  Go to command window on a client machine and test Ping 192.168.0.55 (or whatever IP address you assign to your server.

Now setup the Client machine

(again, this assumes a Windows 10 Professional computer, domain joined)

In my case, ServerName was “HVS1”, IP address of server was 192.168.0.55

1. Edit the “hosts” file in C:\Windows\System32\Drivers\etx\hosts, add this line at the bottom:
192.168.0.55 HVS1

The above two values represent the IP address of the server and  fqdn ServerName of your server. Modify values per your sever details.

2. Enable-PSRemoting  (From Powershell admin console)

3. Modify a Group Policy setting:

Run gpedit, then:

Computer Configuration >
Administrative Templates >
System >
Credentials Delegation >
Find:  “Allow delegating fresh credentials with NTLM-only server authentication”
Click Enable, then:
add wsman/fqdn-of-hyper-v-host. (wsman.HVS1) (Remember to type “wsman/” before computer name.)

4. Set-Item WSMan:\localhost\Client\TrustedHosts -Value "HVS1" (From Powershell admin console)

5. Enable-WSManCredSSP -Role client -DelegateComputer "HVS1" (From Powershell admin console)

Now connect to remote Hyper-V Server from you client machine using Hyper-V Manager

Open Hyper-V Manager,
In the left pane, right-click Hyper-V Manager,
Click Connect to Server.
Select “Another Computer”
Enter HVS1 (i.e. the fqdn-of-hyper-v-host)
Check “Connect as another user” checkbox.
Enter username:  HVS1\Administrator  (Remember to put “ServerName\” before the username
Enter password: (the admin password on server)

 

 

Helpful Windows Admin Tips


To launch Windows Update from the Windows Run dialog:

ms-settings:windowsupdate


Use Powershell to kill processes with a name filter:

Get-Process | Where-Object {$_.Path -like "*SOME-FILTER*"} | Stop-Process


See what time computer was booted up:

net statistics server


Restart or Shut Down a Remote Computer and Document the Reason

shutdown /i

(from https://technet.microsoft.com/en-us/library/cc770416(v=ws.11).aspx)


Using DISKPART from the command line to work on disk drives, volumes, partitions:

https://www.digitalcitizen.life/command-prompt-advanced-disk-management-commands

http://searchwindowsserver.techtarget.com/tip/Using-Diskpart-to-create-extend-or-delete-a-disk-partition


Activating Windows 10: https://www.howtogeek.com/245445/how-to-use-slmgr-to-change-remove-or-extend-your-windows-license/


Changing Windows Product Key After Install: http://tweaks.com/windows/39026/change-windows-product-key-after-install/


Windows Search error: “Search results aren’t quite ready yet, but we’re working on getting them together. Try back in a few minutes.”

https://www.weavweb.net/2016/12/19/search-results-arent-quite-ready-yet-but-were-working-on-getting-them-together-try-back-in-a-few-minutes/


Read original Windows 10 License Key using Power Shell:

Then, read Windows Key from “OA3xOriginalProductKey” property from output above.

(from https://gallery.technet.microsoft.com/scriptcenter/Get-windows-10-digital-7653fae4)

See also: https://robertsmit.wordpress.com/2017/03/19/get-windows-10-digital-license-with-powershell-winserv-osd-wds/


PowerShell: Get a list from the registry of all the software installed on your machine


PowerShell: List open files on a server/computer

Example with filename filter:

Example with domain\username filter:

 

Configure Windows Defender using PowerShell

References

I found these 2 links very helpful and informative which explain how to use PowerShell commands to observe the current setting of Windows Defender and make configuration changes such as disabling and enabling, and how to add exclusions on certain apps.

#1

http://www.thomasmaurer.ch/2016/07/how-to-disable-and-configure-windows-defender-on-windows-server-2016-using-powershell/

#2

and this one, which has a short but helpful video: http://www.netometer.com/blog/?p=1579

Add Windows Defender exclusion for iBackup exe

In my case, I wanted to add an exclusion for the iBackup exe which runs nightly to do a local disk backup to another drive on the same machine, and Windows Defender was watching every file write operation in real time, and this made the backup take a very long time. So, I added an exclusion for the iBackup processes exe using this command, and it sped up the backup tremendously: