Citrix Logon Simulator error with execute.-test.ps1

I have managed to setup both a XenApp and XenDesktop Test. Have tested them both successfully with the test ps1 script from the test machine. THe parameters are successfully passed to SCOM and I can see that it is failing.However the error is that the execute script does not run. I see the error in the event log as

execute-Test.ps1:Cannot bind argument to parameter ‘String’because it is an empty string

I am struggling to see any typo in the json file and am running out of ideas?

Update:

I managed to get this error message to disappear after recreating all files, however the execute-test.ps1 now runs and just says adding state:bad.

There is no log file created however and I cannot see any other errors to assist in diagnosing? I have tried modifying the powershell script to add the log file to a different location which works when I run everything manually. How do I know it is even running the Test-CitrixApp.ps1 ?

1 Like

(additional information supplied in this answer has been moved to the question)

It’s hard to know exactly what’s happening, but here are some thoughts:

The Execute-Test.ps1: Started event log entry indicates that the MP script is running OK. It would be useful to add some additional logging at this point so we can see the parameters (new issue added to GitHub: https://github.com/squaredup/Community.Citrix.LogonSim.MP/issues/1).

The Execute-Test.ps1: Finished with output ‘1’ event log entry indicates that the Test-CitrixApp.ps1 script is running. That error code comes from this line:

https://github.com/squaredup/Community.Citrix.LogonSim.MP/blob/master/Client%20Files/Monitoring/Citrix/Scripts/Test-CitrixApp.ps1#L435

So that’s good news.

If no log file is created then it sounds like the Test-CitrixApp.ps1 is failing to create the log. The most likely cause of this would be permissions.

Does the user account that is executing the script (the Citrix Logon Simulator User Account) have access to the configured log path (by default it’s C:\Monitoring\Citrix\Logs)?

Those permissions are not mentioned in the docs but I think they will be needed.

Hope this helps!

I’m having this exact same error (Execute-Test.ps1 bad or whatever). Did you ever get this resolved?

 

Citrix Simulated Logon Failed…

Date and Time:
2018-04-24T15:36:01.3904301-05:00

Property Name
Property Value

State
bad

hi Richard, many thanks for responding. I did think initially it was permissions so I increased them for the test user.

  1. Added user as Full Access on folder structure
  2. Gave user owner permissions to folder structure.
  3. Gave user local admin…

I can run the script manually and it successfully creates to that folder structure when I specify it. I can see in the SCOM Task that it actually tries to open to C:\monitoring\Citrix\Log\TestName\sflauncher.log

I tried logging on as the user and creating folders and files with no problems. There are no pop ups when I run the script and I can see the json values being passed into SCOM.

I have now successfully(?) recreated the issue on 1 Windows 7 Desktop and 1 Server 2012 R2. Each of these I have tried with two different apps and a desktop. I have downloaded new json config files and Test-CitrixApp.ps1 files to try and rule out anything and am now very baffled…

Success log shown below and SCOM settings

Display Name CITRIX-NZ (Citrix Xen Desktop)
Full Path Name SERVERNAME\CITRIX-NZ (Citrix Xen Desktop)
Test Name CITRIX-NZ (Citrix Xen Desktop)
Configuration Path C:\MonitoringXenDesktop\Citrix
StoreFront URL https://vdi.company.co.nz/Citrix/ServerName
Resource Name SCOM Synthetic Desktop
Log File Name sflauncher.log
Timeout For SF Login Page 40
Timeout For SF Resources Page 50
Timeout For Session Login 60
Timeout For Other 30
Interval 300
Sync Time 00:01

[01/11/2017 15:12:44.346]: *************** LAUNCHER SCRIPT BEGIN ***************
[01/11/2017 15:12:44.350]: SiteURL: https://vdi.company.co.nz/Citrix/ServerName
[01/11/2017 15:12:44.351]: UserName: opsmgr_citrixlogon
[01/11/2017 15:12:44.353]: Password: *****
[01/11/2017 15:12:44.355]: ResourceName: SCOM Synthetic Desktop
[01/11/2017 15:12:44.358]: Creating Internet Explorer COM object
[01/11/2017 15:12:44.531]: Setting Internet Explorer visible
[01/11/2017 15:12:44.542]: Navigating to https://vdi.company.co.nz/Citrix/ServerName[01/11/2017 15:12:44.600]: Internet Explorer: WAIT
[01/11/2017 15:12:45.624]: Internet Explorer: WAIT
[01/11/2017 15:12:46.640]: Internet Explorer: WAIT
[01/11/2017 15:12:47.658]: Internet Explorer: WAIT
[01/11/2017 15:12:48.673]: Internet Explorer: WAIT
[01/11/2017 15:12:49.690]: Internet Explorer: WAIT
[01/11/2017 15:12:50.713]: Internet Explorer: WAIT
[01/11/2017 15:12:51.730]: Internet Explorer: WAIT
[01/11/2017 15:12:52.748]: Internet Explorer: WAIT
[01/11/2017 15:12:53.763]: Internet Explorer: WAIT
[01/11/2017 15:12:54.780]: Internet Explorer: WAIT
[01/11/2017 15:12:55.795]: Internet Explorer: WAIT
[01/11/2017 15:12:56.815]: Internet Explorer: WAIT
[01/11/2017 15:12:57.831]: Internet Explorer: WAIT
[01/11/2017 15:12:58.847]: Internet Explorer: WAIT
[01/11/2017 15:12:59.863]: Internet Explorer: WAIT
[01/11/2017 15:13:00.883]: Internet Explorer: WAIT
[01/11/2017 15:13:01.899]: Internet Explorer: WAIT
[01/11/2017 15:13:02.915]: Internet Explorer: WAIT
[01/11/2017 15:13:03.931]: Internet Explorer: WAIT
[01/11/2017 15:13:04.946]: Internet Explorer: WAIT
[01/11/2017 15:13:05.962]: Internet Explorer: WAIT
[01/11/2017 15:13:06.980]: Internet Explorer: WAIT
[01/11/2017 15:13:07.997]: Internet Explorer: WAIT
[01/11/2017 15:13:09.013]: Internet Explorer: WAIT
[01/11/2017 15:13:10.044]: Internet Explorer: WAIT
[01/11/2017 15:13:11.059]: Internet Explorer: WAIT
[01/11/2017 15:13:12.076]: Internet Explorer: WAIT
[01/11/2017 15:13:13.092]: Internet Explorer: WAIT
[01/11/2017 15:13:14.110]: Internet Explorer: WAIT
[01/11/2017 15:13:15.122]: Internet Explorer: WAIT
[01/11/2017 15:13:16.136]: Internet Explorer: WAIT
[01/11/2017 15:13:17.152]: Internet Explorer: WAIT
[01/11/2017 15:13:18.167]: Internet Explorer: WAIT
[01/11/2017 15:13:19.183]: Accessing DOM
[01/11/2017 15:13:19.201]: Detecting NetScaler Gateway or StoreFront login form…
[01/11/2017 15:13:19.205]: Try #1: WAIT
[01/11/2017 15:13:20.259]: Try #2: SUCCESS
[01/11/2017 15:13:20.261]: STOREFRONT DETECTED
[01/11/2017 15:13:20.312]: Getting Login button
[01/11/2017 15:13:20.315]: Getting UserName textbox
[01/11/2017 15:13:20.318]: Getting Password textbox
[01/11/2017 15:13:20.370]: Setting UserName ‘opsmgr_citrixlogon’
[01/11/2017 15:13:20.422]: Setting Password
[01/11/2017 15:13:20.480]: Clicking login button
[01/11/2017 15:13:20.520]: Getting SF resources page…
[01/11/2017 15:13:20.525]: Try #1: WAIT
[01/11/2017 15:13:21.581]: Try #2: SUCCESS
[01/11/2017 15:13:21.632]: Getting resource ‘SCOM Synthetic Desktop’…
[01/11/2017 15:13:21.832]: Try #1: SUCCESS
[01/11/2017 15:13:21.839]: Found 0 session(s) before clicking ‘SCOM Synthetic Desktop’
[01/11/2017 15:13:21.842]: Clicking resource ‘SCOM Synthetic Desktop’
[01/11/2017 15:13:21.850]: Verifying that session launched…
[01/11/2017 15:13:21.853]: Try #1: WAIT
[01/11/2017 15:13:22.859]: Try #2: WAIT
[01/11/2017 15:13:23.863]: Try #3: SUCCESS
[01/11/2017 15:13:23.865]: Found 1 sessions after clicking ‘SCOM Synthetic Desktop’
[01/11/2017 15:13:23.867]: Found wfica32.exe with PID 3700 for session launched
[01/11/2017 15:13:23.869]: Sleeping 30 seconds before logging off…
[01/11/2017 15:13:53.875]: Logging off sessions…
[01/11/2017 15:14:20.982]: Getting log off link…
[01/11/2017 15:14:21.036]: Try #1: SUCCESS
[01/11/2017 15:14:21.091]: Clicking log off link
[01/11/2017 15:14:21.111]: Quitting Internet Explorer
[01/11/2017 15:14:21.113]: Releasing Internet Explorer COM object
[01/11/2017 15:14:21.147]: *************** LAUNCHER SCRIPT END ***************

Kind Regards

Christian

Thanks for extra info. Sounds like there could still be a problem with the directories. Can you confirm the following directories are being used?

  • JSON configuration file is located in C:\MonitoringXenDesktop\Citrix
  • The Test-CitrixApp.ps1 is located in C:\MonitoringXenDesktop\Citrix\Scripts
  • You have given the test user permissions on C:\MonitoringXenDesktop\Citrix
  • In SCOM, you have overridden the ConfigurationPath property of the discovery to C:\MonitoringXenDesktop\Citrix

Based on the above, the log file should be created at C:\MonitoringXenDesktop\Citrix\Logs\

But you mentioned:
> I can see in the SCOM Task that it actually tries to open to C:\monitoring\Citrix\Log\TestName\sflauncher.log

Where are you seeing C:\monitoring\Citrix?

You might want to try creating C:\monitoring\Citrix\ and seeing if the logs appear in there.