function ConnectToTenant($credentials)
{
# Connect to to Office 365
try{
Connect-SPOService -Url $global:adminUrl -Credential $credentials -ErrorAction Stop
write-host “Info: Connected succesfully to Office 365” -foregroundcolor green;
return $true;
}
catch{
write-host “Error: Could not connect to Office 365” -foregroundcolor red;
break;
}
}