Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

If I understand your question correctly, you want to run the report for all VMs in a vCenter?

In that case, you could change the start of the script to the following.

PS1: I sincerely hope that you are not using such an old PowerCLI version that you need PSSnapin?

PS2: there is a Start-VM at the end of the script. Is that needed?

Connect-VIServer -Server vcenter.local -User username -Password Password

Foreach ($vm in Get-VM)

{

    $date=Get-Date -format "ddMMyy_HHmm"

    Get-AdvancedSetting -Entity $vm | Select Name, Value | Export-CSV $vm"_Before_$date.csv"


    New-AdvancedSetting -Entity $vm -Name vmci0.unrestricted -Value FALSE -Confirm:$False -Force:$True


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos