Last updated by at .

  • Hyper-V 2016
    What's new in Hyper-V 2016
  • Microsoft Azure
    Microsoft Azure

Category: Windows Server 2008 R2

Installation Windows Server 2016 VPN

How to Install VPN on Windows Server 2016

This post shows you how you can install a VPN Server on Windows Server 2016 Step-by-Step. It shows you how you can easily setup a VPN server for a small environment or for a hosted server scenario.

This is definitely not a guide for an enterprise deployment, if you are thinking about a enterprise deployment you should definitely have a look at Direct Access.

I already did similar blog posts for Windows Server 2008 R2, Windows Server 2012 and Windows Server 2012 R2.

You can simply follow this step by step guide:

First install the “Remote Access” via Server Manager or Windows PowerShell.

Install Remote Access Role VPN

Select the “DirectAccess and VPN (RAS)” role services and click next.

DirectAccess and VPN (RAS)



diskpart-usb-drive

Create a USB Stick for Windows Server 2016 Installation

If you have download the latest version of Windows Server 2016 you can create a USB stick to install it on a physical server.

For UEFI Systems:

  • The at least a 8GB USB drive has to be formatted in FAT32
  • The USB needs to be GPT and not MBR
  • Copy all files from the ISO to the USB drive

diskpart-usb-drive

This is it, and here is how you do it:

First plugin your USB drive to your computer. The USB drive should be bigger than 6GB.

Open a CMD prompt or PowerShell using the Run as Administrator option and open diskpart. Now you can do list all this by using

Select the USB disk, in my case this was disk 1

Clean the disk. Be careful this will remove all files and partitions on the USB media.

Now convert it to GPT

Create a new primary partition. But make sure the partition is not greater than 16GB otherwise it can be formatted with FAT32.

Format the partition with FAT32

Assign a drive letter to the volume

now you can exit the diskpart and copy all files from the Windows or Windows Server to the USB drive and boot it. This works with Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2 and Windows Server 2016 or even Hyper-V Server in the same editions.

For MBR systems:

  • The at least a 8GB USB drive has to be formatted in FAT32
  • The USB needs to be MBR
  • Partition need so be set active
  • Copy all files from the ISO to the USB drive

diskpart-usb-drive-mbr

 

This is it, and here is how you do it:

First plugin your USB drive to your computer. The USB drive should be bigger than 6GB.

Open a CMD prompt or PowerShell using the Run as Administrator option and open diskpart. Now you can do list all this by using

Select the USB disk, in my case this was disk 1

Clean the disk. Be careful this will remove all files and partitions on the USB media.

Create a new primary partition. But make sure the partition is not greater than 16GB otherwise it can be formatted with FAT32.

Format the partition with FAT32

Set Active

Assign a drive letter to the volume

now you can exit the diskpart and copy all files from the Windows or Windows Server to the USB drive and boot it. This works with Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2 and Windows Server 2016 or even Hyper-V Server in the same editions.

 

Important:

If Install.wim is larger than 4GB, you cannot copy the file to the drive, because of theFAT32 based partition limitation. The solutions for this is to split the wim file into smaller files.

split wim file using dism (you may have to change the drive letters):

 



cmd clip

Pipe cmd prompt commands into the clipboard

This is a very all but very useful command if you work with the Windows Command Prompt. This allows you to output text from commands into the Windows clipboard.

Scott Hanselman from Microsoft just reminded the community about this feature, which is available in Windows since Windows Vista.

PowerShell v5 got some similar command using Set-Clipboard and Get-Clipboard.



unatted xml file for VM

Add unattend.xml to VHDX File for VM automation

If you for example don’t have System Center Virtual Machine Manager or another tool to create Virtual Machine Templates and automate the deployment, you can also do this using Sysprep, PowerShell and an unattend.xml file to automate or simplify the Virtual Machine creation process. In other blog posts I already wrote how you can sysprep Virtual Machines or how you can create Hyper-V Virtual Machines using PowerShell. In this post I will show you how you can add an unattend.xml file to your VHD or VHDX so your virtual machine gets some default settings like regional information.

Here we have a basic unattend.xml file. If you want to enhance it, or create your own, you can also use the Windows ADK.

To use this unattend.xml you first have to sysprep a virtual machine and create a sysprep VHD file. After that you can mount the VHDX file and insert the unattend.xml file to the VHD. Copy the unattend.xml file to the following location: D:\Windows\Panther (in my case the VHD was mounted as D drive).

You can mount the VHDX using the UI or PowerShell:

There are more paths as well. You can check out the Windows Setup Automation Overview on TechNet where you can see all the possible paths to place the unattend.xml file.



Veeam FastSCP for Microsoft Azure

Veeam FastSCP for Microsoft Azure

Veeam does some great products for your virtualization and datacenter environment such as their Veeam Backup & Replication suite, Veeam Endpoint Backup FREE and Management Packs for System Center Operations Manager. Now a couple of weeks ago Veeam released a cool free tool call Veeam FastSCP fro Microsoft Azure. With Veeam FastSCP (Secure Copy Protocol) for Microsoft Azure, IT Pros and Azure Developers can simply and reliably copy local files to Azure VMs, and copy files in Azure VMs to on-premises.

Veeam FastSCP for Microsoft Azure Diagram

The utility makes your life way easier when dealing with Virtual Machines running on Microsoft Azure IaaS.

  • Secure file copy with no independent encryption or VPN needed
  • Manual file copy to/from Azure VMs without the need to keep the UI open until the file copy completes
  • Automatic scheduling of file copy jobs for nightly or weekly copies to/from Azure VMs
  • A wizard-driven UI to copy files in just a few clicks – with no scripting needed

If you want to download it, check out the Veeam Website.

To set it up the tool connects to the PowerShell endpoint for your IaaS VM. Just add the Virtual Machine and you are ready to go! With that you can do some great things, like simply copy a file to an Azure IaaS VM or even doing scheduled backups of files from inside Azure VMs like Didier Van Hoye did.

 

 



Powershell

Get name of the PowerShell script file inside the script

When you create a script you sometimes want to create some output for a log file for example. In many cases it makes sense to use the script file name for the log file so you can easily see from which .ps1 the .log file was generated for example. To get the name of the PowerShell ps1. file you can use the following command:

This will return the ps1. file object. To get only the name string you could use:

To create a log file with the script file name you could use the following commands:



Powershell

Move files to folder sorted by year and month with PowerShell

I had to sort a lot of files and put them into folders for each month and year. So for example when the files was created/modified in February 2012, the file had to be moved into the folder 2012 and the subfolder 2 (for February). For this I created this quick and dirty script:

Please as always if you use a PowerShell script from the internet, test it first before you run it against your production environment.