Skip to content

Instantly share code, notes, and snippets.

@poshbrs
poshbrs / Logoff.ps1
Created July 28, 2017 08:12
Powershell - Logoff sessions - user self service
<#
Prereqs:
User logged on to domainjoined pc.
Powershell remoting enabled on controller - default on 2012 or later
Service account with permissions to lookup and end session in the Site
Script outputs a list of applications that the user had running to a CSV file on the controller - c:\temp\logoff-log.csv.
To protect the password of the serviceaccount it would be wise to wrap this into an EXE file.
Place the EXE file on the users desktop og start menu, and they can now stop their sessions.
@poshbrs
poshbrs / gist:a73b61a608d7733f4456
Created July 8, 2015 09:42
Powershell.org july puzzle submission
gwmi win32_operatingsystem|select psc*,*j*,V*,@{n='BIOSSerial';e={(gwmi win32_bios -cn $_.__SERVER).serialnumber}}