Solved.
Put it into an Array:
foreach($person in $usernameresults)
{
Add-ListViewItem -ListView $listview1 -Items $person.ntaccountname -SubItems $person.accountislockedout
}
Thanks
Select-Object output into ListView?
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.
-
- Posts: 18
- Last visit: Thu Apr 18, 2019 7:07 am