In response to California Assembly Bill 1637, requiring us to change our domains to either .gov or .ca.gov, our IT department is changing all user's email addresses and UPN's resulting in our ArcGIS Online and ArcGIS Enterprise environments seeing these users as new users as our authentication is using SAML and the SAML ID is changing.
I would like to be able script this process rather than having to handle it one by one, but while I have been able to create a SAML user with the same permissions as the old username, I have not been able to script the checking to see if the user has a license and if they do, revoke the license and assign it to the new user.
Has anyone done anything like this? If so can you help point me in the right direction as I am not seeing anything in the documentation.