Citrix Provisioning Services automated/unattended installation guide

DIsKR6ZU2mutX0XO8fEfiavIuCxWOv f9nGPl40YaN rdLvQ7wMSfXpPSPbPrnychNPw6ws2048 1ACitrix Provisioning Services PVS automated/unattended installation guide

Jan 2017 D. Smith https://www.gourami.eu

 

Introduction

This document describes the process of automated installation of Citrix Provisioning server and its prerequisites.

This guide was made for 7.12, maybe also on newer versions, but there were not there jet on the time of writing this document.

This document is provided ‘as is’, and is made to help people to automate their PVS deployments. Usage is at own risk and the creator is in no way responsible if something goes wrong.

Before you can even start thinking about installation PVS automated, you need to check that all prerequisites are met;

  • Do you have the installation software?
  • Is there a Citrix license server?
  • Does your PVS server have an static IP address?
  • Is your PVS server domain joined?
  • Is DHCP installed?
  • Do you have the service account username and password?
  • Is the service account local admin?
  • Does the service account have enough rights on the database?
  • If you use vMware, is your NIC of the VMXNET 3 type?

To check information about network you can get adapter information like so:

(Get-WmiObject -class Win32_NetworkAdapterConfiguration | ? {$_.Description.Contains(‘thernet’) })

DHCP

Here we will explain how to install DHCP unattended;

Required variables before we begin;

  • [DHCP_ServerName]
  • [DHCP_ServerIP]
  • [DHCP_ScopeName]
  • [DHCP_ScopeRangeStart]
  • [DHCP_ScopeRangeEnd]
  • [DHCP_Subnetmask]
  • [DHCP_Scopedescription]
  • [DHCP_Servername]
  • [DHCP_InterfaceAlias]
  • [DHCP_InterfaceAliesNonDHCP]
  • [DHCP_ScopeID]
  • [DHCP_ScopeDnsServer]
  • [DHCP_ScopeRouter]

DHCP installation

Issue these powershell commands to install DHCP

  • AddWindowsFeature  IncludeManagementTools dhcp
  • netsh dhcp add securitygroups
  • Restartservice dhcpserver
  • AddDhcpServerInDC  [DHCPServerName] [DHCPServerIP]

This has to be done with a domain admin account in the highest level of the forest)


If the administrator has completed the post-install configuration using PowerShell, Server Manager may still raise a flag (alert) for its completion using the post-install configuration wizard. This alert can be suppressed by notifying the Server Manager that the post-install configuration has been completed. This can be done by the below command:
SetItemProperty Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 Name ConfigurationState Value 2

DHCP configuration

Isse this command to only bind the DHCP server to the PVS vLan;

  • SetDhcpServerv4Binding BindinStade False InterfaceAlies [DHCPInterfaceAliesNonDHCP]
  • SetDhcpServerv4Binding BindinStade True InterfaceAlies [DHCPInterfaceAlies]

To add an scope;

  • AddDhcpServerv4Scope Name [DHCPvLanName] StartRange [DHCPScopeRangeStart] EndRange [DHCPScopeRangeEnd] Subnetmask [DHCPSubnetmask] Description [DHCPScopedescription] cn [DHCP servername]

Set the scope options;

  • SetDhcpServerv4OptionValue ScopeId [DHCPScopeID] DnsServer [DHCPScopeDnsServer] Router [DHCPScopeRouter]
  • SetDhcpServerv4OptionValue ScopeId [DHCPScopeID] OptionId 66 Value [DHCPServerIP]
  • SetDhcpServerv4OptionValue ScopeId [DHCPScopeID] OptionId 67 Value ARDBP32.bin”

Powershell Script

This will result in a powershell script like:

#DHCP installation script 2017 Dennis Smith dennis@gourami.eu
#This script installs and configures DHCP on Windows 2012/2016 server,
#-must be run with elevated rights, right click, run as administrator
#-must be run with a domain administrator account with rights in the top of the forest
#-must be run locally on the server on which the DHCP role is intended, remote installation not supported
# setup the variables;
$DHCP_ServerName = $Env:COMPUTERNAME
$DHCP_ServerIP=”10.10.10.2″
$DHCP_ScopeName=”PVS Client vlan”
$DHCP_DNSDomain=”test.mydomain”
$DHCP_DNSServerIP=”10.10.10.6″
$DHCP_StartRange=”10.10.10.13″
$DHCP_EndRange=”10.10.10.120″
$DHCP_Subnet=”255.255.255.0″
$DHCP_Router=”10.10.10.1″

# these two variables are used to only activate DHCP on one nic
# you can find the nic alias with: Get-NetIPInterface/IPconfig /all

