I recently had to migrate a ton of users from one Skype For Business Pool to a new one.
Step 1: Get the Users
To get started we wanted to to see what we were working with so I wrote the following Powershell script that output a CSV file with all of our users that we wanted to migrate in it.
$dayStart = get-date
$dayEnd = $dayStart.AddDays(-300)
get-aduser -Filter ‘Enabled -eq $true -and lastlogondate -gt $dayEnd -and UserPrincipalName -notlike “system-*” -and mail -ne “$null”‘ -properties * | Select-Object DisplayName, SAMAccountName, Department, SipAddress, Enabled, LastLogonDate, msRTCSIP-UserEnabled, msRTCSIP-PrimaryUserAddress | Export-CSV c:\Existing_Lync_Users.csv
You can add as many parameters as you want to the filter and there is some interesting information here on how to structure your WHERE clauses. For me I wanted to make sure the