header image

Archive for June, 2017

Deal of the Day – 15 June 2017

Posted by: | June 14, 2017 Comments Off on Deal of the Day – 15 June 2017 |

My book is Manning’s Deal of the Day  – 15 June 2017: Half off Learn Hyper-V in a Month of Lunches. Use code dotd061517au at http://bit.ly/2rZXI9x Sign up for DoD notifications at https://www.manning.com/dotd

under: Books, Hyper-V, PowerShell

Find the logged on user

Posted by: | June 12, 2017 Comments Off on Find the logged on user |

One method of finding the logged on users is to use CIM $ComputerName = $env:COMPUTERNAME Get-CimInstance -ClassName Win32_Process -ComputerName $ComputerName -Filter “Name = ‘explorer.exe'” | foreach { $lguser = Invoke-CimMethod -InputObject $psitem -MethodName GetOwner $Properties = @{ ComputerName = $ComputerName User = $lguser.User Domain = $lguser.Domain Time = $User.CreationDate } New-Object -TypeName PSObject -Property $Properties […]

under: PowerShell and CIM, PowerShell and WMI

« Newer Posts

Categories