$DHCP_InterfaceAlias=”Ethernet1 2″
$DHCP_InterfaceAliasNonDHCP=”Ethernet0 2″

# _____________________________________________________________________installation

# first install the role;
Install-WindowsFeature -Name ‘DHCP’ –IncludeManagementTools
# add the DHCP local groups
cmd.exe /c “netsh dhcp add securitygroups”
# restart the DHCPserver
Restart-service dhcpserver
# register the DHCP server in the domain (has to be done with rights in the top level of the forest
Add-DhcpServerInDC -DnsName $DHCP_ServerName
# remove alert flag;
Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

# _____________________________________________________________________configuration

#set the DHCP server to be only active on the correct NIC
Set-DhcpServerv4Binding -BindingState $False -InterfaceAlias $DHCP_InterfaceAliasNonDHCP
Set-DhcpServerv4Binding -BindingState $True -InterfaceAlias $DHCP_InterfaceAlias

# set scope options
Add-DhcpServerV4Scope -Name $DHCP_ScopeName -StartRange $DHCP_StartRange -EndRange $DHCP_EndRange -SubnetMask $DHCP_Subnet
Set-DhcpServerV4OptionValue -DnsDomain $DHCP_DNSDomain -DnsServer $DHCP_DNSServerIP -Router $DHCP_Router
Set-DhcpServerv4Scope -ScopeId $DHCP_ServerIP -LeaseDuration 2.00:00:00

# and not to forget the PVS scope options;
Set-DhcpServerv4OptionValue -ScopeId $DHCP_ServerIP -OptionId 66 -Value $DHCP_ServerIP
Set-DhcpServerv4OptionValue -ScopeId $DHCP_ServerIP -OptionId 67 -Value “ARDBP32.bin”

Provisioning services

Provisioning services Installation

Copy the server and the console setup .exe files, and issue the following commands:

For 64 bit OS:

PVS_Server_x64.exe /s /v” /qn”
PVS_Console_x64.exe /s /v” /qn”

Please notice that all the subfolders from the original ISO should be present, because the installer might need to install some dependencies.

Provisioning Services Configuration

Create a configuration wizard answer file

Start a powershell with admin rights, start the configuration wizard with the ‘/s’ option;

pasted image 0 7

Configure the PVS server as you please.

Go to C:\ProgramData\Citrix\Provisioning Services, to find your answer file: ‘ConfigWizard.ans’. pasted image 0 10

The answer for a new database file looks like:

Make sure to create the folder d:\store

IPServiceType=0
PXEServiceType=0
FarmConfiguration=1
DatabaseServer=mysqlserver.mydomain
DatabaseInstance=
MultiSubnetFailover=0
DatabaseNew=ProvisioningServices
FarmNew=Farm
SiteNew=Site
CollectionNew=Collection
ADGroup=mydomain/Builtin/Administrators
Store=Store
DefaultPath=d:\store
LicenseServer=mycitrixlicserver
LicenseServerPort=27000
UserName=mydomain\sa_pvs
UserName2=myencryptedpassword
PasswordManagementInterval=7
StreamNetworkAdapterIP=10.10.10.1
ManagementNetworkAdapterIP=10.10.11.1
IpcPortBase=6890
IpcPortCount=20
SoapPort=54321
BootstrapFile=C:\ProgramData\Citrix\Provisioning Services\Tftpboot\ARDBP32.BIN
LS1=10.10.10.1,10.10.10.2,10.10.10.3,6910
AdvancedVerbose=0
AdvancedInterruptSafeMode=0
AdvancedMemorySupport=1
AdvancedRebootFromHD=0
AdvancedRecoverSeconds=50
AdvancedLoginPolling=5000
AdvancedLoginGeneral=30000
SSLPort=54323
SSLCert=MyCertId
CisUserName=
CisPassword=

You then have to edit the answer file for each server you want to add. Change the IP addresses for example. After each answer file is ready for each server you can run the configwizard silently using the /a option;

pasted image 0 13

See appendix C for details on every setting in the answer file.

Provisioning Services Additional configuration

Loading the PVS powershell module

For additional configuration we need to dive into the Powershell modules of PVS;

First, login to your PVS server, and start a Powershell command prompt with elevated rights;

pasted image 0 9

Second, we want to locate the file ‘Citrix.PVS.Snapin.dll’, so we issue an;

pasted image 0 8

Than we can register the commands in the .dll with powershell;

pasted image 0 12

With this command:

 Import-Module ‘C:\Program Files\Citrix\Provisioning Services Console\Citrix.PVS.SnapIn.dll’

Test the connection

Now can actually start to issue the PVS commands. Just to test if everything is working correctly, we issue a Get-PvsServerInfo command, we should get back some information about our PVS server;

pasted image 0 11

At the back of this article there is a complete list of all possible commands. All commands start get-pvs*, set-pvs*, import-pvs* etc.

Appendix A – Overview of possible commands

Add-PvsDeviceToDomain

Add-PvsDeviceToView

Add-PvsDiskLocatorToDevice

Add-PvsDiskToUpdateTask

Add-PvsDiskVersion

Clear-PvsConnection

Clear-PvsTask

Copy-PvsDeviceProperties

Copy-PvsDiskProperties

Copy-PvsServerProperties

Disable-PvsDeviceDiskLocator

Dismount-PvsDisk

Enable-PvsDeviceDiskLocator

Export-PvsAuditTrail

Export-PvsDisk

Export-PvsOemLicenses

Get-PvsADAccount

Get-PvsAuditActionParameter

Get-PvsAuditActionProperty

Get-PvsAuditActionSibling

Get-PvsAuditTrail

Get-PvsAuthGroup

Get-PvsAuthGroupUsage

Get-PvsCollection

Get-PvsConnection

Get-PvsCreateDiskStatus

Get-PvsDevice

Get-PvsDeviceBootstrap

Get-PvsDeviceCount

Get-PvsDeviceDiskLocatorEnabled

Get-PvsDeviceInfo

Get-PvsDevicePersonality

Get-PvsDeviceStatus

Get-PvsDirectory

Get-PvsDisk

Get-PvsDiskInfo

Get-PvsDiskInventory

Get-PvsDiskLocator

Get-PvsDiskLocatorCount

Get-PvsDiskLocatorLock

Get-PvsDiskUpdateDevice

Get-PvsDiskUpdateStatus

Get-PvsDiskVersion

Get-PvsExists

Get-PvsFarm

Get-PvsFarmView

Get-PvsGroup

Get-PvsLocalServer

Get-PvsMaintenanceVersionExists

Get-PvsMinimumLastAutoAddDeviceNumber

Get-PvsMountedDisk

Get-PvsMountedDriveLetter

Get-PvsNewDiskVersion

Get-PvsServer

Get-PvsServerBiosBootstrap

Get-PvsServerBootstrap

Get-PvsServerBootstrapName

Get-PvsServerCount

Get-PvsServerInfo

Get-PvsServerName

Get-PvsServerStatus

Get-PvsServerStore

Get-PvsServerStoreActiveDeviceCount

Get-PvsSite

Get-PvsSiteView

Get-PvsStore

Get-PvsStoreFreeSpace

Get-PvsStoreSharedOrServerPath

Get-PvsTask

Get-PvsTaskStatus

Get-PvsUndefinedDisk

Get-PvsUpdateTask

Get-PvsVersion

Get-PvsVirtualHostingPool

Get-PvsXDSite

Grant-PvsAuthGroup

Import-PvsDevices

Import-PvsDisk

Import-PvsOemLicenses

Invoke-PvsActivateDeviceMAK

Invoke-PvsMarkDown

Invoke-PvsPromoteDiskVersion

Invoke-PvsRebalanceDevices

Invoke-PvsRevertDiskVersion

Merge-PvsDisk

Mount-PvsDisk

Move-PvsDeviceToCollection

Move-PvsServerToSite

New-PvsAuthGroup

New-PvsCollection

New-PvsDevice

New-PvsDeviceWithPersonalvDisk

New-PvsDirectory

New-PvsDiskLocator

New-PvsDiskMaintenanceVersion

New-PvsDiskUpdateDevice

New-PvsFarmView

New-PvsServer

New-PvsSite

New-PvsSiteView

New-PvsStore

New-PvsUpdateTask

New-PvsVirtualHostingPool

Remove-PvsAuthGroup

Remove-PvsCollection

Remove-PvsDevice

Remove-PvsDeviceDiskCacheFile

Remove-PvsDeviceFromDomain

Remove-PvsDeviceFromView

Remove-PvsDirectory

Remove-PvsDiskFromUpdateTask

Remove-PvsDiskLocator

Remove-PvsDiskLocatorFromDevice

Remove-PvsDiskUpdateDevice

Remove-PvsDiskVersion

Remove-PvsFarmView

Remove-PvsServer

Remove-PvsServerStore

Remove-PvsSite

Remove-PvsSiteView

Remove-PvsStore

Remove-PvsUpdateTask

Remove-PvsVirtualHostingPool

Reset-PvsDatabase

Reset-PvsDeviceForDomain

Restart-PvsStreamService

Revoke-PvsAuthGroup

Set-PvsAuthGroup

Set-PvsCollection

Set-PvsConnection

Set-PvsDevice

Set-PvsDeviceBootstrap

Set-PvsDevicePersonality

Set-PvsDisk

Set-PvsDiskLocator

Set-PvsDiskUpdateDevice

Set-PvsDiskVersion

Set-PvsFarm

Set-PvsFarmView

Set-PvsOverrideVersion

Set-PvsServer

Set-PvsServerBiosBootstrap

Set-PvsServerBootstrap

Set-PvsServerStore

Set-PvsSite

Set-PvsSiteView

Set-PvsStore

Set-PvsUpdateTask

Set-PvsVirtualHostingPool

Set-PvsXDSite

Start-PvsAutoUpdate

Start-PvsCreateDisk

Start-PvsDeviceBoot

Start-PvsDeviceReboot

Start-PvsDeviceShutdown

Start-PvsDisplayMessage

Start-PvsStreamService

Start-PvsUpdateTask

Stop-PvsCreateDisk

Stop-PvsStreamService

Stop-PvsTask

Stop-PvsUpdateTask

Test-PvsDirectory

Unlock-PvsAllDisk

Unlock-PvsDisk

Update-PvsBootPartitionBDM

Update-PvsInventory

Appendix B External resources

https://docs.citrix.com/content/dam/docs/en-us/provisioning-services/7-7/downloads/PowerShellObjectProgramGuide7-7.pdf

Appendix C Details on the options in the answer file

IP Adress Service        
IPServiceType=n        If n is 0, uses Microsoft DHCP.
If n is 1, uses Provisioning Services BOOTP.
If n is 2, uses Other BOOTP or DHCP services.
PXE Service         
PXEServiceType=n        If this not found, uses another device.
If n is 0, uses Microsoft DHCP.
If n is 1, uses Provisioning Services PXE.
Farm Configuration         
FarmConfiguration=x        x is 0 for already configured, if this not found, uses another device.
1 for create farm, or
2 for join existing farm.
Database Server         
DatabaseServer=x        x is the name of the server.
DatabaseInstance=x        x is the name of the instance.
FailoverDatabaseServer=x        x is the name of the failover server.
FailoverDatabaseInstance=x        x is the name of the failover instance.

Existing Farm         
FarmExisiting=x        x is the name of the Farm.
Site         
Site=x        x is the name of the new site.
Collection=x        x is the default path of the new site.
ExistingSite=x        x is the name of the site selected.
Store         (please notice that path must exist )

Store=x        x is the name of the new store.
DefaultPath=x        x is the default path of the new store.
ExistingStore=x        x is the name of the store selected.
New Farm
DatabaseNew=x        x is the name of the new database.
FarmNew=x        x is the name of the new farm.
SiteNew=x        x is the name of the new site.
CollectionNew=x        x is the name of the new collection.
ADGroup=x        x is the Active Directory group.
Group=x        x is the Windows group.
New Store         
Store=x
x is the name of the new store.
DefaultPath=x        x is the default path of the new store.
License Server Name         
LicenseServer=x        x is the name of the server.
LicenseServerPort=x        x is the port number.
Stream Service User Account         
UserName=x        x is a user account name.
UserPass=x        x is the password (not encrypted) for the
UserName2=x        x is the password (encrypted) for the use
UserPass or UserName2 can be used for the
Network=1        Network is used for the `Network service´

PasswordManagement        
PasswordManagementInterval=x
x is the day internal between password re
Stream Service Network Cards         
StreamNetworkAdapterIP=x        x is a comma delimited between password re
Uses first card if not found.
Management Network Card         
ManagementNetworkAdapterIP=x        x is Management IP address. Use first if
Management Services First and Last Port         
ManagementFirstPort=n        n is first port number. 6905 if not found
ManagementLastPort=n        n is the last port number. 6909 if not found
TFTP and Bootstrap File         
BootstrapFile=x        x is file. TFTP and Bootstrap not use, i
Boot Servers         
LS#=ip,subnet,gateway,port        # is the number of the server, 1 is the
If not found, uses the first in the data
If none in the database, the first card f
If none in the database, the first card f
AdvancedVervorse=x        x is 1 when verbose mode is turned on.
AdvancedInterruptSafeMode=x        x is 1 when interrupt safe mode is turned on.
AdvancedMemorySupport=x        x is 1 when advanced memory support is turned on.
AdvancedRebootFromHD=x        x is 1 when reboot from hard drive on fai
AdvancedRecoverSeconds=x        x is the number of seconds to reboot to
AdvancedLoginPolling=x        x is the number of milliseconds for login
AdvancedLoginGeneral=x        x is the number of milliseconds for login
Start Services         
NoStartServices=1        Do not start services if exits.