Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Logoff a specific user Powershell Script

$
0
0

Hey team

I need to be able to log off a specified user.

I am creating an automated process using MSP N-Central, which checks the remote computer to see if a particular user is logged on, if that user is logged on i need a powershell script to log them off. Most of the time they won't be the current user as the company i work for offers remote support for businesses so the client needs to be able to continue using their computer.

In this case the account name will always be the same 

So I guess what I'm asking is how to silently log out a user who is still logged on but is not the current user, using a powershell script, WITHOUT disrupting the current user

Example: I've been working on a clients PC remotely, I forgot to log my account off before disconnecting the remote session. My client has now come along and started using the PC, I need to log off without the client knowing or being disrupted.

My automation process will determine if my user is still logged on, if its not still logged on the automation process simply closes itself. If my user is still logged on it will run a powershell script to log the user off then the automation process will close itself. 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>