Configuring IIS Prerequisites for the App-V 5 Server with PowerShell

App-V Server 5.0 Setup with missing prerequisites

App-V Server 5.0 Setup with missing prerequisites

While I’d much rather recommend that you configure a Windows Server that will host the App-V 5.0 server components via a solution such as MDT with the required IIS components enabled in an automated build, here’s how to add the components with PowerShell.

The following code uses the Add-WindowsFeature to add the IIS components that are required to support the App-V 5.0 Management and Publishing Servers. These are the minimum required components as requested by the setup application.

To keep an App-V 5.0 environment as simple as possible, you should be use port 80 for the Publishing Server. This ensures that the standard HTTP port is used for publishing and no-one has to remember or configure an obscure port on the App-V client.

As an added bonus, I’ve created some PowerShell code to change the IIS configuration to move an existing web site off port 80 to another port. In most cases that will be the Default Web Site.

The following code will find any web site currently bound to port 80, calculate the next available port by adding 1 to the highest port in use and then set the site to use that port.

Once you’ve run the code, you can then install the App-V 5.0 server components and use port 80 for the Publishing Server.

View Memory Stats on a Hyper-V Server

I’ve got a very simple setup in my home lab with a couple of machine running either Hyper-V or ESXi. I typically don’t have monitoring solutions running and manage each host directly, rather than part of a cluster or with SCVMM or vCenter. For Hyper-V, I try to manage it remotely via PowerShell as much as I can and so it’s handy to be able to see memory utilisation on the remote host to understand how much capacity I’ve got before powering on a VM. I’ve written a PowerShell function to return various memory stats:

  • Total RAM available in the host – using Get-VMHost.
  • Total memory in use by running VMs – by returning the running VMs and finding the current amount of RAM assigned to each VM with Get-VM. This works with dynamic memory.
  • Available memory to run additional VMs – using Get-Counter to gather the ‘\Memory\Available Bytes’ performance counter
  • How much memory is used by the system – this is calculated by adding what’s in use by VMs, to the available memory and subtracting the results from the physical RAM in the host. This is a rough calculation, but an interesting metric to view.

The function returns an array that includes each stat. Here’s an example of what the function returns. All values are in gigabytes and multiple hosts can be specified to gather details from.

Here’s the code listing for the Get-HvMem function:

Comments or feedback on bugs, better ways to do things or additional steps is welcome.