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
$tenantId = '' ### Paste your tenant ID here | |
$appId = '' ### Paste your Application ID here | |
$appSecret = '' ### Paste your Application secret here | |
#NOTE: Build the auth response token to the Windows Security Center API (Basically establishing a logged in session) | |
$resourceAppIdUri = 'https://api.securitycenter.windows.com' | |
$oAuthUri = "https://login.windows.net/$TenantId/oauth2/token" | |
$authBody = [Ordered] @{ | |
resource = "$resourceAppIdUri" | |
client_id = "$appId" |
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
#Download the current network allow list from the internet. | |
curl https://patchmypc.com/scupcatalog/downloads/PatchMyPC-DomainList.csv -o PMPC-CurrentAllowList.csv | |
#import the data from the CSV | |
$domainList = Import-Csv -Path '.\PMPC-CurrentAllowList.csv' | |
#Import and store the scan results from the patch MY PC publisher | |
$scanResults = Import-Csv -Path '.\PatchMyPC-1_19_2023-6_23 AM.csv' | |
#Calculate the results... | |
$results = $domainList | Where-Object {$_.Product -in $scanResults.Product} | |
#Export to new CSV list. | |
$results | Export-Csv -Path .\PMPC-TrimmedNetworkList.csv -Encoding utf8 -NoTypeInformation |
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-StandardTimes { | |
<# | |
.Description | |
The Get-StandardTimes function is designed to get a bundle of standardized times from various time zones you care about. | |
To update the list of time zones you care about update the array of time zones with the results from "Get-TimeZone". | |
.EXAMPLE | |
Get-StandardTimes |
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
DeviceTvmSoftwareVulnerabilities | |
| join DeviceInfo on DeviceId, $left.DeviceId == $right.DeviceId | |
| project DeviceName,OSPlatform,OSVersion,OSArchitecture,SoftwareName,SoftwareVendor,SoftwareVersion,CveId,RecommendedSecurityUpdate,RecommendedSecurityUpdateId,LoggedOnUsers |
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
#Sometimes your ADR will fail to download content for a specific update ID, and all you have is rule engine. Sometimes SQL is too bothersome, so here is powershell | |
#To take the update ID and get the name of the udpate that is failing. | |
#GLHF | |
#Enter the site code here instead | |
$siteCode = "XYZ" | |
#Enter the CI ID | |
$ciID = "11111111" | |
Get-CimInstance -ClassName SMS_SoftwareUpdate -Namespace "root\SMS\site_$($SiteCode)" -Filter "CI_ID = $($ciID)" | Select-Object LocalizedDisplayName,DateCreated |
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
$SUGFormat = "Patch My*" | |
$updates = Get-CMSoftwareUpdateGroup -LocalizedDisplayName $SUGFormat | Select-object -ExpandProperty updates | |
New-CMSoftwareUpdateGroup -Name "Example Merged SUG" -UpdateID $updates |
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 Invoke-Spongebob { | |
[cmdletbinding()] | |
param( | |
[Parameter(HelpMessage = "provide string" , Mandatory = $true)] | |
[string]$Message | |
) | |
$charArray = $Message.ToCharArray() | |
foreach ($char in $charArray) { | |
$Var = $(Get-Random) % 2 |