Modify user profile permissions by script

Hello

Is there a way to script the tick on these 2 permissions? There is a lot of users to modofy and a script to modify in bulk would help.

Thank you

Regards

JM