Last active
August 29, 2015 14:15
-
-
Save XPlantefeve/a4dec212b48ecb2f7079 to your computer and use it in GitHub Desktop.
Gets a computer to boot on PXE at next boot, clears the flag, or retrieve the information. For Dell systems with the Sysman WMI layer installed.
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
<# | |
Gets a computer to boot on PXE at next boot, clears the flag, | |
or retrieve the information. | |
Works for Dell systems with the Sysman WMI layer installed. | |
LAST UPDATED: 18/02/2015 | |
AUTHOR : Xavier Plantefève | |
#> | |
$BIOSPwd = 'My BIOS Password' | |
Function Set-PXEBoot { | |
Param( [string]$ComputerName = '.' ) | |
(Get-WmiObject -Class DCIM_BIOSService -Namespace root/dcim/sysman ` | |
-ComputerName $ComputerName).SetBIOSAttributes($null,$null,'Force PXE on Next Boot','2',$Global:BIOSPwd) | |
} | |
Function Clear-PXEBoot { | |
Param( [string]$ComputerName = '.' ) | |
(Get-WmiObject -Class DCIM_BIOSService -Namespace root/dcim/sysman ` | |
-ComputerName $ComputerName).SetBIOSAttributes($null,$null,'Force PXE on Next Boot','1',$Global:BIOSPwd) | |
} | |
Function Get-PXEBoot { | |
Param( [string]$ComputerName = '.' ) | |
$PXENextBoot = (Get-WmiObject -Class DCIM_BIOSEnumeration -Namespace root/dcim/sysman ` | |
-ComputerName $ComputerName | where { $_.InstanceID -like '*/BiosSetupPXENextBoot' }).CurrentValue | |
Switch ($PXENextBoot) { | |
(1) { $PXENextBoot = $false } | |
(2) { $PXENextBoot = $true } | |
} | |
$PXENextBoot | |
} | |
New-Alias -Name setpxe -Value "Set-PXEBoot" -Scope Global | |
New-Alias -Name resetpxe -Value "Clear-PXEBoot" -Scope Global | |
New-Alias -Name getpxe -Value "Get-PXEBoot" -Scope Global |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment