- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Build a scriprt that check all my VM's
Hi,
I would like your help with a script that I wont to create that will run ones a day and check if all my vm's are powered on and there nic cards is connected.
Can some one help me with the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Moderator: Thread moved to the PowerCLI area.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could do something like this
ForEach-Object -Process {
Get-NetworkAdapter -VM $vm |
Select @{N='VM';E={$vm.Name}},
@{N='PowerState';E={$vm.PowerState}},
@{N='NIC';E={$_.Name}},ConnectionState
} | where{$_.PowerState -ne 'PoweredOn' -or $_.ConnectionState -ne 'Connected'}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your help.
If I have a cupule of servers that I would like that if its powered off that the script will power them on and connect the nic card.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You seem to be adding additional requirements to your original request.
Sorry, I stopped answering those.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference