Using ArcGIS Enterprise 10.5, is it possible to write a script to change named users from Level 2 users to Level 1 users? I looked at the ArcGIS Python API and while it appears you can do a number of things, including changing the role, I did not see any mention of changing the level in the documentation.
If you can do it through the UI, you can do it through Python. Taking a look at the network traffic, it looks like it updates the user level by using the following URL and parameters:
https://<portal_host>/<context>/sharing/rest/portals/self/updateUserLevel and passes the following parameters:
Then, it updates the user to be an appropriate role for the new level:
I'm not too sure if it's been included in the documentation or the Python API itself, though.
I believe the URLs above will only work for Portal, but the same concept applies; perform your operation in ArcGIS Online with Fiddler or the Dev Tools open to capture the traffic, and then recreate the request using Python.