connect-SPOService in SharePoint Online

In Share point online environment,  we can use power shell commands for administrative tasks but the initial set up has to be done. Below are the commands which i have used to connect to the online environment.
 
Power shell Commands 
 
Import-Module MSOnline
$User = "[username]@[tenant].onmicrosoft.com"
$Pass = "[password]"
$creds = New-Object System.Management.Automation.PSCredential($User,(ConvertTo-SecureString $Pass -AsPlainText -Force));
#$creds = Get-Credentials;
Connect-MsolService -Credential $creds
Connect-SPOService -Url https://[tenant]-admin.sharepoint.com -Credential $creds
 
Happy SharePointing :-)