Function Name: Get-LoggedIn
# ——————————————-
# Function Name: Get-LoggedIn
# Return the current logged-in user of a remote machine.
# ——————————————-
function Get-LoggedIn {
[CmdletBinding()]
param (
[Parameter(Mandatory=$True)]
[string[]]$computername
)
foreach ($pc in $computername){
$logged_in = (gwmi win32_computersystem -COMPUTER $pc).username
$name = $logged_in.split(“\”)[1]
“{0}: {1}” -f $pc,$name
}
}
426m01
gd9m7v
I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again
I like this weblog very much so much good information.
k0ncs4
5xibaw
xq0glz
a78l89
q7hmlj