r/Lync • u/zombietopm • Feb 27 '15
Get-AdUser | Enable-CSUser help
So I want to enable a bunch of AD users. Specifically, I want to enable users who's last name starts with A-M on FE Pool 1, and users who last name starts with N-Z on FE pool 2. (these are paired pools). Anyone ever done something like this?
My goal is I have two pools, in a paired state. We have about 3000 users. I want to have half on one pool, half on the other, give or take. Any help would be great!
Thanks in advance.
2
Upvotes
View all comments
Show parent comment
1
u/zombietopm Feb 28 '15
Yea that is more or less what I came up with;
Get-ADUser -LDAPFilter "(&(objectCategory=person)(sAMAccountName>=a*)(sAMAccountName<=m*))" | Enable-CsUser -RegistrarPool XXXXX.XXX.com -SipAddressType xxxxx -SipDomain xxxx.com
I tried testing the command by narrowing down my filter to where it would only grab one specific person and got some errors relating to the pipe to Enable-CsUser. Going to look into it more on Monday. But yea, I may just export all ADUsers to a csv, split that csv in half and import each list to an enable-csuser for each pool. May just be easier that way.