PowerShell script exchange
Post Reply
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Script to disable "connect at power on" on the replica

Post by dcd62 » May 19, 2020 6:51 pm

I'm trying to find the job setting or a post job script to disable the NIC's "connect at power on" on the replica. I do not want the replica's NIC to be enabled.
thanks

HannesK
Veeam Software
Posts: 5439
Liked: 738 times
Joined: Sep 01, 2014 11:46 am
Location: Austria
Contact:

Re: Script to disable "connect at power on" on the replica

Post by HannesK » May 20, 2020 5:32 am

Hello,
what do you think about using VMware powercli? Because a failover just starts a VM.

Code: Select all

Set-NetworkAdapter -Connected:$false -Confirm:$false
Best regards,
Hannes

veremin
Product Manager
Posts: 17625
Liked: 1591 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script to disable "connect at power on" on the replica

Post by veremin » May 20, 2020 10:51 am

Neither replication job nor replication failover has "Connect VM to network" as configurable setting, so, there is no way to modify it via Veeam PowerShell Snap-in. So, PowerCLI proposed by Hannes seems like the only option. Thanks!

dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: Script to disable "connect at power on" on the replica

Post by dcd62 » May 20, 2020 6:31 pm

Hi, thanks for the suggestions. The problem is we re-run the replication job each night to keep them in sync until we failover to the replica (using this for v2v migrations). So if I set it on the replica, it will be overwrite after each job.

If I create a script and set it to "Run the following script after the job",so it's set after each run, how do I pass it the vm name?

thanks again.

veremin
Product Manager
Posts: 17625
Liked: 1591 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script to disable "connect at power on" on the replica

Post by veremin » May 20, 2020 7:55 pm

You might set vm names as static values, if the list of replicated VMs does not change much.

Otherwise, you can use Get-VBRJobObject cmdlet to get replication job source objects. The objects will have name property.

Thanks!

dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: Script to disable "connect at power on" on the replica

Post by dcd62 » May 21, 2020 3:11 pm

thank you, I will give that a try

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests