question

ExcAd-3564 avatar image
0 Votes"
ExcAd-3564 asked ExcAd-3564 edited

Vbs script works for Edge Chromium but not for the older Microsoft Edge

Hello.
I am using a vb script to get my application to prompt me for the smart card upon its removal instead of keeping me signed in.
The authentication to this app is managed by adfs as my idp (Saml 2.0) certificate based authentication only.
The idea was to set the vbs in a schedules task that- when detects smart card is removed- does particular actions:
Delete cookies on the browser
Delete my certificate from the personal store, so that adfs prompts me for my identity again.


On computers with edge chromium, it works perfectly:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "msedge.exe https://myRP/logoutpage"
Wscript.Sleep 900
WshShell.SendKeys "^+{DELETE}"
Wscript.Sleep 900
WshShell.SendKeys "{TAB 10}"
Wscript.Sleep 300
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 300
WshShell.SendKeys "^w"

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe -windowstyle hidden -command Get-ChildItem -recurse cert:\currentuser\My | ? subject -match 'my_username' | remove-item")

But on computers with the older microsft edge, same script doesnt work, as in it keeps my identity somewhere other than in the cookies and cert store.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd.exe /C start microsoft-edge:http://myapp/logout"
Wscript.Sleep 900
<<Correspondant Key Strokes to delete Cookies>>

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe -windowstyle hidden -command Get-ChildItem -recurse cert:\currentuser\My | ? subject -match 'my_username' | remove-item")

My question is: how to get the microsoft edge script to behave like the edge chromium one?

I am missing a command to completely delete my identity from the legacy browser.

Ps: my Rp does not supprort SLO, so i cant go
with that solution
Edited

ms-edge
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ExcAd-3564

Which version of OS and Edge Legacy are you using?
Is there any error when you run the code in machine with Edge Legacy? If there is, the error occurs on which line of code?
Do you want to clear browsing data for Internet Explorer mode from Edge Legacy?
Besides, I think the command to open Edge Legacy should be like this: WshShell.Run "cmd.exe /C start microsoft-edge:http://www.microsoft.com". I'll test later when I was available with a machine with Edge Legacy.

1 Vote 1 ·

Hello, yes you are correct, but in the meanwhile I was reproducing the actions of the VBs manually.

Now I also send Ctrl Shift Del keys , tab 10 to reach delete button. The vbscript works with no error but it does not have the same result as edge chromium.

I have been struggling to find the right way to present my issue (i ve had to ask the question 4 different ways so far)

The main problem is : a missing command in the edge legacy script that will delete any information on my identity (beside cookies and cert store) , so that no info is sent to the adfs

0 Votes 0 ·
YuZhou-MSFT avatar image
0 Votes"
YuZhou-MSFT answered ExcAd-3564 edited

Hi @ExcAd-3564

I made a test with outlook login and I think I can understand what do you mean.
I sign in with outlook account on https://outlook.live.com/owa/, then clear the browser data with Ctrl Shift Del keys. When I refresh the page after clearing, I was logged out on Edge Chromium, but I was still logged in on Edge Legacy.
I found that, on Edge Legacy, you can only delete the cookies using F12-Debugger-Cookies then you can log out totally without closing the browser. That's why the vbs script can't work with Edge Legacy.

53330-image.png

So if you want to simulate log out on Edge Legacy without closing the browser, I think you can only delete all the cookies under F12-Debugger-Cookies.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Regards,
Yu Zhou



image.png (20.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for this valuable insight.
It is weird though, that Edge Legacy would only clear cookies like that, more so that Google Chrome reproduces the behavior of whatever Windows browser is installed.

0 Votes 0 ·
Reza-Ameri avatar image
1 Vote"
Reza-Ameri answered ExcAd-3564 commented

The recommendation is to use new Microsoft Edge because it has more functionality and supports more standards.
It is recommended to ask your user to upgrade to new Microsoft Edge instead of resolve this issue in Legacy Microsoft Edge.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello. Thank you for your answer.
However we are not able to guarantee all users will abide and we have no way to verify it or make it happen (over 10000 users scattered across the globe in 200+ offices with only 70% domain manageable) and recurrent connectivity problems with the wsus.
We are trying to come up with a plan B for the remaining 30%

0 Votes 0 ·

You may implement code where you check User-Agent and if it is older version of Microsoft Edge, then show message about upgrade to newer one and redirect them to Microsoft Edge download website.
In addition Microsoft deploying Microsoft Edge through Windows Update and most user should get upgraded to the latest version of Microsoft Edge.
You may add this under FAQ section of your website.

0 Votes 0 ·

Thank you for the idea, however it is not the solution i m seeking. Especially if efge legacy is still supported.
Thank you

0 Votes 0 ·