Hello everyone.
We have a script, which return usernames and their assigned desktops:
$VPS=Get-RDPersonalVirtualDesktopAssignment -CollectionName vps -ConnectionBroker srv-rdcb-en-03.bankspb.ru |select user | Sort-Object User | %{$_.User.Split('\')[1]}Split for removing domain name. It returns user logon name. After it we use cycle to get info about users:
$VU=foreach ($VPSUSER in $VPS) {Get-ADUser -Identity $VPSUSER -Properties * | select sAMAccountName,Name,Department, Company,Enabled}I want to export VM name and username already in CN format (ot First Name + Last Name) in one string(Ex. VMName - User Name). It can be done thorugh hashtable, as i understand.