Unable to Remove XenDesktop Delivery Controllers from the XenDesktop Site

Complete the steps to remove the orphaned Delivery Controller (Controller) from a XenDesktop 7.x site:

  1. Run the Get-BrokerController command from PowerShell to get the SID of the orphaned Controller.

    User-added image

  2. Execute the following PowerShell script, replacing the XenDesktopDatabase with your XenDesktop database and the DCSID with your SID of the Controller you want to remove:

asnp Citrix*$DBName = "XenDesktopDatabase"$EvictedSID = "DCSID"## Generate Database 'Evict' Scripts for XenDesktop DataStore##Get-ConfigServiceStatusGet-LogSite Get-BrokerController -Filter {(SID -eq $EvictedSID)} -MaxRecordCount 2147483647Add-Content "$PWDevict_$sid.txt" (Get-AcctDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-HypDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-ProvDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-BrokerDBSchema -DatabaseName $DBName -ScriptType 'Evict' -SID $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-MonitorDBSchema -DatabaseName $DBName -DataStore 'Site' -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-SfDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-EnvTestDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-ConfigDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-LogDBSchema -DatabaseName $DBName -DataStore 'Site' -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-AdminDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-AnalyticsDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-AppLibDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-TrustDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)Add-Content "$PWDevict_$sid.txt" (Get-OrchDBSchema -DatabaseName $DBName -ScriptType 'Evict' -Sid $EvictedSID)# Script completed successfully# Generate Database 'Evict' Scripts for 'Logging' DataStore##Get-ConfigServiceStatus Get-LogSite Get-BrokerController -Filter {(SID -eq $EvictedSID)} -MaxRecordCount 2147483647Add-Content "$PWDevict_$sid.txt" (Get-LogDBSchema -DatabaseName $DBName -DataStore 'Logging' -ScriptType 'Evict' -Sid $EvictedSID)# Script completed successfully# Generate Database 'Evict' Scripts for 'Monitor' DataStore##Get-ConfigServiceStatus Get-LogSite Get-BrokerController -Filter {(SID -eq $EvictedSID)} -MaxRecordCount 2147483647Add-Content "$PWDevict_$sid.txt" (Get-MonitorDBSchema -DatabaseName $DBName -DataStore 'Monitor' -ScriptType 'Evict' -Sid $EvictedSID)# Script completed successfully

After running the script, the evict.txt file is created under the users profile. The file could also be generated under C:Windowssystem32, if ran in IDE PowerShell as administrator. The file contains a script required to run on the SQL server.

Related:

  • No Related Posts

Error on Studio: “A working instance for the Configuration Logging Service could not be found”

1. Restart the Citrix services with the following PowerShell commands and then close and reopen Studio:

  • Get-Service Citrix* | Stop-Service -Force
  • Get-Service Citrix* | Start-Service

Note: Studio is not going to show the same error message anymore, and it should prompt for a Mandatory upgrade again. Do not proceed with the upgrade yet, and make sure you have a good backup of the database before continuing with the following steps.

2. Re-register the Log and Monitor services connection strings with the following PowerShell commands:

Set-MonitorDBConnection -DataStore Monitor -DBConnection $nullSet-MonitorDBConnection -DBConnection $nullSet-LogDBConnection -DataStore Logging -DBConnection $nullSet-LogDBConnection -DBConnection $null
$cs="Server=$ServerName;Initial Catalog=$SiteDBName;Integrated Security=True"$csLogging= "Server=$ServerName;Initial Catalog=$LogDBName;Integrated Security=True"$csMonitoring = "Server=$ServerName;Initial Catalog=$MonitorDBName;Integrated Security=True"
Set-LogDBConnection -DBConnection $csSet-LogDBConnection -DataStore Logging -DBConnection $csLoggingSet-MonitorDBConnection -DBConnection $csSet-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitoring

3. Proceed with the Mandatory upgrade on Studio by clicking the “Start the automatic Site upgrade” button. If prompted, enter the credentials used by the controllers to connect to the database.

4. Wait for the upgrade to finish, and then Studio should start to work properly.

Related:

  • No Related Posts

CVAD-While Installing the Citrix components (Delivery Controller, Storefront,License )/, it prompts for reboot. Error “You must restart the machine before continuing ” “

– On the DDC VM, run the below steps to identify the pending reboot registry.

-1. Open an elevated PowerSell session.

2. Install-Module PendingReboot ( Internet access required on DDC machine )

3 . Set-ExecutionPolicy -ExecutionPolicy “Unrestricted”)

4. Import-Module PendingReboot

5. Test-PendingReboot -detailed

6 – Delete the registry key mentioned in the Powershell output.

7- Now the DDC, can be upgraded without restart prompt.

Related:

  • No Related Posts

Powershell Snap in giving error when Authenticating: “[New-SfClient], HttpRequestException + FullyQualifiedErrorId : System.Net.Http.HttpRequestException,ShareFile.Api.Powershell.NewSfClient”

When User tries to authenticate the Powershell snap in with the New-SfClient command.

Powershell gives the following error:

PS C:Windowssystem32> New-SfClient New-SfClient : An error occurred while sending the request. At line:1 char:1 + New-SfClient + ~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-SfClient], HttpRequestException + FullyQualifiedErrorId : System.Net.Http.HttpRequestException,ShareFile.Api.Powershell.NewSfClient

Related:

  • No Related Posts

XenApp/Xendesktop 7.X Exception “Cannot Connect To Database Server” Of Type “Citrix.Fma.Sdk.Dal.DALConnectionFailedException”. Ensure that the database is correctly configured and accessible.

  • Collect Wireshark logs from Delivery Controller and SQL server to check if the issue is due to intermittent network issues.
  • Collect PSSDIAG logs from SQL Database Server to check if there are any SQL Performance issue.
  • As a workaround you can increase the Connection Pool size of Monitor Service.

1. Take a backup of Delivery controller and the Database Server.

2. On the Delivery Controller, launch Powershell as an admin.

3. Run asnp citrix*

4. Run Get-MonitorDataStore and copy the ConnectionString value.


5. Then run the below powershell cmdlets to Nullify the Monitor DB Connection:

Set-MonitorDBConnection -DataStore Monitor -DBConnection $null

Set-MonitorDBConnection -DBConnection $null

6. Then run the below powershell cmdlets to reset the ConnectionString value with Max Pool Size parameter added and value set to 200.

Example:

Set-MonitorDBConnection -DataStore Monitor -DBConnection “Server=SQL;Initial Catalog=xxxxx;Integrated Security=True;Max Pool Size=200”

Set-MonitorDBConnection -DBConnection “Server=SQL;Initial Catalog=xxxxx;Integrated Security=True;Max Pool Size=200”

7. Modify the String value as per the ConnectionString output you get from Step No. 4 and then restart the Citrix Monitor service.

Related:

Unable to Configure Citrix App Layering ELM PVS Connector

The App Layering Agent (PVS Agent) on the PVS server is registered with the App Layering ELM virtual appliance, and the PVS Server enumerates on the App Layering PVS connector screen. However, clicking “check credentials” an error is displayed stating that the ELM cannot use the credentials on the PVS server since it does not have the rights to execute remote PowerShell commands.

You may also see “Cannot communicate with PVS on server ‘ServerName’. Please ensure that the PVS Powershell Snapin has been registered”.

Related:

  • No Related Posts

Cannot Delete the Citrix Managed Desktop with error, “An error occurred while attempting to delete the VDA instance”

1) Download and Install the Citrix Cloud Powershell SDK

Note: Do not install the Remote Powershell SDK for Citrix Cloud on the Citrix Cloud Connectors

2) Validate the status of the provisioning task with the following command:

Get-ProvTask -Active $true

Note the RemoveVirtualMachine field, and identify how long the task has been running.

3) Stop the hung task with the following command:

Get-ProvTask -active $true | Stop-ProvTask

4) Attempt deleting the machine again

Related:

How to Reset StoreFront to the Initial Factory Settings

In some situations, there is a need to reset a StoreFront installation to its initial installation state. A manual uninstall and reinstall can be performed, but this is more time consuming and can cause other unforeseen issues.

Complete the following steps to reset a previously configured StoreFront installation:

  1. Open a PowerShell command prompt as an Administrator and type asnp Citrix*

    This loads the Citrix PowerShell modules.

  2. Ensure that the StoreFront Management console is closed.

  3. From the command prompt type . “C:Program FilesCitrixReceiver StoreFrontScriptsImportModules.ps1”

    Note
    : Ensure to include the leading period in the Powershell command.

  4. After the modules are imported type Clear-DSConfiguration.

    This will reset Storefront to its factory state.

    User-added image

  5. When you have run the command and it has completed successfully, Manually clear the following services on admin cmd : (Mainly the subscription store but better to clear them all)

    sc stop CitrixConfigurationReplication

    sc delete CitrixConfigurationReplication

    sc stop CitrixCredentialWallet

    sc delete CitrixCredentialWallet

    sc stop CitrixDefaultDomainService

    sc delete CitrixDefaultDomainService

    sc stop CitrixSubscriptionsStore

    sc delete CitrixSubscriptionsStore

    sc stop “Citrix Peer Resolution Service”

    sc delete “Citrix Peer Resolution Service”

    sc stop CitrixServiceMonitor

    sc delete CitrixServiceMonitor

    6. Once finished, open the StoreFront Management console and confirm that all settings are reset. The option to Create a new deployment or Join existing server group will now be available.

    User-added image

Related:

How to find the timezone on a Delivery Group in Citrix Cloud Virtual Apps and Desktop service

Download, remote powershel sdk

https://download.apps.cloud.com/CitrixPoshSdk.exe

once downloaded on one of domain joined machine, install it.

Open Powershell , run as administrator.

type

run below commands one by one,

asnp citrix*

Get-xdauthentication

Enter user name and password,

Get-BrokerDesktopGroup

Now check time zone mentioned in each DG which confirms timezone defined on cloud hosted Controller

Related:

How to find the timezone on a Delivery Group in Citrix Cloud Virtual and desktop service

Download, remote powershel sdk

https://download.apps.cloud.com/CitrixPoshSdk.exe

once downloaded on one of domain joined machine, install it.

Open Powershell , run as administrator.

type

run below commands one by one,

asnp citrix*

Get-xdauthentication

Enter user name and password,

Get-BrokerDesktopGroup

Now check time zone mentioned in each DG which confirms timezone defined on cloud hosted Controller

Related: