Skip to content

Connect-Exchange

SYNOPSIS

Connect-Exchange establishes a Powershell session to an Exchange server

SYNTAX

Connect-Exchange [[-Server] <String[]>] [[-Prefix] <String>] [[-Credential] <PSCredential>] [-AllowClobber]
 [[-CmdletsToLoad] <String[]>] [-Disconnect] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

EXAMPLE 1

Connect-Exchange

Opens a session to one of the default Exchange servers and imports all functions

EXAMPLE 2

Connect-Exchange -Server 'outlook.office365.com' -Prefix Ex365

Opens a session to the office365 server and applies the prefix Ex365 to the imported functions

PARAMETERS

-Server

Connect to one of the provided servers

Type: String[]
Parameter Sets: (All)
Aliases: Servers

Required: False
Position: 1
Default value: ((Get-ADObject -Filter 'objectCategory -eq "msExchExchangeServer"' -SearchBase (Get-ADRootDSE).configurationNamingContext).Name | Get-ADComputer | Where-Object { $_.Enabled -eq $true } | Select-Object -ExpandProperty DNSHostName)
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Prefix

Specifies a prefix to the nouns in the names of imported commands. Use this parameter to avoid name conflicts that might occur when different commands in the session have the same name. For instance, if you specify the prefix Remote and then import a Get-Date cmdlet, the cmdlet is known in the session as Get-RemoteDate, and it is not confused with the original Get-Date cmdlet.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Credential

Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as User01, Domain01\User01, or User@Domain.com, or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, this cmdlet prompts you for a password.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-AllowClobber

Indicates that this cmdlet imports the specified commands, even if they have the same names as commands in the current session. If you import a command with the same name as a command in the current session, the imported command hides or replaces the original commands. For more information, see about_Command_Precedence. By default, Import-PSSession does not import commands that have the same name as commands in the current session.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CmdletsToLoad

{{ Fill CmdletsToLoad Description }}

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: @('*')
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Disconnect

{{ Fill Disconnect Description }}

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES