Archive for category powercli
Get Active Network Adapter
Posted by edwgon in Microsoft, Microsoft System Center Configuration Manager 2012 R2 SP1, Network, powercli, PowerShell, SCCM 2012, Utilities, Windows Server 2008, Windows Server 2012 R2 on May 18, 2016
Recently I had the need to create a script to find out what was the active network adapter in our server, so after some ideas from the web, I came up with a one line PowerShell script that helped me achieve my goal.
Note: Get-NetAdapter is a PowerShell commandlet that’s present on Windows 8 and Windows Server 2012 R2. This command will not work on Windows 7.
Get-NetAdapter | Where-Object {($_.LinkSpeed -eq “1 Gbps”) -and ($_.Status -eq ‘Up’)}
In this line, I’m basically getting the adapter with status ‘Up’ and with a linkspeed equals to ‘1 Gbps’. One can change LinkSpeed property to match your server’s network adapter speed(s).
List All Disks (VMDKs) In A Virtual Machine (ESXi)
Posted by edwgon in administrator, disks, esxi, filename, http://schemas.google.com/blogger/2008/kind#post, powercli, PowerShell, virtual, virtual machines, vmdk, vmdks, vmware on March 31, 2015
Using VMware PowerCLI, PowerShell, there’s a nifty way to get a list of all VMDKs associated with a virtual machine(s).
Here’s the command:
For this sample, I chose to output the following fields:
Recent Comments