If you look closely at your loop, you'll notice your export-csv is inside the loop. That means it's doing an export-csv for each user, each time overwriting the csv created by the last user. The end result is that your csv only contains information for the last user that went through the loop. You need to let the loop accumulate all the objects, and then pipe that to export-csv when it's done: