Set "Keyboard Layout" BIOS Setting to English on HP devices.
SOLUTION
A Powershell script that uses the HP_BIOSSettingInterface WMI class.
$BIOSPassword = "Your BIOS Password"
$BIOSSettingName = "Select Keyboard Layout"
$BIOSSettingValue = "English"
|
ISSUE:
Set "Keyboard Layout" BIOS Setting to English on HP devices. SOLUTION A Powershell script that uses the HP_BIOSSettingInterface WMI class. $BIOSPassword = "Your BIOS Password" $BIOSSettingName = "Select Keyboard Layout" $BIOSSettingValue = "English"
0 Comments
With the following PS Script it is possibleto get the Version Info of the latest availabe BIOS Update. When running the script directly on the hardware in question no parameter is requiered. When runing it for another hardware the Baseboard Part Number (Product) defined by the manufacturer (WMI Class: Win32_BaseBoard) from the hardware is required. function Get-BIOSUpdate { param ( [string]$Platform ) # Check if platform provided if ($Platform) { $platform = $platform.ToUpper() } else { $params = @{ ClassName = 'Win32_BaseBoard' Namespace = 'root\cimv2' } $obj = Get-CimInstance @params -ErrorAction stop $platform = $obj.Product.ToUpper() } # Get BIOS Info from HP web site $uri = [string]"$Url/{0}/{0}.xml" -f $platform $data = Invoke-WebRequest -Uri $uri [xml]$doc = [System.IO.StreamReader]::new($data.RawContentStream).ReadToEnd() $refined_doc = $doc.SelectNodes("//BIOS/Rel") | Select-Object -Property @{ Name = 'Ver'; expr = { $_.Ver.TrimStart("0") } },'Date','Bin','RB','L','DP' | Sort-Object -Property Ver -Descending $LatestBIOS = $refined_doc[0] Write-Output $LatestBIOS } Example 1: Get-BIOSUpdate
Example 2: Get-BIOSUpdate -Platform "854A" Problem:
Get the charge status in % of a battery. Solution: # Get battery info $BatteryReport = [Windows.Devices.Power.Battery]::AggregateBattery.GetReport() # Get battery full charge capacity in mWh $BatteryMaxCapacity = [convert]::ToDouble($BatteryReport.FullChargeCapacityInMilliwattHours) # Get battery remaining capacity in mWh $BatteryRemainingCapacity = [convert]::ToDouble($BatteryReport.RemainingCapacityInMilliwattHours) # Calculate the percentage of the battery charge $BatteryCharged = [int][math]::Round(($BatteryRemainingCapacity / $BatteryMaxCapacity) *100) For generating all IP addresses between Start IP Address and End IP Adress the following powershell function has been developed:
Function Get-ScanIPRange { Param ( [Parameter (Mandatory=$true)] [string] $StartScanIP, [string] $EndScanIP ) $ScanIPRange = @() if (-not([string]::IsNullOrEmpty($EndScanIP))) { $StartIP = $StartScanIP -split '\.' [Array]::Reverse($StartIP) $StartIP = ([System.Net.IPAddress]($StartIP -join '.')).Address $EndIP = $EndScanIP -split '\.' [Array]::Reverse($EndIP) $EndIP = ([System.Net.IPAddress]($EndIP -join '.')).Address For ($x=$StartIP; $x -le $EndIP; $x++) { $IP = [System.Net.IPAddress]$x -split '\.' [Array]::Reverse($IP) $ScanIPRange += $IP -join '.' } } else { $ScanIPRange += $StartScanIP } Return $ScanIPRange } Sometime it is required to popup a message to either inform or ask user. Here is a simple PowerShell function created for this purpose. The function has the following parameters:
- PopUpButtons: Set buttons that will be displayed on the popup window. Default value set to show only the OK button - PopUpIcon: Set Icon used for the popup window. Default value set to use the Information icon. - PopUpTime: Set timeout for the popup window. After the specified time is expired the popup window will be closed automaticaly. Default set to unlimited. - PopUpTitel: Set title of the popup window. - PopUpMessage: Set message to show on the popup window. Return value depend on the button clicked or is -1 if the message box timed out. The possible values are: OK button clicked: 1 Cancel button clicked: 2 Abort button clicked: 3 Retry button clicked: 4 Ignore button clicked: 5 Yes button clicked: 6 No button clicked: 7 Try Again button clicked: 10 Continue button clicked: 11 Issue: Develop a Powershell script that customizes an Excel file on a computer (in my case Windows Server). On the computer there is no Excel (Office) installed.
Solution: Use the ImportExcel Powershell module from PSGallery. In order to install the module run the following command: Find-Module -Name ImportExcel | Install-Module You can also have the module without installing it. Simple copy the module installation folder from a computer on which the module already have been installed (e.g. C:\Program Files\WindowsPowerShell\Modules\ImportExcel\7.0.1). Today I have to check the reboot client settings on a SCCM client without having access to the SCCM admin console. The client reboot settings (in seconds) are saved under RebootCountdown and ReebotCountdownFinalWindows properties of the WMI Class CCM_RebootSettings. With the following PowerShell command these properties have been read:
Get-WmiObject -Namespace root\ccm\Policy\Machine\ActualConfig -Class CCM_RebootSettings When using Microsoft System Center Configuration Manager for patch management there is no built-in option to unistall an update that causes probleme when testing. With the new Run Scripts feature in Configuration Manager 1802 you could create a script to rollback an installed update. If there is a problem with an update the script has to be just run against the affected computer or the collection of the affected computers.
With the following powershell script it is possible to "integrate" the rollback feature in the SCCM admin console: When migrating an SCCM Server to a new server or when updating the ADK on the SCCM server often we end up with old boot images that not only they cannot be customized via SCCM administration console any more but also the information regarding the integrated drivers is not more available. To resolve this issue the following powershell script has been developed. The script should be first rune before ADK Update / SCCM migration so that the information of the imported boot image drivers is exported for each boot image into an xml file named "ExportBootDrivers_[Boot Image Name].xml" in c:\temp folder. After the ADK update /SCCM migration the script should be run one more time in ordert to import the required drivers into the new boot images that have the same name as the old one.
For testing the Azure AD/Office 365 user synchronization a test AD Domain was created. The test was successful and when finished the test AD was deleted without to delete the test users first ( and let the AAD-Synchronization to take care of deleting the teste users in AAD). A few days later we tried to delete the test users by using the Office 365's Admin Center and we were greeted with a message letting us know that it was not possible. In order to get rid of the test user accounts the following had to be done:
|
Author
Write something about yourself. No need to be fancy, just an overview. Archives
November 2022
Categories
All
|