Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

insert multiple objects into variable (array)

$
0
0

Hello,

 I need to create PS script to which gets logged on users(get-rdusersession | select UserName), puts them into variable $users=@(user1,user2,...,userN) and runs foreach {something} - something like send message and logoff user. But I cannot get the output from command get-rdusersession to the variable. Can someone tell, how to do that? Thank you.

Pete


sfs


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>