我有一位用户通过RDP使用用户名“英雄”登录,但是当我String query = String query =
String query = 'SELECT id, ELC_SubStatus__c FROM Case WHERE SubStatus__c ='+ refund +' AND createdDate < LAST_N_DAYS:10';
使用该计算机并运行Enter-PSSesssion
时,我得到了此输出:
Get-WMIObject -class Win32_ComputerSystem | select username
答案 0 :(得分:1)
以下是here:
的答案# replace $computer with your remote machine
$csvtxt=QWINSTA /SERVER:$computer|%{[string]::Join(',',$_.Split(' ',
[StringSplitOptions]::RemoveEmptyEntries))}
$csv=ConvertFrom-Csv $csvtxt
$csv
这会将QWINSTA的输出解析为PSObject,从这里你可以做到:
$csv | Select USERNAME