Tuesday, November 29, 2011

How to remove XenDesktop DDC5 gracefully from the XD5 farm

In my previous blog I mention hard way to remove stale DDC from XD database.

Launch the Desktop Studio and highlight controllers as shown below. Select the controller you want to remove and choose "Remove Controller"

image

This will prompt for action to update Database . Choose "NO " here image

This will prompt for generating SQL script which needs to be run on SQL server database

image

Script looks like this . Copy this script

image

And then choose DDC database on SQL manager . Right click and select new script . Paste  it from previous step and run "Execute"

image

Once the script is ran then it will give following message

image

Once Desktop Studio is update , controller will be removed

image

Run powershell command Get-BrokerController and confirm that other controller is out completely.

image

Friday, November 18, 2011

How to remove stale DDC from XenDesktop 5 Farm

Stale DDC inside XenDesk 5 Farm may get created because of various reason and this does not get removed unless database is cleaned.

1. If you run Get-brokercontroller from PS console of Desktop Studio then you see the stale entry. Below two stale entry for SID

S-1-5-21-1757981266-413027322-725345543-64627 and  other one ending with 64712image 

2. Same thing will be shown via Desktop Studio

 image

3. Following script needs to be run in same order from desktop studio PS console with XD database name

Get-ConfigDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid > EvictDDC.sql  (Here we are creating EvictDDC.sql)
Get-AcctDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql(Here we are appending to  EvictDDC.sql)
Get-HypDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql
Get-ProvDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql
Get-PvsVmDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql
Get-BrokerDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql

4. This is how Script needs to be run in following order . First SID variable needs to be set and then rest of the commands need to be run. Here we are creating EvictDDC.sql file which is nothing but a stored procedure

image

5.  This file can be found under following

image

6. Now when we open this file with notepad  following entry can be found.

image 

7.   Open SQL server management studio and select the database and then open new script. Select the content from EvictDDC.sql  and paste as shown. Execute as shown below

image

8.   Last command Get-BrokerDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql  need to run as follows.

image

9.  Sometime Get-BrokerDBSchema -DatabaseName <XD database name> -ScriptType Evict -SID $sid >> EvictDDC.sql will fail with following message. Create new store procedure using working XD SID and then replace host name and SID with non working SID.

image

10.  Once all the above store procedure ran it will remove the stale entry from DDC

image

Even Desktop Studio will update the entry

 image

Friday, October 28, 2011

Citrix SmartAuditor Policy Console is Unable to Load Farm Configuration

We were getting below mention error while installing SmartAuditor on SQL 2008 cluster . Tried following CTX123288 but looks like some changes is required from SQL 2008 cluster prospective.

Symptoms

When opening the Citrix SmartAuditor Policy Console, the following error message appears:

“Unable to connect to the SmartAuditor Server. Ensure that the SmartAuditor Server is running.
Unable to load farm configuration.
An error occurred while accessing the SmartAuditor Database. More details about the error have been logged on the server.”

image

Citrix SmartAuditor Events like the one below appear:

Event Type: Error
Event Source: Citrix SmartAuditor Broker
Event Category: None
Event ID: 0
Date: 11/4/2009
Time: 6:52:51 PM
User: N/A
Computer: SMARTAUDITOR01
Description:
Exception caught while loading SmartAuditor Policy Console configuration file.
--- Exception Details ---
Type: System.Data.SqlClient.SqlException
Message: Cannot open database "CitrixSmartAuditor" requested by the login. The login failed.
Login failed for user ‘CITRIX\SMARTAUDITOR01$'.
Stack trace:
   at SmAudDatabaseProxy.DatabaseProxy.get_DatabaseConnection()
   at SmAudDatabaseProxy.DatabaseProxy.LoadPolicyConsoleConfigurationFile(Int16 policyType, Int64& configFileModifiedTimeUtcTicks, Int32& configFileFormatMajorVersion, Int32& configFileFormatMinorVersion, Byte[]& configFile)
   at SmAudBroker.PolicyAdministration.LoadPolicyConsoleConfigurationFile(PolicyType policyType, Int64& configFileModifiedTimeUtcTicks, Int32& configFileFormatMajorVersion, Int32& configFileFormatMinorVersion, Byte[]& configFile)

