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
<#Triggers Task Sequence based on Package ID Parameter | |
@GWBLOK | |
Once Triggered, it will wait 2 minutes, then parse the execmgr log using a function from Jeff Scripter: ConvertFrom-Log | |
Once Parsed, looks for if the Task Sequence Successfully Started and reports back (Only if the Time Stamp for Starting is After the time you run the script) | |
#> | |
[CmdletBinding()] | |
Param ( |
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
#For using in "Run Script" Node. Has Exit At end... will exit your ISE if you run in ISE. :-) | |
#Adopted from another script, so it has some Write-Hosts that don't really make sense in a CI, deal with it. | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true)] | |
$BaselineName="WaaS Pre-Assessment" | |
) | |
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
#GARYTOWN - 2019.12.19 - @GWBLOK | |
#Connect to Cache | |
$CMObject = New-Object -ComObject 'UIResource.UIResourceMgr' | |
$CMCacheObjects = $CMObject.GetCacheInfo() | |
$CacheUsedStart = $CMCacheObjects.TotalSize - $CMCacheObjects.FreeSize | |
$CacheTotalSizeStart = $CMCacheObjects.TotalSize | |
$CMCacheObjectsElements = $CMCacheObjects.GetCacheElements() | |
$CacheCountStart = $CMCacheObjectsElements.Count | |
if ($CMCacheObjects.TotalSize -lt 25600) |
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
#This will download the latest version of the HP Script Library, Install it and confirm it's installed. | |
#region: CMTraceLog Function formats logging in CMTrace style | |
function CMTraceLog { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$false)] | |
$Message, | |
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
#Detection Method for HP Client Management Script Library | |
(Get-WmiObject -Namespace 'root\cimv2\sms' -Query "SELECT ProductVersion FROM SMS_InstalledSoftware where ARPDisplayName like 'HP Client Management Script Library'").ProductVersion | |
#Detection Method for HP BIOS Version Compliance / Detection Method for HP Model Supported on Current OS | |
$HPCMSLVers = (Get-WmiObject -Namespace 'root\cimv2\sms' -Query "SELECT ProductVersion FROM SMS_InstalledSoftware where ARPDisplayName like 'HP Client Management Script Library'").ProductVersion | |
if ((Get-CimInstance -Namespace root/cimv2 -ClassName Win32_ComputerSystem).Manufacturer -like "H*"){$IsHP = $true} | |
if ($HPCMSLVers -ne $Null -and $IsHP -eq $true) | |
{ |
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
#Check if HP Bios is Current | |
[version]$BIOSVersionInstalled = Get-HPBIOSVersion | |
[version]$BIOSVersionAvailableOnline = (Get-HPBIOSUpdates -latest).Ver | |
if ($BIOSVersionInstalled -lt $BIOSVersionAvailableOnline) | |
{Write-Output "Has $($BIOSVersionInstalled), Needs: $($BIOSVersionAvailableOnline)"} | |
else {Write-Output "Compliant"} |
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
$CurrentBuild = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name 'ReleaseID' | |
$SupportedOSList = $null | |
$SupportedOSList = Get-HPDeviceDetails -oslist | Where-Object {$_.OperatingSystemRelease -eq $CurrentBuild} | |
if ($SupportedOSList -ne $null){Write-Output "Compliant"} | |
else{Write-Output "$CurrentBuild not supported by HP"} |
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
<# | |
@gwblok (GARYTOWN.COM) 2019.12.26 | |
Used to Grab Windows 10 Release Info and pull into PowerShell | |
Pulling Tables in was stolen from: https://www.leeholmes.com/blog/2015/01/05/extracting-tables-from-powershells-invoke-webrequest/ | |
#> | |
$URL = "https://winreleaseinfoprod.blob.core.windows.net/winreleaseinfoprod/en-US.html" | |
[Microsoft.PowerShell.Commands.HtmlWebResponseObject]$WinReleaseWeb = Invoke-WebRequest -Uri $URL |
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
<# GARYTOWN.COM / @gwblok | |
Custom Actions in the Setup Process | |
This script creates each of the 6 batch files, along with associated powershell files. | |
It then populates the Batch file to call the PS File | |
It then populates the PS File with the command to create a time stamp. | |
Note, assumes several task sequence variables (SMSTS_BUILD & RegistryPath) as the location to write the data to | |
Goal: Confirm when the Scripts run and compare to other logs |
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
#Reset Task Squence - When Software Center shows "Installing" but nothing is really happening. | |
function Reset-TaskSequence | |
{ | |
$OutputText = "Resetting CM Services to clear out TS - Takes about 3 minutes" | |
CMTraceLog -Message $OutputText -Type 2 -LogFile $LogFile | |
Set-Service smstsmgr -StartupType manual | |
Start-Service smstsmgr | |
start-sleep -Seconds 5 | |
if (Get-CimInstance -Namespace root/ccm -ClassName SMS_MaintenanceTaskRequests ) | |
{ |
OlderNewer