This file contains hidden or 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
$user = "yourUser" | |
$password = "yourPassword" | |
# POST - Authorization | |
$Auth = @{uri = "http://yourVEM.fqdn:9399/api/sessionMngr/?v=v1_2"; | |
Method = 'POST'; #(or POST, or whatever) | |
Headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($user):$($password)")); | |
} #end headers hash table | |
} #end $params hash table |
This file contains hidden or 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
$ILOs = Import-Csv "C:\ILOs.csv" | |
$user = "user" | |
$password = "Passw0rd!" | |
foreach ($ILO in $ILOs) { | |
Set-HPiLOSNMPIMSetting -Server $ILO.ILO -Username $user -Password $password -SNMPAddress1 192.168.2.1 -SNMPAddress2 192.168.2.2 ` | |
-SNMPADDRESS1ROCOMMUNITY public -SNMPADDRESS1TRAPCOMMUNITYvalue public -SNMPADDRESS1TRAPCOMMUNITYVERSION v1 -SNMPADDRESS2ROCOMMUNITY public ` | |
-SNMPADDRESS2TRAPCOMMUNITYvalue public -SNMPADDRESS2TRAPCOMMUNITYVERSION v1 -AgentlessManagementEnable Yes | |
Add-HPiLOSSORecord -Server $ILO.ILO -Username $user -Password $password -SSOInputType "IMPORT_FROM_NETWORK" ` |
This file contains hidden or 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
$ESXiHostList = Get-VMHost | |
foreach ($ESXiHost in $ESXiHostList) | |
{ | |
#Configure HP 3PAR SATP/PSP Rule | |
$SATPesxcli = $ESXiHost | Get-EsxCli | |
$SATPesxcli.storage.nmp.satp.rule.add($null,"tpgs_on","3PAR custom rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=100","VMW_SATP_ALUA",$null,$null,"3PARdata") | |
Write-Host $ESXiHost ": HP 3PAR SATP/PSP Rule, configured." | |
#Disable ATS HB (http://kb.vmware.com/kb/2113956) |
This file contains hidden or 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
############################################################################# | |
# HP 3PAR PS Extend | |
# Written by Markus Kraus | |
# Version 1.0 | |
# | |
# https://mycloudrevolution.wordpress.com/ | |
# | |
# Changelog: | |
# 2016.02 ver 1.0 Base Release | |
# |
This file contains hidden or 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
############################################################################# | |
# 3Par Reporting | |
# Written by Markus Kraus | |
# Version 1.2 | |
# | |
# https://mycloudrevolution.wordpress.com/ | |
# | |
# Changelog: | |
# 2016.01 ver 1.0 Base Release | |
# 2016.02 ver 1.1 Added more CPG Details / Changed VV Space Calculation |
This file contains hidden or 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
var VcVMConfigSpec = new VcVirtualMachineConfigSpec(); | |
var changeValue = new Array(); | |
System.log ("Config From Array:"); | |
for (var i = 0; i < VcVmConfig.length; i++) { | |
System.log ("Name: " + VcVmConfig[i].key + " - " + "Value: " + VcVmConfig[i].value); | |
changeValue[i] = new VcOptionValue(); | |
changeValue[i].key = VcVmConfig[i].key; | |
changeValue[i].value = VcVmConfig[i].value; | |
} |
This file contains hidden or 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
############################################################################# | |
# VM Hardening Script | |
# Written by Markus Kraus | |
# Version 1.2 | |
# | |
# http://mycloudrevolution.com/ | |
# | |
# Changelog: | |
# 2016.01 ver 1.0 Base Release | |
# 2016.02 ver 1.1 Added more Error Handling |
This file contains hidden or 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
# Importing the CSV-file containing the NIC configuration. | |
$NICs = Import-Csv "C:\Scripts\NICs.csv" | Where-Object {$_.computername -eq $env:COMPUTERNAME} | |
foreach ($NIC in $NICs) { | |
$NetAdapter = Get-NetAdapter | Where-Object {$_.MacAddress -eq $NIC.MAC} | |
if ($NetAdapter) { | |
Write-Verbose "Found NIC $($NIC.NIC)" |
This file contains hidden or 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
if (!(get-pssnapin -name VMware.VimAutomation.Core -erroraction silentlycontinue)) { | |
add-pssnapin VMware.VimAutomation.Core | |
} | |
$i = 1 | |
$GCred = Get-Credential | |
$VMtoProcess = Get-VM -Name MY-VEEAM-01 | |
Write-Host -foregroundcolor DarkGreen -backgroundcolor white "vSphere Network Config of the VM:" | |
$VMtoProcess | Get-NetworkAdapter | Select Parent, NetworkName, MacAddress | ft -AutoSize |
This file contains hidden or 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
# Load ImageBuilder Snapin (if not already loaded) | |
if (!(Get-PSSnapin -name VMware.ImageBuilder -ErrorAction:SilentlyContinue)) { | |
if (!(Add-PSSnapin -PassThru VMware.ImageBuilder)) { | |
# Error out if loading fails | |
write-host "`nFATAL ERROR: Cannot load the ImageBuilder Snapin. Is the PowerCLI installed?`n" | |
exit | |
} | |
} | |
cls | |
# Definde Global |