Citrix Logon Simulator

yup got it… ok getting further:

 

[05/11/2018 11:11:01.954]: *************** LAUNCHER SCRIPT BEGIN *************** [05/11/2018 11:11:02.001]: SiteURL: https://storefront.domain/Citrix/domainweb [05/11/2018 11:11:02.001]: UserName: SvcLogonSim [05/11/2018 11:11:02.001]: Password: ***** [05/11/2018 11:11:02.017]: ResourceName: Notepad ImageRight [05/11/2018 11:11:02.033]: Creating Internet Explorer COM object [05/11/2018 11:11:02.626]: Setting Internet Explorer visible [05/11/2018 11:11:02.704]: Navigating to ‘https://storefront.domain.local/Citrix/domainweb’ [05/11/2018 11:11:02.767]: Internet Explorer: WAIT [05/11/2018 11:11:44.939]: Accessing DOM [05/11/2018 11:11:47.517]: Detecting NetScaler Gateway or StoreFront login form… [05/11/2018 11:11:49.595]: Try #1: SUCCESS [05/11/2018 11:11:49.595]: STOREFRONT DETECTED [05/11/2018 11:11:49.735]: Getting Login button [05/11/2018 11:11:49.751]: Getting UserName textbox [05/11/2018 11:11:49.751]: Getting Password textbox [05/11/2018 11:11:50.189]: Setting UserName ‘SvcLogonSim’ [05/11/2018 11:11:50.376]: Setting Password [05/11/2018 11:11:50.548]: Clicking login button [05/11/2018 11:11:50.610]: Getting SF resources page… [05/11/2018 11:11:50.735]: Try #1: WAIT [05/11/2018 11:11:51.735]: Try #2: WAIT [05/11/2018 11:11:52.735]: Try #3: WAIT [05/11/2018 11:11:53.735]: Try #4: WAIT [05/11/2018 11:11:54.735]: Try #5: WAIT [05/11/2018 11:11:55.751]: Try #6: WAIT [05/11/2018 11:11:56.751]: Try #7: WAIT [05/11/2018 11:11:57.751]: Try #8: WAIT [05/11/2018 11:11:58.751]: Try #9: WAIT [05/11/2018 11:11:59.767]: Try #10: WAIT [05/11/2018 11:12:00.767]: Try #11: WAIT [05/11/2018 11:12:01.767]: Try #12: WAIT [05/11/2018 11:12:02.767]: Try #13: WAIT [05/11/2018 11:12:03.767]: Try #14: WAIT [05/11/2018 11:12:04.782]: Try #15: WAIT [05/11/2018 11:12:05.782]: Try #16: WAIT [05/11/2018 11:12:06.813]: Try #17: WAIT [05/11/2018 11:12:07.813]: Try #18: WAIT [05/11/2018 11:12:08.813]: Try #19: WAIT [05/11/2018 11:12:09.829]: Try #20: WAIT [05/11/2018 11:12:10.829]: Try #21: WAIT [05/11/2018 11:12:11.829]: Try #22: WAIT [05/11/2018 11:12:12.845]: Try #23: WAIT [05/11/2018 11:12:13.860]: Try #24: WAIT [05/11/2018 11:12:14.860]: Try #25: WAIT [05/11/2018 11:12:15.860]: Try #26: WAIT [05/11/2018 11:12:16.860]: Try #27: WAIT [05/11/2018 11:12:17.876]: Try #28: WAIT [05/11/2018 11:12:18.876]: Try #29: WAIT [05/11/2018 11:12:19.876]: Try #30: WAIT [05/11/2018 11:12:21.095]: Exception caught by script [05/11/2018 11:12:21.110]: SF recources page not found [05/11/2018 11:12:21.110]: At C:\Monitoring\Citrix\Scripts\Test-CitrixApp.ps1:282 char:9 + throw “SF recources page not found” + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [05/11/2018 11:12:21.126]: Quitting Internet Explorer [05/11/2018 11:12:21.141]: Releasing Internet Explorer COM object [05/11/2018 11:12:21.173]: *************** LAUNCHER SCRIPT END ***************

whats the HTML look like now?

incorrect domain

That’s strange, do you have the account setup with the right domain in the Accounts section of SCOM? failing this you could hard code your username by adding

$username = "Domain\username"

at the beginning of the Try block

yes the account in the run as account in SCOM is as follows:

not using domain\username…

username

password

domain

Couldnt tell you why its not picking up the domain, i’d try updating the SCOM Account using Domain\username in the username box

if not added the code above should work if you dont mind it being hard coded

I’m trying the hard code…

 

try {

 

$username = “DOMAIN\svclogonsim”

Clear-Log

Clear-Environment

Write-ToSFLauncherLog “*************** LAUNCHER SCRIPT BEGIN ***************” Write-SFLauncherHeader

In your Run As Account for your sim account do you have just the username or domain\username?

ok just tried both ways: hard code and domain\svclogon sim in SCOM and still getting this:

Incorrect domain in the html and this in the log:

[05/11/2018 11:52:16.546]: Try #28: WAIT [05/11/2018 11:52:17.546]: Try #29: WAIT [05/11/2018 11:52:18.561]: Try #30: WAIT [05/11/2018 11:52:19.796]: Exception caught by script [05/11/2018 11:52:19.796]: SF recources page not found [05/11/2018 11:52:19.858]: At C:\Monitoring\Citrix\Scripts\Test-CitrixApp.ps1:282 char:9 + throw “SF recources page not found” + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [05/11/2018 11:52:19.874]: Quitting Internet Explorer [05/11/2018 11:52:19.889]: Releasing Internet Explorer COM object [05/11/2018 11:52:19.936]: *************** LAUNCHER SCRIPT END ***************

I’m currently trying to implement this and also having fun trying to get it to work. Here’s a few tips that i’ve applied thus far.

  1. You can use PSEXEC to start a command prompt session in the context of LocalSystem. This is the same context that the SCOM Agent usually runs under and it's ideal for verifying that the script works as expected.
  2. I had issues because the SSO settings we have enabled means that you don't get the User and Password boxes initially. Thanks to David Morris (above) I managed to update the .PS1 to fix this issue.
  3. I had various other issues with ICA files not downloading and executing automatically. It was a mixture of the version of Receiver that was installed and the configuration of IE. I had to add the site to the trusted sites list and set the security level for trusted sites to low; keep in mind that this has to be within the context of LocalSystem. To achieve this I used PSEXEC to get a command prompt running and then launched IE from there.
  4. I had to hack the MP a bit to figure the final issue which was really giving me a headache. It didn't look like the script was running at all because I wasn't getting any log file. It turned out that the issue was that the Resource Name parameter wasn't being enclosed in quotes propertly. So basically I needed to put single quotes around the Resource Name in the CSV and now I am at least getting a log file.
However, the bad news is that i've hit another issue relating to COM+.

I now get this error:

[05-15-2018 01:20:37.481]: Exception caught by script
[05-15-2018 01:20:37.856]: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

So, it looks like some sort of issue trying to instantiate an instance of the IE Application as a COM object.

Strangely it works fine if you run the script interactively.

If anyone has any smart ideas on how to fix this issue then i’d love to hear it. I’ve had a bit of a dig around in COM+ Configuration tonight but it’s getting late and it’s making my head spin. Back to it in the morning.

Pete

ok I’m further along after using fqdn of domain name in DOMAIN field in SCOM’s runas account. Now I’m getting errrors on the verification…

 

5/15/2018 10:01:01.448]: Internet Explorer: WAIT [05/15/2018 10:01:43.573]: Accessing DOM [05/15/2018 10:01:44.011]: Detecting NetScaler Gateway or StoreFront login form… [05/15/2018 10:01:44.370]: Try #1: SUCCESS [05/15/2018 10:01:44.370]: STOREFRONT DETECTED [05/15/2018 10:01:44.511]: Getting Login button [05/15/2018 10:01:44.511]: Getting UserName textbox [05/15/2018 10:01:44.511]: Getting Password textbox [05/15/2018 10:01:44.933]: Setting UserName ‘domain.local\svclogonsim’ [05/15/2018 10:01:45.089]: Setting Password [05/15/2018 10:01:45.214]: Clicking login button [05/15/2018 10:01:45.245]: Getting SF resources page… [05/15/2018 10:01:45.245]: Try #1: WAIT [05/15/2018 10:01:46.370]: Try #2: SUCCESS [05/15/2018 10:01:46.511]: Getting resource ‘Notepad ImageRight’… [05/15/2018 10:01:46.729]: Try #1: SUCCESS [05/15/2018 10:01:46.745]: Found 1 session(s) before clicking ‘Notepad ImageRight’ [05/15/2018 10:01:46.745]: Clicking resource ‘Notepad ImageRight’ [05/15/2018 10:01:46.792]: Verifying that session launched… [05/15/2018 10:01:46.808]: Try #1: WAIT [05/15/2018 10:01:47.808]: Try #2: WAIT [05/15/2018 10:02:28.480]: Try #3: WAIT [05/15/2018 10:02:29.495]: Try #4: WAIT [05/15/2018 10:02:30.495]: Try #5: WAIT [05/15/2018 10:02:31.495]: Try #6: WAIT [05/15/2018 10:02:32.511]: Try #7: WAIT [05/15/2018 10:02:33.542]: Try #8: WAIT [05/15/2018 10:02:34.558]: Try #9: WAIT [05/15/2018 10:02:35.573]: Try #10: WAIT [05/15/2018 10:02:36.589]: Try #11: WAIT [05/15/2018 10:02:37.589]: Try #12: WAIT [05/15/2018 10:02:38.589]: Try #13: WAIT [05/15/2018 10:02:39.589]: Try #14: WAIT [05/15/2018 10:02:40.605]: Try #15: WAIT [05/15/2018 10:02:41.605]: Try #16: WAIT [05/15/2018 10:02:42.636]: Try #17: WAIT [05/15/2018 10:02:43.652]: Try #18: WAIT [05/15/2018 10:02:44.652]: Try #19: WAIT [05/15/2018 10:02:45.667]: Try #20: WAIT [05/15/2018 10:02:46.683]: Try #21: WAIT [05/15/2018 10:02:47.699]: Try #22: WAIT [05/15/2018 10:02:48.699]: Try #23: WAIT [05/15/2018 10:02:49.699]: Try #24: WAIT [05/15/2018 10:02:50.714]: Try #25: WAIT [05/15/2018 10:02:51.730]: Try #26: WAIT [05/15/2018 10:02:52.730]: Try #27: WAIT [05/15/2018 10:02:53.746]: Try #28: WAIT [05/15/2018 10:02:54.761]: Try #29: WAIT [05/15/2018 10:02:55.777]: Try #30: WAIT [05/15/2018 10:02:56.777]: Try #31: WAIT [05/15/2018 10:02:57.777]: Try #32: WAIT [05/15/2018 10:02:58.792]: Try #33: WAIT [05/15/2018 10:02:59.824]: Try #34: WAIT [05/15/2018 10:03:00.839]: Try #35: WAIT [05/15/2018 10:03:01.839]: Try #36: WAIT [05/15/2018 10:03:02.855]: Try #37: WAIT [05/15/2018 10:03:03.855]: Try #38: WAIT [05/15/2018 10:03:04.855]: Try #39: WAIT [05/15/2018 10:03:05.855]: Try #40: WAIT [05/15/2018 10:03:06.886]: Try #41: WAIT [05/15/2018 10:03:07.886]: Try #42: WAIT [05/15/2018 10:03:08.886]: Try #43: WAIT [05/15/2018 10:03:09.902]: Try #44: WAIT [05/15/2018 10:03:10.902]: Try #45: WAIT [05/15/2018 10:03:11.918]: Try #46: WAIT [05/15/2018 10:03:12.933]: Try #47: WAIT [05/15/2018 10:03:13.949]: Try #48: WAIT [05/15/2018 10:03:14.949]: Try #49: WAIT [05/15/2018 10:03:15.949]: Try #50: WAIT [05/15/2018 10:03:16.964]: Try #51: WAIT [05/15/2018 10:03:17.980]: Try #52: WAIT [05/15/2018 10:03:18.980]: Try #53: WAIT [05/15/2018 10:03:19.980]: Try #54: WAIT [05/15/2018 10:03:20.996]: Try #55: WAIT [05/15/2018 10:03:21.996]: Try #56: WAIT [05/15/2018 10:03:23.011]: Try #57: WAIT [05/15/2018 10:03:24.027]: Try #58: WAIT [05/15/2018 10:03:25.074]: Try #59: WAIT [05/15/2018 10:03:26.090]: Try #60: WAIT [05/15/2018 10:03:27.340]: Exception caught by script [05/15/2018 10:03:27.340]: Unable to confirm that session launched [05/15/2018 10:03:27.355]: At C:\Monitoring\Citrix\Scripts\Test-CitrixApp.ps1:338 char:9 + throw “Unable to confirm that session launched” + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [05/15/2018 10:03:27.355]: Quitting Internet Explorer [05/15/2018 10:03:27.371]: Releasing Internet Explorer COM object [05/15/2018 10:03:27.402]: *************** LAUNCHER SCRIPT END ***************

 

 

10:03:20.996]: Try #55: WAIT [05/15/2018 10:03:21.996]: Try #56: WAIT [05/15/2018 10:03:23.011]: Try #57: WAIT [05/15/2018 10:03:24.027]: Try #58: WAIT [05/15/2018 10:03:25.074]: Try #59: WAIT [05/15/2018 10:03:26.090]: Try #60: WAIT [05/15/2018 10:03:27.340]: Exception caught by script [05/15/2018 10:03:27.340]: Unable to confirm that session launched [05/15/2018 10:03:27.355]: At C:\Monitoring\Citrix\Scripts\Test-CitrixApp.ps1:338 char:9 + throw “Unable to confirm that session launched” + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [05/15/2018 10:03:27.355]: Quitting Internet Explorer [05/15/2018 10:03:27.371]: Releasing Internet Explorer COM object [05/15/2018 10:03:27.402]: *************** LAUNCHER SCRIPT END ***************

I presume it worked when you tested interactively?

I had a similar issue to that and in the end I had to do a number of things including:

  1. Uninstalling the version of Citrix Receiver I had an installing a slightly older version.
  2. Resetting the settings in the Connection Center back to the defaults.
  3. Making sure the Store Front URL was on the Trusted Sites list
  4. Reducing the security level for Trusted Sites to low.
Good luck with it. It\\\'d be so useful for us to have this functionality working i\\\'m going to persevere with the COM issue we currently see.

yes worked fine manually when you run the script and manually when you launch IE, login, and click an app.

David,

Any ideas on the verification issue I’m seeing now? Thanks.

Gary

For more info…this is what I see now:

 

ÿþ[05/23/2018 09:06:00.772]: *************** LAUNCHER SCRIPT BEGIN ***************

[05/23/2018 09:06:00.803]: SiteURL: https://storefront.domain.local/Citrix/companyweb

[05/23/2018 09:06:00.803]: UserName: domain\svclogonsim

[05/23/2018 09:06:00.803]: Password: *****

[05/23/2018 09:06:00.803]: ResourceName: Notepad ImageRight

[05/23/2018 09:06:00.819]: Creating Internet Explorer COM object

[05/23/2018 09:06:01.100]: Setting Internet Explorer visible

[05/23/2018 09:06:01.131]: Navigating to ‘https://storefront.domain.local/Citrix/companyweb

[05/23/2018 09:06:01.194]: Internet Explorer: WAIT

[05/23/2018 09:06:42.898]: Accessing DOM

[05/23/2018 09:06:43.242]: Detecting NetScaler Gateway or StoreFront login form…

[05/23/2018 09:06:43.523]: Try #1: SUCCESS

[05/23/2018 09:06:43.523]: STOREFRONT DETECTED

[05/23/2018 09:06:43.632]: Getting Login button

[05/23/2018 09:06:43.632]: Getting UserName textbox

[05/23/2018 09:06:43.648]: Getting Password textbox

[05/23/2018 09:06:44.023]: Setting UserName ‘domain\svclogonsim’

[05/23/2018 09:06:44.132]: Setting Password

[05/23/2018 09:06:44.226]: Clicking login button

[05/23/2018 09:06:44.257]: Getting SF resources page…

[05/23/2018 09:06:44.257]: Try #1: WAIT

[05/23/2018 09:06:45.367]: Try #2: SUCCESS

[05/23/2018 09:06:45.476]: Getting resource ‘Notepad ImageRight’…

[05/23/2018 09:06:45.632]: Try #1: SUCCESS

[05/23/2018 09:06:45.648]: Found 0 session(s) before clicking ‘Notepad ImageRight’

[05/23/2018 09:06:45.648]: Clicking resource ‘Notepad ImageRight’

[05/23/2018 09:06:45.679]: Verifying that session launched…

[05/23/2018 09:06:45.695]: Try #1: WAIT

[05/23/2018 09:06:46.705]: Try #2: WAIT

[05/23/2018 09:07:27.210]: Try #3: WAIT

[05/23/2018 09:07:28.241]: Try #4: WAIT

[05/23/2018 09:07:29.241]: Try #5: WAIT

[05/23/2018 09:07:30.241]: Try #6: WAIT

[05/23/2018 09:07:31.272]: Try #7: WAIT

[05/23/2018 09:07:32.319]: Try #8: WAIT

[05/23/2018 09:07:33.335]: Try #9: WAIT

[05/23/2018 09:07:34.351]: Try #10: WAIT

[05/23/2018 09:07:35.366]: Try #11: WAIT

[05/23/2018 09:07:36.366]: Try #12: WAIT

[05/23/2018 09:07:37.366]: Try #13: WAIT

[05/23/2018 09:07:38.366]: Try #14: WAIT

[05/23/2018 09:07:39.366]: Try #15: WAIT

[05/23/2018 09:07:40.382]: Try #16: WAIT

[05/23/2018 09:07:41.382]: Try #17: WAIT

[05/23/2018 09:07:42.398]: Try #18: WAIT

[05/23/2018 09:07:43.413]: Try #19: WAIT

[05/23/2018 09:07:44.413]: Try #20: WAIT

[05/23/2018 09:07:45.413]: Try #21: WAIT

[05/23/2018 09:07:46.413]: Try #22: WAIT

[05/23/2018 09:07:47.429]: Try #23: WAIT

[05/23/2018 09:07:48.429]: Try #24: WAIT

[05/23/2018 09:07:49.429]: Try #25: WAIT

[05/23/2018 09:07:50.429]: Try #26: WAIT

[05/23/2018 09:07:51.429]: Try #27: WAIT

[05/23/2018 09:07:52.444]: Try #28: WAIT

[05/23/2018 09:07:53.444]: Try #29: WAIT

[05/23/2018 09:07:54.444]: Try #30: WAIT

[05/23/2018 09:07:55.444]: Try #31: WAIT

[05/23/2018 09:07:56.444]: Try #32: WAIT

[05/23/2018 09:07:57.444]: Try #33: WAIT

[05/23/2018 09:07:58.444]: Try #34: WAIT

[05/23/2018 09:07:59.444]: Try #35: WAIT

[05/23/2018 09:08:00.444]: Try #36: WAIT

[05/23/2018 09:08:01.444]: Try #37: WAIT

[05/23/2018 09:08:02.460]: Try #38: WAIT

[05/23/2018 09:08:03.460]: Try #39: WAIT

[05/23/2018 09:08:04.476]: Try #40: WAIT

[05/23/2018 09:08:05.491]: Try #41: WAIT

[05/23/2018 09:08:06.491]: Try #42: WAIT

[05/23/2018 09:08:07.507]: Try #43: WAIT

[05/23/2018 09:08:08.507]: Try #44: WAIT

[05/23/2018 09:08:09.507]: Try #45: WAIT

[05/23/2018 09:08:10.523]: Try #46: WAIT

[05/23/2018 09:08:11.523]: Try #47: WAIT

[05/23/2018 09:08:12.538]: Try #48: WAIT

[05/23/2018 09:08:13.538]: Try #49: WAIT

[05/23/2018 09:08:14.554]: Try #50: WAIT

[05/23/2018 09:08:15.569]: Try #51: WAIT

[05/23/2018 09:08:16.569]: Try #52: WAIT

[05/23/2018 09:08:17.569]: Try #53: WAIT

[05/23/2018 09:08:18.569]: Try #54: WAIT

[05/23/2018 09:08:19.569]: Try #55: WAIT

[05/23/2018 09:08:20.585]: Try #56: WAIT

[05/23/2018 09:08:21.601]: Try #57: WAIT

[05/23/2018 09:08:22.616]: Try #58: WAIT

[05/23/2018 09:08:23.616]: Try #59: WAIT

[05/23/2018 09:08:24.616]: Try #60: WAIT

[05/23/2018 09:08:25.804]: Exception caught by script

[05/23/2018 09:08:25.804]: Unable to confirm that session launched

[05/23/2018 09:08:25.804]: At C:\Monitoring\Citrix\Scripts\Test-CitrixApp.ps1:338 char:9

  • throw “Unable to confirm that session launched”

  • 
    

[05/23/2018 09:08:25.819]: Quitting Internet Explorer

[05/23/2018 09:08:25.835]: Releasing Internet Explorer COM object

[05/23/2018 09:08:25.866]: *************** LAUNCHER SCRIPT END ***************

Hi sorry guys been on holiday for a couple of weeks, how are you getting on with this any progression?

David, we haven’t had any success with this. We’re still more or less stuck in the same place. The application will launch, but the script can’t verify that it launched and times out.

If you run the updated script on the server manually can you see the script opening IE, logging in, clicking the icon on the store (you’ll see the loading circle) and then opening the app?

No worries David. Thanks for your help as we greatly appreciate it. Yes it works manually. It seems to run via SCOM too but is failing on the verification. I’m just not sure why it’s failing on verification when SCOM is in control.

So when you run the script manually using the service account scom is using you can see it opening the app and closing it, on the machine that scom is running the test?