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
########################## | |
## SET HP BIOS PASSWORD ## | |
########################## | |
#region SetBIOSPassword | |
Write-Output "Setting BIOS password" | |
# Check if HP BIOS Password is set | |
Try | |
{ | |
$HPBIOSClassExists = Get-CimClass -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSSettingInterface -ErrorAction Stop | |
} |
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
## Requires the Microsoft.Graph.Intune module | |
## Examples: | |
$GroupMembership = Get-DeviceGroupMembership -DeviceName "PC001" | |
$GroupMembership = Get-DeviceGroupMembership -AADDeviceId "c089201c-ad84-1234-5678-00d06dc86d8f" | |
$GroupMembership | Sort Name | Out-GridView | |
# Is device a member of a specific group | |
$GroupMembership.Name -contains "Intune - All Windows 10 Workstations" | |
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
## PowerShell function to convert a log formatted with the ConfigMgr log schema into an array of objects | |
# Parameters: | |
# - LogPath. The full path to the log file | |
# - LineCount. The number of log entries to return, starting from the BOTTOM up (ie most recent back). Default: 500. | |
function Convert-CCMLogToObjectArray { | |
Param ($LogPath,$LineCount = 500) | |
# Custom class to define a log entry | |
class LogEntry { |
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
# Converts completed download job entries from the Delivery Optimization Log into useable PS objects | |
$DOLogsOutPut = Get-DeliveryOptimizationLog | |
$CompletedDownloads = $DOLogsOutPut | Where-Object { $_.Function -Like "*::_InternalTraceDownloadCompleted" } | |
# Custom classes to contain put the parsed data into | |
class bytes { | |
[int]$File | |
[int]$CDN | |
[int]$DOINC | |
[int]$rledbat |
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
$SetupPasswordIsSet = Get-CimInstance -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSPassword -Filter "Name='Setup Password'" -ErrorAction SilentlyContinue | Select -ExpandProperty IsSet | |
$PowerOnPasswordIsSet = Get-CimInstance -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSPassword -Filter "Name='Power-On Password'" -ErrorAction SilentlyContinue | Select -ExpandProperty IsSet | |
$SecureBoot = Get-CimInstance -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSEnumeration -Filter "Name='Secure Boot'" -ErrorAction SilentlyContinue | Select -ExpandProperty CurrentValue | |
$LANWLANAutoSwitching = Get-CimInstance -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSEnumeration -Filter "Name='LAN / WLAN Auto Switching'" -ErrorAction SilentlyContinue | Select -ExpandProperty CurrentValue | |
$ThunderboltSecurityLevel = Get-CimInstance -Namespace ROOT\HP\InstrumentedBIOS -ClassName HP_BIOSEnumeration -Filter "Name='Thunderbolt Security Level'" -ErrorAction SilentlyContinue | Select -ExpandProperty CurrentValue |
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-WUErrorCode { | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true,ParameterSetName='Parameter Set 1',ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0)] | |
[string[]] | |
$ErrorCode, | |
[Parameter(Mandatory=$true,ParameterSetName='Parameter Set 2',Position=1)] | |
[switch] |
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
## Updates MEMCM configuration items with W10 supported platform rules to include the equivalent W11 rule | |
# Import ConfigMgr Module | |
Import-Module $env:SMS_ADMIN_UI_PATH.Replace('i386','ConfigurationManager.psd1') | |
$SiteCode = (Get-PSDrive -PSProvider CMSITE).Name | |
Set-Location ("$SiteCode" + ":") | |
$CMPSSuppressFastNotUsedCheck = $true | |
# Define the Windows 10 platform rules to check for | |
$W10RuleIds = @( |
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
# MEMCM database params | |
$script:dataSource = 'myMEMCMSQLserver' # MEMCM SQL server name, include instance if needed | |
$script:database = 'CM_ABC' # MEMCM database name | |
# Html CSS style | |
$Style = @" | |
<style> | |
table { | |
border-collapse: collapse; | |
font-family: sans-serif |
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
[CmdletBinding()] | |
Param( | |
[switch]$ListAllAvailable, | |
[switch]$ExcludePreview, | |
[switch]$ExcludeOutofBand | |
) | |
$ProgressPreference = 'SilentlyContinue' | |
Function Get-MyWindowsVersion { | |
[CmdletBinding()] |
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
##################### | |
## HP BIOS UPDATER ## | |
##################### | |
# Params | |
$HPIAWebUrl = "https://ftp.hp.com/pub/caps-softpaq/cmit/HPIA.html" # Static web page of the HP Image Assistant | |
$BIOSPassword = "MyPassword" | |
$script:ContainerURL = "https://mystorageaccount.blob.core.windows.net/mycontainer" # URL of your Azure blob storage container | |
$script:FolderPath = "HP_BIOS_Updates" # the subfolder to put logs into in the storage container | |
$script:SASToken = "mysastoken" # the SAS token string for the container (with write permission) |