Hi all,
I have a varible with the following fields:
onlineuser,FirstName,LastName,LoggedonHost,sinceloginHRS, UserGroup,
Now i'm adding a new field called 'captured username'. on this field i want to run get-tssesion and capture the active user into this field. This command below isnt working, how do i add a for each on that paticular field?
$sqlcmddata | select-object onlineuser,FirstName,LastName,LoggedonHost,sinceloginHRS, UserGroup,@{Name="CapturedUserName"; Expression={
Get-TSSession -ComputerName $_.loggedonhost -State Active | select username} }
Add expression to table and do a foreach on that expression
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.