Connect-MsolService
Published: March 22, 2013
Updated: September 17, 2014
Applies To: Azure, Office 365, Windows Intune
Note |
|---|
|
The Connect-MsolService cmdlet will attempt to initiate a connection to the online service. The caller must provide their credential (a PSCredential object).
Note |
|---|
| 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
There are several other places you can get more information and help. These include:
See Also
Note