Skip to main content

Invoke-UserLogout

Description

Logs a specified user(s) out of the system.

Requirements

  • Windows OS

Usage

Uses Get-Process to check if a provided username or matching regex string is logged into the system, then logs out that user.

C:> Invoke-UserLogout.ps1 -user john.doe
C:> Invoke-UserLogout.ps1 -regex '^PROVAL\\' # Logs out members of the PROVAL domain

Parameters

ParameterAliasRequiredDefaultTypeDescription
userFalseStringSearches for an explicit username
regexFalseStringSearches (loops) for a regex match

Output

Location of output for log, result, and error files.

  • .\Invoke-UserLogout-log.txt
  • .\Invoke-UserLogout-data.txt
  • .\Invoke-UserLogout-error.txt