Muhammad;
I'm not sure this is a reasonable thing to do and possibly dangerous if mishandled. This result will be the new owner having hundreds of new folders in their "My drive", each named for the original user.
I will assume all of the drives are to be transferred to a single new owner.
First you will need a csv file of all the users:
> gam redirect csv ./users.csv print users
You will need to verify that only the users whose drives you want to transfer are in the csv file as the above command returns all of the users for the entire workspace. Assuming you have reviewed the "users.csv" and there is only one target owner the command is very simple:
This will create a bunch of background drive transfers to "
newo...@mydomain.com". I don't know if there are any limits on the number of transfers, or files that can be transferred to a target My drive. Your mileage may vary.
If the files will be transferred to multiple owners you will need to add a second column to the "users.csv" file, call it "NewOwner". You will need to manually edit the "users.csv" to include the new owner for each row in the file. The the transfer command would look like this:
> gam csv ./users.csv gam create transfer ~primaryEmail drive ~NewOwner all