Export (0) Print
Expand All
Expand Minimize

Connect-MsolService

Published: March 22, 2013

Updated: January 21, 2014

Applies To: Office 365, Windows Azure, Windows Intune

noteNote
  • This topic provides online help content for cloud services, such as Windows Intune and Office 365, which rely on Windows Azure Active Directory for identity and directory services.

  • The Windows Azure Active Directory Module for Windows PowerShell cmdlets were previously known as the Microsoft Online Services Module for Windows PowerShell cmdlets.

The Connect-MsolService cmdlet will attempt to initiate a connection to the online service. The caller must provide their credential (a PSCredential object).

noteNote
This cmdlet may return a warning or error if the version of the module is out of date.

Connect-MsolService [-Credential <PSCredential>] [<CommonParameters>]

    -Credential <PSCredential>
        The credential to use for connecting to Office 365.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        "get-help about_commonparameters".

There are a couple of ways that you can connect to the online service. The first is to simply run the cmdlet and you will be prompted for credentials. The second is to supply the credentials as a variable ($cred is used below) and then specify that variable when connecting. The following examples demonstrate further.

The following command attempts to initiate a connection. Since no credential is provided, the user is prompted to enter a username and password.

Connect-MsolService

The following command attempts to initiate a connection to using the credential provided previously provided as $cred. The credential must be of the type PSCredential (typically retrieved through the Get-Credential cmdlet).

Connect-MsolService -Credential $cred

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft