Citrix: Difference between revisions

From Piszczynski
piszczynski>Aleks
No edit summary
piszczynski>Aleks
No edit summary
Line 95: Line 95:
save c Saves current running config to file  
save c Saves current running config to file  
</pre>
</pre>
== Duplicate entries in citrix controller ==
So I think we need to go with second method. I have gone through the SQL Monitoring Database . Below are the queries we need to run . This will not impact any user or any business impact as we will be running this queries on monitoring DB. Please let me know if you are okay to delete the stale entries from DB.
Step 1) To find the machine ID in Citrix Monitoring DB
Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA03%'
Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA06%'
Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA09%'
step 2  : To compare the Machine ID in Session Table
select * from [MonitorData].[Session] where  MachineId = '1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3'  ---  VDA03
select * from [MonitorData].[Session] where  MachineId = 'FCC1D88F-D553-4C96-AA92-5D3A7435D846'    --- VDA06
select * from [MonitorData].[Session] where  MachineId = '71889325-37B1-4929-B527-D81BA04ABC6D'    ----VDA09
Step 3 : Then replaced ID of stale Machine Id with the correct Machine Id in the Session Table
----- VDA03
UPDATE [MonitorData].[Session] SET MachineId='DB76C220-48BE-4297-95BA-D105109E735A' WHERE MachineId='1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3' 
----- VDA06
UPDATE [MonitorData].[Session] SET MachineId='1AD3F50D-97E2-4660-8656-1523AED50D83' WHERE MachineId='FCC1D88F-D553-4C96-AA92-5D3A7435D846' 
----- VDA09
UPDATE [MonitorData].[Session] SET MachineId='207FC7C2-FF72-4DEA-8F30-A5B3FD8CC410' WHERE MachineId='71889325-37B1-4929-B527-D81BA04ABC6D'
Step 4 : Removed the Old Stale Machine as per the following
DELETE FROM  [MonitorData].[Machine] WHERE ID = ‘1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3’
DELETE FROM  [MonitorData].[Machine] WHERE ID = ‘FCC1D88F-D553-4C96-AA92-5D3A7435D846'
DELETE FROM  [MonitorData].[Machine] WHERE ID = ‘71889325-37B1-4929-B527-D81BA04ABC6D'

Revision as of 16:39, 1 July 2021

Handy Citrix Tips

Stuck session - if session cannot be logged off and does not show on the server you can log off the session in powershell:

  • add-pssnapin *citrix*
  • Get-BrokerSession -username Domain\User | Set-BrokerSession -Hidden $true

Find location of the citrix database used by delivery controllers and netscaler:

  • Get-Brokerdbconnection


Remove citrix licence from account to free up for another user

On the citrix controller:

  • cd "<C:\Program Files (x86)\Citrix\Licensing\ls>"
  • Udadmin -list -times
  • udadmin -f XDT_ENT_UD -user <username@domain> -delete (example udadmin -f xdt_adv_ud -user <username@domain> -delete)

You might have to repalce the license type with

  • XDT_ADV_UD XenDesktop Advanced
  • XDT_PLT_UD Citrix Virtual Apps and Desktop Premium

Show settings for citrix motoring logging:

  • asnp Citrix.*
  • Get-MonitorConfiguration
  • Set-MonitorConfiguration -<setting name> <value>

Citrix Troubleshooting

If there are no apps available in the storefront check the citrix database for connection - look at the netscaler and see if there are any connection errors showing on console.


For errors when connecting from a new environment check that ports 8080, 1494, 80, 2598, 443 are open between client and all xenapp servers and netscaler.


Citrix RDP to VDA

To RDP to citrix VDA user needs to be admin or member of the remote desktop users group. They will also need to be a member of the Airect Access users which is determined by this registry value: HKLM\Software\Citrix\PortICA\DirectAccessUsers

This will give you an SID, use this to find the group it references in AD

$SID = "<enter SID here>" ; Get-ADObject -Filter * -Properties * | where{$_.objectSid -eq $SID}


Citrix VDA Power State Unknown

Check this article:

http://knowcitrix.com/citrix-vdi-power-state-unknown/

NetScaler

Command Description
show ns ip Shows configured Netscaler IP address (SNIP, VIP, MIP)
show version Shows the current Netscaler firmware version
show hardware Lists hardware details of appliance (including serial number)
sh license Displays licensed feature on appliance
sh running | more Shows the current running configuration (page per time)
sh ns fea Displays list of Netscaler features
en ns fea <acronym> Enables a Netscaler feature (Dependant on license)
dis ns fea <acronym> Disables Netscaler feature
sh ns mode Displays list of configured Netscaler modes
en ns mode <acronym> Enables Netscaler Mode
dis ns mode <acronym> Disables Netscaler mode
sh lb vserver | more Displays list of configured Load Balanced vServers
sh lb vserver <vserver name> Displays information relating to specified vserver
en lb vserver <vserver name> Enable LB vserver
dis lb vserver <vserver name> Disable LB vserver
sh service | more Displays list of configured Services (not service groups)
sh service <service name> Displays information relation to specified service
en service <service name> Enable Service
dis service <service name> <delay> Disable Service with a delay (in seconds)
sh servicegroup | more Displays list of configured Service Groups
sh servicegroup <servicegroup name> Displays information relating to specified servicegroup
en servicegroup <servicegroup name> Enable servicegroup
dis servicegroup <servicegroup name> –delay <#> Disables servicegroup with delay (in seconds)
sh server Displays a list of servers
en server <servername> Enables specified server
dis server <servername> <delay> Disables specified server with a delay (in seconds)
sh monitor Shows the list of configured Netscaler monitors
sh monitor <monitor name> Displays information relating to the specificed monitor
sh route Prints a list of defined routes
add route <network> <netmask> <gateway> Adds a static route on the appliance
rm route <network> <netmask> <gateway> Removes a static route on the appliance
sh int Displays information on all network interfaces
sh int <interface number> Displays information relating to specified network interface
en int <interface number> Enable Netscaler NIC
dis int <interface number> Disable Netscaler NIC
sh arp Displays information from ARP table (including iface used)
sh vlan Displays VLAN ID’s and assigned NIC’s
sh ha node Displays HA node status
force ha fail Forces HA Failover between nodes
nstrace –tcpdump enable Performs a packet capture (all NICs) with tcpdump enabled
shell Exits to shell command prompt (FreeBSD)
dmesg Displays system message log from shell (since reboot)
save c Saves current running config to file 

Duplicate entries in citrix controller

So I think we need to go with second method. I have gone through the SQL Monitoring Database . Below are the queries we need to run . This will not impact any user or any business impact as we will be running this queries on monitoring DB. Please let me know if you are okay to delete the stale entries from DB.


Step 1) To find the machine ID in Citrix Monitoring DB

Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA03%'

Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA06%'

Select ID,Name,IPAddress,HostingServerName,CurrentRegistrationState From [MonitorData].[Machine] where Name Like'%VDA09%'

step 2  : To compare the Machine ID in Session Table

select * from [MonitorData].[Session] where  MachineId = '1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3'   ---  VDA03 

select * from [MonitorData].[Session] where MachineId = 'FCC1D88F-D553-4C96-AA92-5D3A7435D846' --- VDA06

select * from [MonitorData].[Session] where MachineId = '71889325-37B1-4929-B527-D81BA04ABC6D' ----VDA09


Step 3 : Then replaced ID of stale Machine Id with the correct Machine Id in the Session Table

----- VDA03

UPDATE [MonitorData].[Session] SET MachineId='DB76C220-48BE-4297-95BA-D105109E735A' WHERE MachineId='1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3'

----- VDA06

UPDATE [MonitorData].[Session] SET MachineId='1AD3F50D-97E2-4660-8656-1523AED50D83' WHERE MachineId='FCC1D88F-D553-4C96-AA92-5D3A7435D846'

----- VDA09

UPDATE [MonitorData].[Session] SET MachineId='207FC7C2-FF72-4DEA-8F30-A5B3FD8CC410' WHERE MachineId='71889325-37B1-4929-B527-D81BA04ABC6D'


Step 4 : Removed the Old Stale Machine as per the following

DELETE FROM [MonitorData].[Machine] WHERE ID = ‘1E22A7A8-AD67-46B9-AB87-EACE0DF22AE3’

DELETE FROM [MonitorData].[Machine] WHERE ID = ‘FCC1D88F-D553-4C96-AA92-5D3A7435D846'

DELETE FROM [MonitorData].[Machine] WHERE ID = ‘71889325-37B1-4929-B527-D81BA04ABC6D'