You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-to-exchange-online-powershell.md
+16-77Lines changed: 16 additions & 77 deletions
Original file line number
Diff line number
Diff line change
@@ -42,31 +42,35 @@ To use the older Exchange Online Remote PowerShell Module to connect to Exchange
42
42
> [!TIP]
43
43
> Having problems? Ask in the [Exchange Online](https://go.microsoft.com/fwlink/p/?linkId=267542) forum.
44
44
45
-
## Connect to Exchange Online PowerShell using MFA and modern authentication
45
+
## Connect to Exchange Online PowerShell using modern authentication with or without MFA
46
46
47
-
If your account uses multi-factor authentication, use the steps in this section. Otherwise, skip to the [Connect to Exchange Online PowerShell using modern authentication](#connect-to-exchange-online-powershell-using-modern-authentication) section.
47
+
These connection instructions use modern authentication and work with or without multi-factor authentication (MFA).
48
48
49
-
**Note**: For other sign in methods that are available in PowerShell 7, see the [PowerShell 7 log in experiences](#powershell-7-log-in-experiences) section later in this topic.
49
+
For other sign in methods that are available in PowerShell 7, see the [PowerShell 7 log in experiences](#powershell-7-log-in-experiences) section later in this topic.
50
50
51
51
1. In a PowerShell window, load the EXO V2 module by running the following command:
52
52
53
53
```powershell
54
54
Import-Module ExchangeOnlineManagement
55
55
```
56
56
57
-
**Note**: If you've already [installed the EXO V2 module](exchange-online-powershell-v2.md#install-and-maintain-the-exo-v2-module), the previous command will work as written.
57
+
**Notes**:
58
+
59
+
- If you've already [installed the EXO V2 module](exchange-online-powershell-v2.md#install-and-maintain-the-exo-v2-module), the previous command will work as written.
60
+
- You might be able to skip this step and run **Connect-ExchangeOnline** without loading the module first.
58
61
59
62
2. The command that you need to run uses the following syntax:
-_\<UPN\>_ is your account in user principal name format (for example, `[email protected]`).
66
69
- When you use the _ExchangeEnvironmentName_ parameter, you don't need use the _ConnectionUri_ or _AzureADAuthorizationEndPointUrl_ parameters. For more information, see the parameter descriptions in [Connect-ExchangeOnline](/powershell/module/exchange/connect-exchangeonline).
67
70
- The _DelegatedOrganization_ parameter specifies the customer organization that you want to manage as an authorized Microsoft Partner. For more information, see [Partners](/office365/servicedescriptions/office-365-platform-service-description/partners).
68
71
- If you're behind a proxy server, run this command first: `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value>`, where \<Value\> is `IEConfig`, `WinHttpConfig`, or `AutoDetect`. Then, use the _PSSessionOption_ parameter with the value `$ProxyOptions`. For more information, see [New-PSSessionOption](/powershell/module/microsoft.powershell.core/new-pssessionoption).
69
-
- The progress bar is now shown by default, so `-ShowProgress $true` is no longer required. To hide the progress bar, use this exact syntax: `-ShowProgress:$false`.
72
+
- You can often omit the _UserPrincipalName_ parameter in the next step to enter both the username and password after you run the **Connect-ExchangeOnline** command. If it doesn't work, then you need to use the _UserPrincipalName_ parameter.
73
+
- If you aren't using MFA, you can often use the _Credential_ parameter instead of the _UserPrincipalName_ parameter. First, run the command `$Credential = Get-Credential`, enter your username and password, and then use the variable name for the _Credential_ parameter (`-Credential $Credential`). If it doesn't work, then you need to use the _UserPrincipalName_ parameter.
70
74
71
75
**This example connects to Exchange Online PowerShell in a Microsoft 365 or Microsoft 365 GCC organization**:
72
76
@@ -98,85 +102,20 @@ If your account uses multi-factor authentication, use the steps in this section.
For detailed syntax and parameter information, see [Connect-ExchangeOnline](/powershell/module/exchange/connect-exchangeonline).
105
+
3. In the sign-in window that opens, enter your password, and then click **Sign in**.
102
106
103
-
> [!NOTE]
104
-
> Be sure to disconnect the remote PowerShell session when you're finished. If you close the PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command.
107
+

105
108
106
-
```powershell
107
-
Disconnect-ExchangeOnline
108
-
```
109
+
4.**MFA only**: A verification code is generated and delivered based on the response option that's configured for your account (for example, a text message or the Microsoft Authenticator app on your device).
109
110
110
-
## Connect to Exchange Online PowerShell using modern authentication
111
+
In the verification window that opens, enter the verification code, and then click **Verify**.
111
112
112
-
If your account doesn't use multi-factor authentication, use the steps in this section.
113
-
114
-
**Note**: For other sign in methods that are available in PowerShell 7, see the [PowerShell 7 log in experiences](#powershell-7-log-in-experiences) section later in this topic.
115
-
116
-
1. In a PowerShell window, load the EXO V2 module by running the following command:
117
-
118
-
```powershell
119
-
Import-Module ExchangeOnlineManagement
120
-
```
121
-
122
-
**Note**: If you've already [installed the EXO V2 module](exchange-online-powershell-v2.md#install-and-maintain-the-exo-v2-module), the previous command will work as written.
123
-
124
-
2. Run the following command:
125
-
126
-
> [!NOTE]
127
-
> You can skip this step and omit the _Credential_ parameter in the next step to be prompted to enter the username and password after you run the **Connect-ExchangeOnline** command. If you omit the _Credential_ parameter and include the _UserPrincipalName_ parameter in the next step, you're only prompted to enter the password after you run the **Connect-ExchangeOnline** command.
128
-
129
-
```powershell
130
-
$UserCredential = Get-Credential
131
-
```
132
-
133
-
In the credentials prompt, enter your work or school account and password.
134
-
135
-
3. The last command that you need to run uses the following syntax:
- When you use the _ExchangeEnvironmentName_ parameter, you don't need use the _ConnectionUri_ or _AzureADAuthorizationEndPointUrl_ parameters. For more information, see the parameter descriptions in [Connect-ExchangeOnline](/powershell/module/exchange/connect-exchangeonline).
142
-
- The _DelegatedOrganization_ parameter specifies the customer organization that you want to manage as an authorized Microsoft Partner. For more information, see [Partners](/office365/servicedescriptions/office-365-platform-service-description/partners).
143
-
- If you're behind a proxy server, store the output of the [New-PSSessionOption](/powershell/module/microsoft.powershell.core/new-pssessionoption) cmdlet in a variable (for example, `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value> [-ProxyAuthentication <Value>] [-ProxyCredential <Value>]`). Then, use the variable (`$ProxyOptions`) as the value for the _PSSessionOption_ parameter.
144
-
- The progress bar is now shown by default, so `-ShowProgress $true` is no longer required. To hide the progress bar, use this exact syntax: `-ShowProgress:$false`.
145
-
146
-
**Connect to Exchange Online PowerShell in a Microsoft 365 or Microsoft 365 GCC organization**:

175
114
176
115
For detailed syntax and parameter information, see [Connect-ExchangeOnline](/powershell/module/exchange/connect-exchangeonline).
177
116
178
117
> [!NOTE]
179
-
> Be sure to disconnect the remote PowerShell session when you're finished. If you close the PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command:
118
+
> Be sure to disconnect the remote PowerShell session when you're finished. If you close the PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command.
For detailed syntax and parameter information, see [Connect-IPPSSession](/powershell/module/exchange/connect-exchangeonline).
82
+
For detailed syntax and parameter information, see [Connect-IPPSSession](/powershell/module/exchange/connect-ippssession).
83
83
84
84
> [!NOTE]
85
85
> Be sure to disconnect the remote PowerShell session when you're finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command.
@@ -146,7 +146,7 @@ If your account doesn't use multi-factor authentication, use the steps in this s
For detailed syntax and parameter information, see [Connect-IPPSSession](/powershell/module/exchange/connect-exchangeonline).
149
+
For detailed syntax and parameter information, see [Connect-IPPSSession](/powershell/module/exchange/connect-ippssession).
150
150
151
151
> [!NOTE]
152
152
> Be sure to disconnect the remote PowerShell session when you're finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command:
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/exchange-cmdlet-syntax.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,10 @@ This article explains these conventions, and also the syntax that's required to
27
27
28
28
Exchange PowerShell help follows conventions that indicate what's required or optional, and how to enter parameters and values when you run a command. These command conventions are listed in the following table.
29
29
30
+
<br>
31
+
32
+
****
33
+
30
34
|Symbol|Description|
31
35
|---|---|
32
36
|`-`|A hyphen indicates a parameter. For example, `-Identity`.|
@@ -107,6 +111,10 @@ If you enclose the string in single quotation marks, the only special character
107
111
108
112
The following table shows the valid operators that you can use in an Exchange command. Some of these symbols were also described in the earlier [Command conventions in Exchange PowerShell](#command-conventions-in-exchange-powershell) section. However, these symbols have different meanings when they're used on the command line as operators. For example, the minus sign that's used to indicate a parameter can also be used in a command as a mathematical operator.
109
113
114
+
<br>
115
+
116
+
****
117
+
110
118
|Operator|Description|
111
119
|---|---|
112
120
|`=`|The equal sign is used as an assignment character. The value on the right side of the equal sign is assigned to the variable on the left side of the equal sign. The following characters are also assignment characters: <ul><li>`+=`: Add the value on the right side of the equal sign to the current value that's contained in the variable on the left side of the equal sign.</li><li>`-=`: Subtract the value on the right side of the equal sign from the current value that's contained in the variable on the left side of the equal sign.</li><li>`*=`: Multiply the current value of the variable on the left side of the equal sign by the value that's specified on the right side of the equal sign.</li><li>`/=`: Divide the current value of the variable on the left side of the equal sign by the value that's specified on the right side of the equal sign.</li><li> `%=`: Modify the current value of the variable on the left side of the equal sign by the value that's specified on the right side of the equal sign.</li></ul>|
0 commit comments