Hello all,
Im trying to sort by servers named SACCTX001 - SACCTX999 but everything I have tried seems to not work. What I have currently brings up some extra servers that I do not need I have tried SACCTX[0-9], SACCTX### and SACCTX/n. Does anyone know what I should be using?
Thanks,
Glenn
Im trying to sort by servers named SACCTX001 - SACCTX999 but everything I have tried seems to not work. What I have currently brings up some extra servers that I do not need I have tried SACCTX[0-9], SACCTX### and SACCTX/n. Does anyone know what I should be using?
Code:
$filter = "SACCTX*"
$ADDomain = "OU=Citrix,OU=Servers,OU=DDC,dc=deltads,dc=ent"
$servers = Get-ADComputer -SearchBase $ADDomain -Filter {Name -Like $filter} | Sort-Object Name | Select-Object -ExpandProperty Name
Thanks,
Glenn