PowerShell script exchange
Post Reply
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

How do you do Powershell with MFA enabled on the console

Post by jdoty »

I am trying to run some powershell scripts in the console and they are failing because the console has MFA enabled. The console is running which is how I launched the Powershell console. I tried the Connect-VBRServer command with credentials but it didn't prompt for MFA and failed with the error below:

Connect-VBRServer : PowerShell client update environment initialization failed: Failed to connect to Veeam Backup &
Replication server:
The logon attempt failed
Execution environment cannot be initialized to Remote
At line:1 char:1
+ Connect-VBRServer -Credential $Cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Connect-VBRServer], AggregateException
+ FullyQualifiedErrorId : UpdateCheckerErrorId,Veeam.Backup.PowerShell.Cmdlets.ConnectVBRServer
ronnmartin61
Veeam Software
Posts: 555
Liked: 208 times
Joined: Mar 07, 2016 3:55 pm
Full Name: Ronn Martin
Contact:

Re: How do you do Powershell with MFA enabled on the console

Post by ronnmartin61 » 1 person likes this post

MFA would be pretty useless if one could simply bypass it by running PS scripts to perform VBR operations. You'll need to add user/role definition(s) in VBR in order to run your scripts in a user context not subject to MFA...
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

Re: How do you do Powershell with MFA enabled on the console

Post by jdoty »

THanks, I am useing an account that doesn't require MFA.
ronnmartin61
Veeam Software
Posts: 555
Liked: 208 times
Joined: Mar 07, 2016 3:55 pm
Full Name: Ronn Martin
Contact:

Re: How do you do Powershell with MFA enabled on the console

Post by ronnmartin61 »

Great. Then MFA isn't the issue. I was able to reproduce this error by not specifying a target server. Try explicitly specifying the remote VBR host i.e.

Code: Select all

Connect-VBRServer -cred $credential -Server <IP/FQDN> 
If MFA is the issue you'll see an error like "Unable to connect to the server with MFA-enabled user account"
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

Re: How do you do Powershell with MFA enabled on the console

Post by jdoty »

Yes, I am all good now. Thanks again.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests