VMware Cloud Community
Petersaints
Enthusiast
Enthusiast

SRM 8.5 pre power on step command

Hello all,

Need to create a pre power step command so that the VM on the recovery site starts up with the network adapter disconnected.

I try the bellow one:

Get-VM -Name VM_NAME | Get-NetworkAdapter | where{$_.ConnectionState.Connected} | Set-NetworkAdapter -Connected:$false -Confirm:$false

I put the bellow powershell command, but when i test the recovery step i receive an error.

Petersaints_1-1699716176259.png

 

Petersaints_0-1699715966742.png

Can anyone help?

Thanks.

Regards.

0 Kudos
1 Reply
vFouad
Leadership
Leadership

unfortunately the SRM custom steps don't support PowerCLI directly, you will need to either create a wrapper/write it in a supported language, you may find the following useful:
https://communities.vmware.com/t5/Site-Recovery-Manager/Calling-a-powershell-script-from-SRM-applian...

https://docs.vmware.com/en/Site-Recovery-Manager/8.2/com.vmware.srm.admin.doc/GUID-4F084B4F-DE9C-4A7...

 

Good luck,

vFouad

0 Kudos