forked from christaylorcodes/ConnectWiseControlAPI
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Connect_MFA.ps1
21 lines (17 loc) · 823 Bytes
/
Connect_MFA.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Load module
Import-Module 'ConnectWiseControlAPI'
$ConnectSplat = @{
Server = (Read-Host "Enter Control server domain without HTTPS (ie control.domain.com)")
Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList (Read-Host "Enter Username"), (Read-Host "Enter Password" -AsSecureString)
secret = (Read-Host "Enter your MFA secret (ie S7KDXWV7WSSEGALX)" -AsSecureString)
}
Connect-CWC @ConnectSplat
<#
Non Interactive
$ConnectSplat = @{
Server = 'control.domain.com'
Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, (ConvertTo-SecureString -String $password -AsPlainText -Force)
secret = 'S7KDXWV7WSSEGALX' | ConvertTo-SecureString -AsPlainText
}
Connect-CWC @ConnectSplat
#>