Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Get Users CN from RDPersonalDesktopAssignment

$
0
0

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.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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