![]() $proxyaddr = "$AdminURI/_vti_bin/UserProfileService.asmx?wsdl" # Add the path of the User Profile Service to the SPO admin URL, then create a new webservice proxy to access it $UserCredential = New-Object -argumentlist $AdminAccount, $sstr $creds = New-Object ($AdminAccount, $sstr) $sstr = ConvertTo-SecureString -string $AdminPass -AsPlainText -Force # Specify the secondary admin account and the url for the onedrive site # Specify the User account for an Office 365 global admin in your organization ![]() # Specify your organization admin central url # Run the below script (copy and paste into the shell window). Run as administrator the SharePoint Online Management Shell $temp = Set-SPOUser -Site $sitename -LoginName $secondaryadmin -IsSiteCollectionAdmin $false ![]() You would need to go back into the user profiles in the SharePoint admin center to add yourself back if needed, or rerun the script below and set the secondary admin name, and change the $false to $true on this line from in the script. Running the following script will remove you from the secondary admin to all the my. sites, and it can be ran as SharePoint admin as well so Global admin isn't necessary to successfully run this. I just found your post while researching on this as I realized I am secondary admin to 12k user profiles in our company! Credit to Microsoft support on this PowerShell below.
0 Comments
Leave a Reply. |