I have recently found that the powershell scripts contained in TA-XA6x-Server are not working anymore on my Citrix servers.
The TA-XA6x-Server bundled with the Splunk apps "Template for Citrix 6.5" contains the following powershell scripts that are not working anymore on our Citrix servers:
GetXAServerSession6x.ps1
GetXAServerLoad6x.ps1
I ams suspecting that this is due to some permissions on the Windows server, but I have no clue on finding what is the issue underlying.
Please help me to do the following:
- enable the Debug on these powershell scripts
- identify the underlying problem
- fixing the permissions required for the powershell script to work.
On the citrix servers that are executing the TA-XA6x-Server, their splunkd.log file contains the below errors lines :
08-25-2016 11:51:42.814 +0800 ERROR ExecProcessor - message from "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command " &'C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServerLoad6x.ps1'" -index system_citrix_6.5_ap" Get-XAFarm :
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServerLoad6x.ps1:8 char:13
+ $FarmName = Get-XAFarm | select -ExpandProperty FarmName
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-XAFarm], FaultException
+ FullyQualifiedErrorId : System.ServiceModel.FaultException,Citrix.XenApp
.Commands.GetFarmCmdlet
Get-XAServerLoad : The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServerLoad6x.ps1:11 char:1
+ Get-XAServerLoad -ServerName $env:COMPUTERNAME| foreach-object {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-XAServerLoad], FaultException
+ FullyQualifiedErrorId : System.ServiceModel.FaultException,Citrix.XenApp .Commands.GetServerLoadCmdlet
08-25-2016 11:52:12.813 +0800 ERROR ExecProcessor - message from "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command " &'C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXASession6x.ps1'" -index system_citrix_6.5_ap" Get-XAFarm :
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXASession6x.ps1:8 char:13
+ $FarmName = Get-XAFarm | select -ExpandProperty FarmName
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-XAFarm], FaultException
+ FullyQualifiedErrorId : System.ServiceModel.FaultException,Citrix.XenApp
.Commands.GetFarmCmdlet
You need to install the Xen App SDK 6.5 on your Windows Server.
Did you upgrade to Citrix Xen7x?
My Powershells are failling too but when i tried to run the commands manually I got the following:
PS C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell> .\GetXAServer6x.ps1
Get-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'Citrix.XenApp.Commands' were found. Check the pattern and then try the
command again.
At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServer6x.ps1:5 char:4
+ Get-PSSnapin -Registered "Citrix.XenApp.Commands" | Add-PSSnapin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Citrix.XenApp.Commands:String) [Get-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand
Get-XAFarm : The term 'Get-XAFarm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServer6x.ps1:8 char:13
+ $FarmName = Get-XAFarm | select -ExpandProperty FarmName
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-XAFarm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-XAServer : The term 'Get-XAServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell\GetXAServer6x.ps1:11 char:1
+ Get-XAServer -Full -ServerName $env:COMPUTERNAME | foreach-object {
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-XAServer:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Program Files\SplunkUniversalForwarder\etc\apps\TA-XA6x-Server\bin\powershell>
not sure if these commands are still vaild in Xen7.x
Are you able to run the PowerShell scripts from the PowerShell command prompt?
Also, the user account used for the "Login as" account on the Splunk Windows Service must be at least a read-only Citrix admin.
@jconger - can confirm having the exact same issue here -
also noted that get-xaserver -full throws the error above in our environment - take out the -full and script will run, but pertinent data does not show in SPLUNK as result.
I can't tell if the cmdlet is deprecated and doesn't like some .net version (3.0 vs 4.x etc) or something along those lines.
I also have the same issue. Opened powershell as administrator and run the .ps1 script, but still hot the same error. So not likely a permission issue? Anyone find anythings?