Created
April 16, 2020 15:49
-
-
Save DavoudTeimouri/4186c2df0da8cfc28105ef27ef298c51 to your computer and use it in GitHub Desktop.
Configure HPE G10 Server BIOS via PowerShell
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
| $Servers= "iLO IP1","iLO IP2" | |
| $Credential=Get-Credential | |
| ForEach ($Server in $Servers) | |
| { | |
| $BIOSConnection= Connect-HPEBIOS -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
| $iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
| Start-Sleep -s 30 | |
| #Restore Defaults | |
| Reset-HPEBIOSUserDefault -Connection $BIOSConnection -RestoreDefault | |
| Start-Sleep -s 30 | |
| $HostPower= Get-HPEiLoServerPower -Connection $iLOConnection | |
| If ($HostPower.Power -eq "Off") | |
| { | |
| Set-HPEiLoServerPower -Connection $iLOConnection -Power on | |
| } | |
| Else | |
| { | |
| Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false | |
| } | |
| Disconnect-HPEiLO -Connection $iLOConnection | |
| Disconnect-HPEBIOS -Connection $BIOSConnection | |
| } | |
| Start-Sleep -s 900 | |
| ForEach ($Server in $Servers) | |
| { | |
| $BIOSConnection= Connect-HPEBIOS -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
| $iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
| #Workload Profile | |
| Set-HPEBIOSWorkloadProfile -Connection $BIOSConnection -WorkloadProfile Custom | |
| #Server Availability | |
| Set-HPEBIOSServerAvailability -Connection $BIOSConnection -PowerButton Disabled -PowerOnDelay 60Second | |
| #Processor Options | |
| Set-HPEBIOSProcessorOption -Connection $BIOSConnection -IntelHyperthreading Enabled -ProcessorX2ApicSupport Disabled | |
| #Memory Options | |
| Set-HPEBIOSAdvancedMemoryProtection -Connection $BIOSConnection -AdvancedMemoryProtection AdvancedECCSupport | |
| Set-HPEBIOSMemoryConfiguration -Connection $BIOSConnection -MemoryRefreshRate Refreshx1 -MemoryPatrolScrubbing Disabled | |
| #Virtualization Options | |
| Set-HPEBIOSVirtualization -Connection $BIOSConnection -CPUVirtualization Disabled -Intel_VT_d2 Disabled -SR_IOV Disabled | |
| #Boot Options | |
| Set-HPEBIOSBootMode -Connection $BIOSConnection -BootMode UEFIMode | |
| #Power and Performance Options | |
| Set-HPEBIOSAdvancedPerformanceTuningOption -Connection $BIOSConnection -ProcessorJitterControl Disabled -ProcessorJitterControlOptimization ZeroLatency -EnergyEfficientTurbo Disabled -UncoreFrequencyScaling Maximum -NUMAGroupSizeOptimization Clustered -SubNUMAClustering Disabled | |
| Set-HPEBIOSPowerRegulator -Connection $BIOSConnection -PowerRegulator OSControlMode | |
| Set-HPEBIOSProcessorPower -Connection $BIOSConnection -MinimumProcessorIdlePowerCoreState C1EState -MinimumProcessorIdlePowerPackageState PackageC3State -EnergyPerformanceBias MaximumPerformance -CollaborativePowerControl Disabled -IntelDMILinkFrequency Auto | |
| Set-HPEBIOSIntelTurboBoost -Connection $BIOSConnection -IntelTurboBoost Disabled | |
| Set-HPEBIOSPrefetcher -Connection $BIOSConnection -HWPrefetcher Enabled -AdjacentSectorPrefetch Enabled -DCUStreamerPrefetcher Enabled -DCUIPPrefetcher Enabled -LLCPrefetcher Disabled -XPTPrefetcher Auto | |
| Set-HPEBIOSUPILinkPower -Connection $BIOSConnection -IntelUPILinkPowerManagement Disabled | |
| $HostPower= Get-HPEiLoServerPower -Connection $iLOConnection | |
| If ($HostPower.Power -eq "Off") | |
| { | |
| Set-HPEiLoServerPower -Connection $iLOConnection -Power on | |
| } | |
| Else | |
| { | |
| Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false | |
| } | |
| Disconnect-HPEiLO -Connection $iLOConnection | |
| Disconnect-HPEBIOS -Connection $BIOSConnection | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment