This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
HTML Server Disk Usage Report Script | |
Kevin Kirkpatrick | |
nullzero.io | |
Created 7/31/2013 | |
This report, as currently written, is meant to create and save the HTML report in a location of your Choosing. | |
If attaching the HTML report is desired, edit the EMail settings attachemtn location variable and go to the | |
bottom of the script and un-comment the attachment options. | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-VMDetails { | |
<# | |
.SYNOPSIS | |
Returns more detailed statistics and configuration for a single or multiple VMs | |
.DESCRIPTION | |
Returns more detailed statistics and configuration for a single or multiple VMs | |
This function assumes that you are already connected to one, or more, vCenter Servers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
These are examples of the process flow of using the ProtectedData PowerShell Module to encrypt a credential using certificates | |
on two servers | |
https://github.com/dlwyatt/ProtectedData | |
This does not represent a recommended approach, per se, but it does offer another secure means of persisting credentials to | |
a file vs. using DPAPI (Data Protection API); it's mainly written to help people grasp some basic concepts of asymmetric | |
encryption, in action. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-PowerCLI { | |
<# | |
.NOTES | |
Loads PowerCLI, depending on what version you have installed. Set the default -Version parameter, depending in your environment. | |
#> | |
[cmdletbinding()] | |
param ( | |
[parameter(Mandatory = $false, Position = 0)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vtepReportPath = "$Home\Desktop\ESXi_VTEP_Report.csv" | |
$vtepFinalReport = @() | |
Get-VMHostNetworkAdapter -VMKernel | Foreach-Object { | |
$vtepInterfaceQuery = $null | |
$vtepInterfaceQuery = $_.ExtensionData | Where-Object {$_.Spec.NetStackInstanceKey -eq 'vxlan'} | |
foreach ($vtep in $vtepInterfaceQuery) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-VMHostVtepInterface { | |
<# | |
.SYNOPSIS | |
Gather VTEP interface inventory from all ESXi hosts | |
.DESCRIPTION | |
Gather VTEP interface inventory from all ESXi hosts. | |
This function was written with scale and speed in mind. It pull a host inventory using API calls and then unrolls API properties and | |
assigned them to a PSCustomObject. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this moved to the following repository: https://github.com/vScripter/vSphereNetworkInventory | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-VMDetails { | |
<# | |
.SYNOPSIS | |
Returns more detailed statistics and configuration for a single or multiple VMs | |
.DESCRIPTION | |
Returns more detailed statistics and configuration for a single or multiple VMs | |
.PARAMETER Server | |
VI (vCenter) server name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$queryItems = Get-Service | Select ServiceName,Status | |
foreach ($service in $queryItems) { | |
# clear on each iteration | |
$objSvc = @() | |
# create properties and assign values; in this example I am using strong types to define the type of value | |
# the property will return | |
$objSvc = [PSCustomObject] @{ | |
Service = [System.String]$service.ServiceName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# No need for the code on the next line, just put the functions in this script; you run into scoping issues dot sourcing these functions, the way they are written | |
#. .\func1.ps1 | |
#region functions | |
function Start-LogLyncAvailability { | |
[CmdletBinding( | |
SupportsShouldProcess = $false, | |
ConfirmImpact = "None", | |
DefaultParameterSetName = "")] |