www_policypak_com__resources_pp-blog_windows-virtual-desktop_
www_policypak_com__resources_pp-blog_windows-virtual-desktop_
www_policypak_com__resources_pp-blog_windows-virtual-desktop_
MENU
– Executive Overview
– Windows Virtual Desktop Requirements Free
Part 2: AVD Initial Setup with Azure and Registration Modern Desktop
– Consent, and Permissions Management Tips and
– Assigning Users and Administrators Tricks
Part 3: Prepping for Your WVD Environment with PowerShell
– Finding Your Azure Subscription ID and Active Directory Tenant ID
– Configuring PowerShell and Connecting to Azure
– Setting Up Windows Virtual Desktop Tenant
Part 4: Configuring Your Domain Controller and Virtual Machines
– Adding, Creating and Configuring Virtual Machines
– Disk Configuration
– Network Configuration
Part 5: Setting up Your VPN JEREMY MOSKOWITZ
– VPN Configuration 16X Microsoft MVP
– Resources, Certificates and Other Configurations Join the more than 25,000 IT Pros
– Installing and Connecting Your VPN who benefit from Jeremy's
Part 6: Completing Your Windows Virtual Desktop Configuration Newsletter!
– Configuring and Connecting Your Domain Controller AD/ADD tips & tricks
– Syncing Azure AD
Secret GP features
– Add VMs and Deploy to Azure
– Verify VMs and Assign Users Security fundamentals
Virtualize both desktops and apps, then assign and connect users to them
Virtualize Office 365 ProPlus and deliver it to your users in an optimized
environment
Reduce your CAPEX costs by lessening the impact of hardware product life
cycles
Lower costs by pooling multi-session resources and reduce the number of
virtual machines in your environment
Bring your existing Remote Desktop Services (RDS) and Windows Server
desktops and apps to any computer with ease.
Publish as many host pools as you need to accommodate your diverse
workloads
Reduce your CAPEX costs by reducing the impact of hardware product life
cycles
Provides a unified and simplified management experience for your admins
Remember: This walkthrough is our experience, and WVD may change over
time.
That said, we hope this walkthrough helps you get going implement a proof of
concept. But, we’re not responsible if these directions don’t work, or, worse,
cause some problems in your test lab or your real environment.
Everything in guide is reasonably tested, but not guaranteed, and you should
use your brain if something doesn’t feel right to you.
There are some other guides out there that explain how to set up WVD. Again,
those guides are useful.
But this is our story, how we did it. We went through every step and fell into
each hole, so you don’t have to. We documented every step expressly so you
could get started and see what we did, and you can do it too.
Our Methodology
The primary purpose of this article series is to guide you through the process
of getting WVD up and running so you can kick the tires and see how this new
product can benefit your environment.
Let’s first say that, like many first product releases, the deployment process
isn’t as easy as it could be.
In this guide, you will have to run quite a few PowerShell cmdlets.
There are also several initial configurations you will have to complete. Let’s
quickly say that this isn’t going to be a ten-minute process. However, we have
gone through the entire process and have outlined everything you need to
know in an easy-to-follow guide.
Executive Overview
Here is a basic outline of the material covered in this guide:
1. You’re going to need to be able to fund the project. You can support the
project with enough Azure subscription credits to host the virtual machine
resources (TIP: If you don’t have access to a subscription, you can sign up for
a free account here. You will need a valid phone number and credit card as
Microsoft uses these for identity verification.
2. You will need access to your Azure Active Directory.
3. You will need access to a user account that has Global Administrator access
to Office 365, and owner role on the Azure subscription.
4. You need to download and install the Windows Virtual Desktop cmdlets for
Windows PowerShell on a Windows 10 machine. These cmdlets are what
allows you to do the “actual work” we’ll perform later.
5. Traditional Active Directory controls WVD. You can use your existing AD, or
you can make a new domain controller in Azure… as if it was sitting in your
datacenter. So you’ll need domain admin access to your on-prem AD, or, use
this guide to make your own DC in Azure.
So you may have a few things to do until the next leg of the journey. Once
you’ve completed your homework, we will roll up our sleeves and begin the
initial WVD set up by completing the early configuration steps.
Start with the “Consent Option” set to “Server App,” then fill in your “AAD
Tenant GUID or name” and hit submit. The Consent page explains what you
agree to, as is shown below.
The GUID is your Azure domain name. The tenant ID is a long alphanumeric
identifier that is nearly impossible to remember but easy to look up in your
Azure portal.
Note: You can find your “AAD Tenant GUID or name” by visiting this link:
https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Properties
If there is nothing at that link, then you don’t have an active subscription,
sign up at https://azure.microsoft.com/en-us/free/ to get a free one if
needed.
LEARN MORE
Next, we will have a few more initial steps to go through, and then we will dip
our toes in the water and initiate our first PowerShell scripts required for this
process.
You can find the Active Directory tenant ID (or Directory ID) in the Azure
Portal by selecting “Azure Active Directory,” then clicking on “Properties” or by
visiting this link while logged into your Azure Portal:
https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Properties
Copy the Active Directory tenant ID (or Directory ID), and save it somewhere
safe as you need it later.
Step 1: Find Subscription ID
To find the Subscription ID, from the same Azure Portal session either use the
“Search” option to search for “Subscriptions” or visit the following link while
logged into your Azure Portal:
https://portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade.
Configure PowerShell
Now it’s time for some PowerShell stuff (Sorry if you thought that moving to
the cloud would exempt you from PowerShell). Cloud management isn’t always
about pointing and clicking in GUI menus. Don’t let this intimidate you,
because we’re laying out the sequential steps quickly and clearly.
Notes:
You will see many packages being unzipped when initiating the Install-M
If you only wish to allow running scripts in this one PowerShell Sessio
Complete all of the remaining PowerShell steps in this lesson using the
For Example:
Note: The entire command should be on one line. You can copy and paste the
command above into NotePad and then edit accordingly.
Any time you see “CompanyWVDtenant” in a script, you need to change this
value to the correct name of your tenant. I am just using this value for this
example.
Once you issue the command, you will see something like this:
For example:
In my example, I will create two host pools. One for the “Desktop Application
Group” and a second one for the “Remote Application Group”.
To keep things simple, host pool1 will only have full desktops, and host pool2
will only have published applications. To create the host pools, run the
following cmdlets after changing “CompanyWVDtenant” to the correct tenant
name for your organization.
Once again, change “CompanyWVDtenant” to the correct tenant name for your
organization.
Note that any VMs you create will need to be domain-joined. That means you
must have an Active Directory domain controller already in place for these
VMs to join. The domain controller should also be configured with Azure AD
Connect and have at least one user account synced to Azure AD. You should
also have a Point-to-Site VPN already set up in Azure.
If you have no idea what any of that means, then… don’t panic! That’s what the
next few sections are about.
However, if you do know what this means, and you know you already have all
these prerequisites in place then, perhaps you can skip the next couple of
lessons and start creating the WVD’s themselves.
So, we’ll assume you want to create the necessary DC and put together the
other required components together in the next section.
For those who still keep their AD infrastructure on-prem, there are some great
benefits to putting a DC in the Azure cloud. By replicating AD from your on-
prem environment, you add resiliency and flexibility to your architecture. You
can choose to load balance authentication traffic or direct it all to the cloud if
your on-prem network is down.
Let’s get to the process of creating a virtual DC, one that lives in Azure.
Notes:
Note: Though VMs can live in any Azure region, their data gets stored in East
US 2 – see https://www.microsoft.com/en-us/microsoft-
365/blog/2019/03/21/windows-virtual-desktop-public-preview/ for more
info).
You don’t have to choose East US-2 as your region. The key is to select the
region that offers the fastest response time for your area. If this were for a
production environment, you would want to conduct some speed tests to the
regions to determine which one is best.
Also, note that if you are adding a DC to an existing environment, Server
2019 no longer supports the File Replication Service (FRS). This action may
require you to perform an FRS to DFS migration of your AD. You can read
more about it at https://techcommunity.microsoft.com/t5/Storage-at-
Microsoft/Streamlined-Migration-of-FRS-to-DFSR-SYSVOL/ba-p/425405=
Disk Configuration
Step 1: Disk Options
Under the Disks option, leave the “OS disk type” at “Premium SSD” and choose
“Create and attach a new disk” under the “Data disks” option.
Note: Do not forget that the pricing for your virtual machines is calculated
based on the resources that you use. When you are selecting options for
storage, processing, and networking components, be aware that the higher the
performance or capacity, the more the cost.
For this WVD demonstration, I have chosen the least expensive options.
Here is an example of the options available when selecting the disk type and
capacity, for instance.
Step 3: Host Caching
At the next screen, make sure that “HOST CACHING” is set to “None” for the
data disk.
Network Configuration
Step 1: Public IP
On the next screen, you can select all of the defaults except for “Public IP.” Set
it to “None” and then take note of the “Virtual network” and “Subnet” being
created as you will use this information again for the other VMs you create
later. There is no need for a Public IP, as we will be accessing our Azure
environment through a VPN.
Note:
Because this is a demo environment, choosing a Shutdown time helps
economize the solution because resources costs do not accumulate when the
machine is dormant.
Step 4: Go to VM
Once the deployment is successful, click on the “Go to resource” button to go
to your newly created VM.
Step 5: Networking
Now select “Networking” and click on the name of the “Network Interface.”
Step 6: IP Configurations
Then select “IP configurations” and click on the name of the “IP Configuration
shown on the right of the screen.
Note: If you cannot add the address range, try refreshing the page in the
browser then try again.
More info:
We’ll get to connecting to and manipulating the VM, which will be your DC…
after we’ve secured our connection, which is coming up.
Of course, it is not a DC yet. We have yet to install the domain server roles
and promote the server to a DC. However, all in good time.
VPN Configuration
Step 1: Point to Site VPN
First, we need to set up a Point to Site VPN connection so we can manage the
VM(s) without having to enable RDP over the public internet. To do this, first,
use the “Search” in the Azure portal to search for “virtual network gateway,”
then click on “Virtual network gateways” found in the results. Next, click on
“Add” or “Create a virtual network gateway” to continue.
Note: This deployment takes longer to complete than any of the previous
steps. Plan on at least 30 minutes for it to finish. It would be a good time now
to step away and take a break.
#Root cert:
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=P2SRootCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsag
#client cert:
New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Sig
-Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 2048 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
Notes:
Step 9: P2SRootCert
Right-click on the P2SRootCert and choose “All Tasks” > “Export…” and click
“Next” to continue. Now click “Next” again (stick with the default of not
exporting Private Key), select the “Base-64 encoded X.509 (.CER)” radio
button, and click Next once more.
Step 4: Password
At the “Security” screen, place a checkbox in the “Password” box and type in a
password to secure the private key. Change the encryption level if desired
before clicking “Next.” Take special note of this password, as you need it every
time you need to install this client certificate for a new user.
At the VPN Settings screen, again click the name of the VPN connection,
and then click “Connect.”
Now click “Connect” at the screen below, then click continue on the
message that pops up asking for permission to update your routing table.
As your final task in this exercise, click “Yes” on any UAC prompts if
presented.
You’re Now Connected to Azure!
Congratulations, you just connected to Azure via the Point-to-Site VPN. If you
are like most networking professionals, your first instinct will be to ping the
VM you created in the previous installment to test the connection. Don’t freak
out if you can’t ping it. You probably won’t be able to due to the default local
firewall settings. You will, however, be able to remote desktop to it. Launch
MSTSC from the run command on your client machine and then enter the IP
address of the VM you wish to connect to (i.e., 10.0.0.4). Then login with the
local admin credentials you assigned earlier. If you cannot remember the
password, do not panic. You can reset the password under the properties of
the Virtual Machine in the Azure portal under the “Support + Troubleshooting”
section, then the “Reset password” option.
You have now created a secure connection between you and your Azure
environment. You are now fully engaged in cloud computing, Azure style. Now
that we can access the server we created, it’s time to configure it as we need
it, which happens what we do in the next part
TIP: Azure implements write caching on the OS disk of virtual machines. This
procedure can cause issues for databases such as Active Directory, and lead to
data corruption. To avoid this, use a data disk with write caching disabled on
the VM and use this drive to store the AD DS database, Logs, and SYSVOL
folders.
Then take the time to doublecheck to make sure that the computer name is
correct and tweak any other settings you may want. Then install the “Active
Directory Domain Services role” and reboot.
More info:
Azure implements write caching on the OS disk of virtual machines. This
procedure can cause issues for databases such as Active Directory, and lead to
data corruption. To avoid this, use a data disk with write caching disabled on
the VM and use this drive to store the AD DS database, Logs, and SYSVOL
folders.
Syncing Azure AD
Step 1: Download and Sync AD Connector
Once the VM has been promoted successfully to a domain controller, it’s time
to download the AD Connector and set up synchronization from your newly
created traditional AD domain controller to Azure AD.
This operation is a little weird because you usually would use the AD
connector to sync your real-on prem AD to Azure AD. And in this case, in this
demonstration, we have a traditional DC which isn’t on-prem, it’s in Azure. So..
yeah. You’re syncing “Traditional AD to Azure AD” even though the traditional
AD is already in azure. Mindbender.
Again, if you already have an on-prem AD that you want to sync to Azure AD,
you can do it, but don’t email us if something goes wrong.
You can find the download for the AD Connector at either of the links below:
These are the accounts assigned Windows Virtual Desktop resources later. For
demonstration purposes, I have created an OU called “WVD” and a sub-OU
called “WVD Users” and added a few users under this OU.
Note: The email addresses of the users above match the UPN of my Azure AD
Domain.
At the “Uniquely identifying your users” screen, if you only have one AD
directory to be synced to Azure AD, then stick with the defaults and click
“Next,” otherwise choose the second radio button “User identities exist
across multiple directories. Match using: Mail attribute”, then click “Next.”
At the “Filter users and devices” screen, click “Next.”
At the “Optional features” screen, click “Next.”
At the “Ready to configure” screen, click “Install.”
At the “Configuration complete” screen click “Exit,” you are now done with
the AD Connector setup.
Wait a few minutes, then check in Azure AD to ensure your users synced
from the AD domain.
More info:
https://docs.microsoft.com/en-us/azure/virtual-desktop/create-host-pools-
azure-marketplace
Rdsh Name Prefix (Base name of VMs you wish to use since these VMs are to
be Windows 10 full desktops – I used “wvd-w10”)
Rdsh Number Of Instances (How many VMs you wish to have created,
-01,-02,-03 and so on will be added to the name)
Rdsh VM Size (Recommend going with something not too pricey –
Standard_DS1_v2 etc.)
Domain To Join (FQDN of the domain that VMs are to be joined to)
Existing Domain UPN (Username in the domain that can join machines to the
domain in UPN format)
Existing Domain Password (Password for the username above – should be at
least 12 characters long)
OU Path (Optional – specify the OU where you want the newly created VMs
to live)
Existing Vnet Name (The name of the virtual network you created earlier for
the VMs)
Existing Subnet Name (The name of the subnet the VMs will be placed in)
Virtual Network Resource Group Name (The name of the resource group
containing the virtual network)
Existing Tenant Name (The name you gave your WVD tenant)
Host pool name (this is host pool that you want your VMs to be assigned to
since these are full desktops, we use “WVD-Host-Pool01.”
Default Desktop Users (Any user(s) that you wish to be able to access
desktops in this host pool – UPN should match Azure domain UPN suffix)
Tenant Admin UPN or Application Id (This needs to be an account in UPN
format that has RDS Owner role assigned)
Tenant Admin Password (Password for the Tenant Admin account – should be
at least 12 characters long)
LEARN MORE
Note: Once you log in, you can run “Get-RDSTenant” to make sure you are
connected successfully and to the right tenant.
For Example:
The result for each command should look similar to below. When you see the
correct host pool name, along with “Status: Available” and “UpdateState:
Succeeded,” then you know the VM (Session Host) linked to the correct host
pool, and everything should work going forward.
If everything is correct, feel free to skip the text below and move on to the
next step.
If for some reason, a VM (Session Host) is missing entirely from any host pool,
then you can use the following process below to get the machine added to the
correct host pool. For instance, let’s say that wvd-apps-0 is missing from
WVD-Host-Pool02. In that case, we first need to create a registration token to
use for adding wvd-apps-0 to WVD-Host-Pool02. To generate the token, run
the command below in your elevated PowerShell session.
The result should look similar to below. Note: All of the text within the red box
is the token, you need to copy that text and save it somewhere safely (i.e., use
Notepad) so we can use it later to link the VM (wvd-apps-0) to WVD-Host-
Pool02. By default, the token is good for 72 hours.
N ote: All the spaces need to be removed from the token text for it to work. If
you copy the token text to Notepad and enable word wrap, you see that there
are a lot of empty spaces between the lines of text, such as is shown below.
Note that this CANNOT work.
Tip: If you turn off word CANNOT wrap all the text should be on one line with
no empty spaces and look like this below.
Now that you have your token, you should use a remote desktop to connect to
the VM (wvd-apps-0) to WVD-Host-Pool02. Once you log into the VM as an
administrator, visit the two links below. Then, download each of the files to
the VM’s desktop. You can also create a text file on the desktop if you wish to
store the registration token until you are ready to use it.
If all went well, then the result should be similar to below. The VM is now
available in the correct host pool. If needed, repeat the steps above as needed
to add any other missing VMs (session hosts) to WVD-Host-Pool02 before
moving onto the next step.
Although our account gets assigned to the “Desktop Application Group” and
“Remote Application Group,” you only see one icon labeled “Session Desktop.”
It is because we have not published any remote applications, so there is
nothing to see on the “Remote Application Group” side.
Publishing Apps
Step 1: Remote Application Group
Before we can publish any apps, we first need to see which apps are available
and common to all machines in the “Remote Application Group.” To do this, run
the following command in an elevated PowerShell (or PowerShell ISE) session.
If all goes well, then you receive a list of applications that can be published
similar to below.
Rinse and repeat for any additional applications you wish to publish using the
above as a guide.
First, you need to unpublish the application with the missing icon.
Second, you need to republish the application using custom icon settings
Note the icon on the taskbar has the remote desktop client icon letting you
know that it is a remote desktop application.
LEARN MORE
We hope you have enjoyed the journey. More importantly, we hope you have
learned something along the way. If you found this blog series to be valuable,
then we encourage you to refer others to this site. Thanks for visiting.
Final Thoughts
If you want to learn more about WVD, here are some quick wins.
Jeremy Moskowitz
Founder & CTO, Microsoft MVP in Group Policy, Enterprise Mobility, and MDM
Jeremy Moskowitz founded PolicyPak Software after working with hundreds of customers with the
same problem they couldn’t manage their applications, browsers and operating systems using the
technology they already utilized.
PRODUCTS POLICIES
PolicyPak Enterprise Least Privilege Manager
Licensing FAQs
VDI-licensing-scenarios
Contact Us