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 »

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
Product Manager
Posts: 14301
Liked: 2880 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

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

Post by HannesK »

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: 20271
Liked: 2252 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 »

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 »

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: 20271
Liked: 2252 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 »

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 »

thank you, I will give that a try
TWuser
Enthusiast
Posts: 26
Liked: 4 times
Joined: Sep 07, 2021 5:37 pm
Full Name: TW
Contact:

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

Post by TWuser »

I know it's an old post, but in case anyone else ends up here looking for an answer like me -

Using the code described by tsightler at the link below works on a pre or post script to get a list of VM's in the running job.
powershell-f26/powershell-cmd-let-to-ge ... 64181.html

Starting with that script and then feeding the list of VM's into PowerCLI your pre or post script can help you manipulate VM's in vcenter.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests