PoshCode Archive  Artifact [6306feb0ba]

Artifact 6306feb0ba50bc9289f046eae57c7eead0b7c60cf416fd9d3a84c1d948357ff1:

  • File Lock-WorkStation.ps1 — part of check-in [cc2873abed] at 2018-06-10 14:06:40 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: 6037
# x-archived: 2016-05-17T13:40:51
# x-published: 2016-10-05T10:54: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
}