0

I am trying to run a powershell script to upgrade enterprise software. However since if someone singed-in to the computer it is hard to find time to run this script. Therefore, I have make the script to wait until user logged-out.

I know how to find out if someone is logged into the pc. I need to know how to make powershell script wait until the user logged out.

2
  • 2
    Why not set it up as a Scheduled Task at Log Off? Commented May 10, 2021 at 18:06
  • Or use a GPO logoff script Commented May 11, 2021 at 9:44

1 Answer 1

2

You can (and should) do this using Scheduled Tasks, the event ID for logout should be 4647. Tie your script to this event and it will run when the user logs out.

https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4647

Sign up to request clarification or add additional context in comments.

1 Comment

thanks. for some reason, I can't click on up arrow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.