You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have come up with different approaches to identify whether a machine is provisioned via PVS, MCS or manually.
Version 1 - hacky
functionGet-ProvisioningType
{
<#.SYNOPSIS Returns the provisioning type of a system..DESCRIPTION Returns an error if no FMA service is found on the system. Otherwise returns one of the following: PVS - if PVS Device Service is found MCS - if Linked Clone disk is found Manual - fallback.EXAMPLE Get-ProvisioningType PVS.NOTES ToDo: add tags, author info#>
[OutputType([string])]
[CmdletBinding()]
param()
# Check XA/XD agent installation
[bool]$CitrixAgentInstalled=Get-Service-Name "BrokerAgent"-ErrorAction SilentlyContinue
if (-not$CitrixAgentInstalled)
{
throw"No Citrix VDA (MFA) agent found on the system!"
}
if (Get-Service-Name 'BNDevice'-ErrorAction SilentlyContinue)
{
Write-Verbose-Message ('Citrix PVS Device Service found -> PVS'| AddPrefix)
return'PVS'
}
if (Get-Partition|Where-Object AccessPaths -contains"C:\Program Files\Citrix\PvsVm\Service\PersistedData\")
{
Write-Verbose-Message ('Linked Clone Disk found -> MCS'| AddPrefix)
return'MCS'
}
Write-Verbose-Message ('PVS/MCS identification failed -> Manual'| AddPrefix)
return'Manual'
}
Version 2 - assumes there's no PVS Device service on non-PVS machines
functionGet-ProvisioningType
{
<#.SYNOPSIS Returns the provisioning type of a system..DESCRIPTION Returns an error if no FMA service is found on the system. Otherwise returns one of the following: PVS - if PVS Service and personality file contains a WriteCacheType setting MCS - if no PVS Service and personality file has a shared disk mode Manual - if no PVS Service and personality file has a private disk mode.EXAMPLE Get-ProvisioningType PVS.NOTES ToDo: add tags, author info#>
[OutputType([string])]
[CmdletBinding()]
param()
# Check XA/XD agent installation
[bool]$CitrixAgentInstalled=Get-Service-Name "BrokerAgent"-ErrorAction SilentlyContinue
if (-not$CitrixAgentInstalled)
{
throw"No Citrix VDA (MFA) agent found on the system!"
}
$Personality=Import-IniFile-FilePath "$env:systemdrive\personality.ini"$PvsServiceFound= [bool](Get-Service-Name 'BNDevice'-ErrorAction SilentlyContinue)
if ($PvsServiceFound-and$Personality.StringData.ContainsKey('$WriteCacheType'))
{
Write-Verbose-Message ('PVS Service and WriteCache setting found -> PVS'| AddPrefix)
return'PVS'
}
elseif (-not$PvsServiceFound-and$Personality.StringData.'$DiskMode'-eq'Shared')
{
Write-Verbose-Message ('No PVS Service but Shared disk mode found -> MCS'| AddPrefix)
return'MCS'
}
elseif(-not$PvsServiceFound-and$Personality.StringData.'$DiskMode'-eq'Private')
{
Write-Verbose-Message ('No PVS Service but Private disk mode found -> Manual'| AddPrefix)
return'Manual'
}
Write-Verbose-Message ('PVS/MCS identification failed. Aborting...'| AddPrefix)
throw"Could not reliably identify provisioning type"
}
@jariangibson can you verify both options in your environment? (you'll have to import the module beforehand or add the Import-IniFile and AddPrefix functions prior to running them)
The text was updated successfully, but these errors were encountered:
I have come up with different approaches to identify whether a machine is provisioned via PVS, MCS or manually.
Version 1 - hacky
Version 2 - assumes there's no PVS Device service on non-PVS machines
@jariangibson can you verify both options in your environment? (you'll have to import the module beforehand or add the Import-IniFile and AddPrefix functions prior to running them)
The text was updated successfully, but these errors were encountered: