Currently I have this script:
$SiteURL="https://contoso.sharepoint.com/sites/contoso"
$UserID="j.doe@contoso.nl"
#Get Credentials to connect
$Cred = Get-Credential
#Connect to SharePoint Online Admin Site
Connect-SPOService -Url $AdminSiteURL -Credential $cred
#sharepoint online powershell remove user permissions from site collection
Get-SPOUser -Site $SiteURL -LoginName $UserID
But I have multiple site collections that it needs to find that user in:
https://contoso.sharepoint.com/sites/Projecten
https://contoso.sharepoint.com/sites/PFO
How can I do this using a for
loop so it finds the user in each site collection?