Basically i need to summarize a list of accounts in the below format to this TestAccount01-04:
TestAccount01
TestAccount02
TestAccount03
TestAccount04
I tried messing around some but was not successful. The accounts are stored in avariable ran by this command:
$accounts = Get-ADUser -Filter {samaccountname -like "TestAccount*"} -searchbase "OU=xxx,OU=xxx,OU=xxx,dc=xxx,dc=xxx,dc=com" | select name
Any ideas on how to do this?