Edge Browser

Eric 121 Reputation points

Hello All,

I'm looking for a PowerShell script that will logout of the user profile before a computer reboot/logoff.

All your help is very appreciated

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,205 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,430 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Dillon Silzer 54,926 Reputation points

    Hi @enricom911

    I am assuming you are talking about logging them out of their Edge browser websites. You will want to delete the user's cache. Try the following script:

    Simple script to clear temp files and browser cache/history



    If this is helpful please accept answer.

  2. Dillon Silzer 54,926 Reputation points

    Hi @enricom911

    I believe that Edge ties you to the user account that is logged in (Office 365). You could try what has been suggested in https://techcommunity.microsoft.com/t5/windows-powershell/is-there-any-powershell-script-for-logging-out-office-account/m-p/2262858 (answer by Stefan_ITGuy)

    Write a PowerShell script that edits the registry:


    How to Get, Edit, Create and Delete Registry Keys with PowerShell



    If this is helpful please accept answer.

    0 comments No comments

  3. Limitless Technology 44,046 Reputation points

    Hello there,

    Based on your requirement have you tried the Kiosk Mode? Kiosk configurations are based upon either assigned access or shell launcher. There are several kiosk configuration methods that you can choose from https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/kiosk-mode/kiosk-mode

    Do you need to sign off the user profile or close the Edge browser?

    The logoff utility can log off users remotely but requires the extra step of finding a session ID.

    logoff $sessionId /server:DC


    --If the reply is helpful, please Upvote and Accept it as an answer–

  4. Yu Zhou-MSFT 12,541 Reputation points Microsoft Vendor

    Hi @enricom911

    I found that there's a group policy ForceEphemeralProfiles which can sign out Edge profile every time you close Edge. I think you can enable this policy in your organization as a workaround. Then when you reboot/logoff the computer, Edge will be closed, and it will sign out the profile. Except this, I don't find other ways to sign out Edge profile when reboot/logoff a computer.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.

    Yu Zhou

    0 comments No comments