Android - Activate Device Administrator via ADB

It's not possible. The settings code is specifically written to prevent this. The closest you can come is to bring up the Device Administration Settings page in the Settings app. You can do this with:

adb shell am start -S "com.android.settings/.Settings\$DeviceAdminSettingsActivity"

Tested and working on Android 7.0 without root:

adb shell
dpm set-active-admin --user current com.company.foo.bar.package/.the.Admin.Reciever

To find the admin receiver of an installed package, use the following to adb shell command and review the output:

adb shell
pm dump com.company.foo.bar.package | grep ' filter' | cut -d ' ' -f 12 | sort | uniq

To give a real world example, here is the command used to activate IBM's Maas360 Android client as a device admin:

adb shell
pm dump com.fiberlink.maas360.android.control | grep ' filter' | cut -d ' ' -f 12 | sort | uniq

Output:
…
com.fiberlink.maas360.android.control/.receivers.GoogleCampaignReceiver
com.fiberlink.maas360.android.control/.receivers.LocalEventReceiver
com.fiberlink.maas360.android.control/.receivers.Maas360DeviceAdminReceiver  <-- This is the one I want
com.fiberlink.maas360.android.control/.receivers.Maas360SecondaryDeviceAdminReceiver
…


Set Device Admin:    
dpm set-active-admin --user current com.fiberlink.maas360.android.control/.receivers.Maas360DeviceAdminReceiver