After installing Citrix SmartAuditor, the following events are seen (usually at 30-second intervals) in the Application Event Logs.:

Event Type: Warning
Event Source: Citrix SmartAuditor Storage Manager
Event Category: None
Event ID: 0
Date: 11/4/2009
Time: 6:35:32 PM
User: N/A
Computer: SMARTAUDITOR01
Description:
Exception caught while establishing database connection.
--- Exception Details ---
Type: System.Data.SqlClient.SqlException
Message: Cannot open database "CitrixSmartAuditor" requested by the login. The login failed.
Login failed for user 'CITRIX\SMARTAUDITOR01$'.
Stack trace:
   at SmAudDatabaseProxy.DatabaseProxy.get_DatabaseConnection()
   at SmAudDatabaseProxy.DatabaseProxy.CheckSupportedSchemaVersion()
   at SmAudDatabaseProxy.DatabaseProxy.TestConnection()
   at SmAudStorageManager.DataQueueConsumer.WaitConnectDatabase()

ICA sessions are not being recorded and ICL files only appear for a short time and then disappear.

Cause

Probable causes can include the following:

• The computer account for the Citrix SmartAuditor Server does not exist in the SmartAuditor Database.

• The computer account has been deleted and re-created using the same name resulting in a new Security Identifier being issued by Windows Active Directory.

Resolution

The computer account for the Citrix SmartAuditor server must be created in the Citrix SmartAuditor Database.

1. Go to the Microsoft SQL Server and launch the Microsoft SQL Server Management Studio.

2. Under Object Explorer in the console, go to Databases\CitrixSmartAuditor\Schemas right-click and select New Schema.

2. A) Under Object Explorer in the console, go to Databases\CitrixSmartAuditor\Security\Schemas right-click and select New Schema.

3. In the Schema name: field enter the computer name of the Citrix SmartAuditor Server in this format Domain\Machine-Name$. For example, if the domain is Citrix and the hostname of the Citrix SmartAuditor server is SMARTAUDITOR01, then the entry should be: CITRIX\SMARTAUDITOR01$. Note that this entry is not case-sensitive.

4. Leave the entry for Schema Owner field blank. This will be taken care of later when the user account is created. Click OK to continue.

5. Back in the SQL Server Management Studio console, under Object Explorer, go to Databases\CitrixSmartAuditor\Users right-click and select New User.

5. A) Back in the SQL Server Management Studio console, under Object Explorer, go to Security\Logins right-click and select New Login...

6. The Database User – New dialog opens. Enter the computer account name (in the same format as used to create the Schema in step 3) for the User name, for the Login name, and for the Default Schema.

6. A) The Login – New dialog opens. Enter the computer account name (in the same format as used to create the Schema in step 3) for the Login name.

7. Under Owned Schemas, click on the check-box for the schema created for this computer account.

7. A) Now go to the CitrixSmartAuditor Database and expand to go to Security –> Users and Right click on the CITRIX\SMARTAUDITOR01$ which you have created and go to Properties. Under Owned Schemas, click on the check-box for the schema created for this computer account.

8. Under Role Members, click on the db_owner role.

The picture below shows the result of steps 6 through 8.

image

9. Click OK to continue.

10. Go back to the Citrix SmartAuditor Server and restart the Citrix SmartAuditor Storage Manager Service.

11. Test by opening the Citrix SmartAuditor Policy Console and by launching ICA sessions that are known to fit the criteria set in the Citrix SmartAuditor Policy Console for a recorded session.

Thursday, October 20, 2011

How to enable DesktopViewer for Citrix Webinterface and PNA site.

Sometime desktop viewer is not available when it is launch via WebInterface . This can be made enabled via changing WebInterface.conf

image

This file will exist under each of the site which is created under IIS

image

Edit the file and remove the # and make it Off to ON

clip_image001

Wednesday, October 19, 2011

How to hide SEP (Symantec) notification for published XenApp application

When application is published from windows 2008 R2 machine having Symantec Endpoint Protection running , it shows up under connection center .

clip_image002[4]

If you have multiple application there would be many such notification under connection center . In order to suppress it , GPO can be used to populate . These value can be found under  CTX101644

clip_image002[6]

After a registry deployment these notification will be disappear .

clip_image002[8]