Open notepad or any text editor and add the following commands:
- Import-Module Microsoft.Online.SharePoint.PowerShell
- Connect-SPOService -Url https://tenant-admin.domain/ -credential UserName
- save the file with extension ps1
- run the file from SharePoint online management shell.
Then you will receive a popup to enter the password
![](https://sharepointcommunityonline.com/wp-content/uploads/2024/04/image.png)
You can open SharePoint online Management shell and execute directly the connect command