Saturday, September 07, 2013

Powershell Quick Tips: Get currently logged on user

PS C:\> Get-WMIObject win32_process -Filter "Name='explorer.exe'" | ForEach-Object {Write-Host $_.GetOwner().User}

Keywords:
WMI
Win32_Prococess
User

No comments:

Install Winget on Windows 2022 or Windows 10 LSTC

Install Winget on Windows 2022 or Windows 10 LTSC Install Pre-reqs Install Microsoft.UI.Xaml/2.8.6 Navigate to https://www.nuget.org/pa...