external help file | Module Name | online version | schema |
---|---|---|---|
ConnectWiseManageAPI-help.xml |
ConnectWiseManageAPI |
2.0.0 |
This command is used to authenticate with the Manage server.
Connect-CWM -Server <String> -Company <String> -PubKey <String> -PrivateKey <String> -ClientID <String>
-MemberID <String> [-Force] [-Version <String>] [-BasePath <String>] [<CommonParameters>]
Connect-CWM -Server <String> -Company <String> -PubKey <String> -PrivateKey <String> -ClientID <String>
[-Force] [-Version <String>] [-BasePath <String>] [<CommonParameters>]
Connect-CWM -Server <String> -Company <String> -ClientID <String> -Credentials <PSCredential> [-Force]
[-Version <String>] [-BasePath <String>] [<CommonParameters>]
This will create a script variable that contains all needed connection and authorization information. All other commands from the module will call this variable to get connection information.
$Connection = @{
Server = $Server
Company = $Company
PubKey = $PubKey
PrivateKey = $PrivateKey
ClientID = $ClientID
}
Connect-CWM @Connection
In this example we are connecting with an API Key.
Using an API Key is the preferred authentication method.
$Connection = @{
Server = $Server
Company = $Company
PubKey = $PubKey
PrivateKey = $PrivateKey
MemberID = $MemberID
ClientID = $ClientID
}
Connect-CWM @Connection
In this example we are connecting with an API key and impersonating another user. $MemberID
$Connection = @{
Server = $Server
Company = $Company
Credentials = $Credentials
ClientID = $ClientID
}
Connect-CWM @Connection
In this example we are connecting with a cookie, using user credentials.
This method will not work on accounts with MFA enabled. All your accounts are MFA enabled, right?
This method is going to be removed in future versions. Please move to a different authentication method.
https://developer.connectwise.com/Products/Manage/Developer_Guide#Authentication
$Connection = @{
Server = $Server
Company = $Company
PubKey = $PubKey
PrivateKey = $PrivateKey
ClientID = $ClientID
}
Connect-CWM @Connection -Force -Version '3.0.0'
In this example we are telling it to ignore any cached connection info and return v3.0.0 objects.
Integration Identifier created by a user. See https://developer.connectwise.com/ClientID
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The login company.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Manage username and password as a PSCredential object [pscredential]. This method will not work on accounts with MFA enabled. All your accounts are MFA enabled, right?
Type: PSCredential
Parameter Sets: Cookie
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Ignore cached information and recreate
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The member that you are impersonating
Type: String
Parameter Sets: Impersonation
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Private API key created by a user docs: My Account
Type: String
Parameter Sets: Impersonation, API Key
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Public API key created by a user docs: My Account
Type: String
Parameter Sets: Impersonation, API Key
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The URL of your ConnectWise Mange server. Example: manage.mydomain.com
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Used to specify a version. If not used it will use the servers current version.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill BasePath Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
$script:CWMServerConnection
Author: Chris Taylor Date: 10/10/2018
Author: Darren White Update Date: 8/8/2019 Purpose/Change: Added support for clientId header
Author: Chris Taylor Update Date: 9/24/2019 Purpose/Change: Added API version support and added parameter validation
https://developer.connectwise.com/Manage/Developer_Guide#Authentication