Replacing Everyone/Everyone except external users account with a different User/Group

Technorati Tags: Migrate User in SPO,Replace Everyone in SPO,Replace Everyone except external users in SPO,SPO,O365,SharePoint Online     Recently I had couple of customers asking me for a script where they can replace Everyone/Everyone except external users account in SPO with a different account/group. Following script will copy permissions of an account to a new…