PoshCode Archive  Artifact [a87e4986c7]

Artifact a87e4986c7b4ce0c55cc7b763424c945b57c3c37d35601351210155f83c15446:

  • File Lock-WorkStation.ps1 — part of check-in [385e366766] at 2018-06-10 12:59:32 on branch trunk — Locks the workstation’s display. Locking a workstation protects it from unauthorized use. (user: Mike Pfeiffer size: 698)

# encoding: ascii
# api: powershell
# title: Lock-WorkStation
# description: Locks the workstation’s display. Locking a workstation protects it from unauthorized use.
# version: 0.1
# type: function
# author: Mike Pfeiffer
# license: CC0
# function: Lock-WorkStation
# x-poshcode-id: 1640
# x-archived: 2017-04-30T09:54:24
# x-published: 2010-02-16T07:30:00
#
#
Function Lock-WorkStation {
$signature = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern bool LockWorkStation();
"@

$LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru
$LockWorkStation::LockWorkStation() | Out-Null
}