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
<# | |
.SYNOPSIS | |
Sends detailed reports on Azure Users, Groups, and Roles via email. | |
.DESCRIPTION | |
This PowerShell script generates a report on Azure subscription user roles, groups, and their memberships, and then emails this report as an attachment. It logs into Azure | |
using a managed identity, fetches role assignments for given subscriptions, compiles them into a report, and mails this report to specified recipients. The script uses | |
the .NET Mail API for secure email transmission. | |
.PARAMETER EmailUsername |
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
# ============================================================================ | |
# Name: Run command on Azure Arc machine | |
# ============================================================================ | |
# Author: Blake Drumm ([email protected]) | |
# Website: https://blakedrumm.com/ | |
# Date created: April 4th, 2024 | |
# ============================================================================ | |
$AzureRmContext = Connect-AzAccount |
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
# Author: Blake Drumm ([email protected]) | |
# Date Created: March 27th, 2024 | |
# Website: https://blakedrumm.com/ | |
# Define the HTML content or URL | |
$url = "https://www.catalog.update.microsoft.com/Search.aspx?q=System+Center+2019+-+Operations+Manager" | |
try { | |
# Get the HTML content of the webpage | |
$htmlContent = Invoke-WebRequest -Uri $url |
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
param | |
( | |
[Parameter(Mandatory = $true)] | |
[String[]]$SubscriptionIds, | |
[Parameter(Mandatory = $true)] | |
[String]$TagName, | |
[Parameter(Mandatory = $true)] | |
[String]$TagValue, | |
[Parameter(Mandatory = $true)] | |
[Boolean]$PowerState, # true for start, false for 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
# Author: Blake Drumm ([email protected]) | |
# Created: March 26th, 2024 | |
# Retrieve PSModulePath | |
$modulePaths = $env:PSModulePath -split ';' | |
# Retrieve all installed modules | |
$installedModules = Get-Module -ListAvailable | |
if ($installedModules) { |
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
/* | |
Author: Blake Drumm ([email protected]) | |
Date Created: February 27th, 2024 | |
Description: | |
Azure Resource Graph query for enhanced inventory management of microsoft.hybridcompute/machines, | |
detailing essential attributes such as display names, operating system versions with friendly names for Windows 11, | |
Windows 10, and various Windows Server releases, agent version, automatic upgrade capability, provisioning state, | |
and ESU license status. By using regular expressions for accurate OS version categorization, it offers administrators | |
and support teams a powerful tool for comprehensive oversight and management of hybrid computing environments, | |
facilitating effective upgrade planning, compliance monitoring, and support tasks. |
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
<# | |
Author: Blake Drumm ([email protected]) | |
Date Created: February 27th, 2024 | |
Description: | |
This PowerShell script automates the extraction of key details like title, version, release date, and URL for Microsoft downloads based on provided IDs. | |
By utilizing web scraping methods, it facilitates the seamless retrieval and organization of essential information from Microsoft's download pages. | |
#> | |
$FinalOutput = @() | |
$x = 0 |
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 CheckSSL($fqdn, $port=443, $tls="tls12") | |
{ | |
Try {$tcpsocket = New-Object Net.Sockets.TcpClient($fqdn, $port)} Catch {Write-Warning "$($_.Exception.Message) / $fqdn";break} | |
$certCollection = New-Object System.Security.Cryptography.X509Certificates.X509CertificateCollection | |
$sslProtocols = [System.Security.Authentication.SslProtocols]::$tls | |
""; "-- Target: $fqdn / " + $tcpsocket.Client.RemoteEndPoint.Address.IPAddressToString | |
$sslStream = New-Object System.Net.Security.SslStream($tcpsocket.GetStream(), $false) | |
$sslStream.AuthenticateAsClient($fqdn, $certCollection, $sslProtocols, $true) ## A Boolean value that specifies whether the certificate revocation list is checked during authentication | |
$certinfo = New-Object security.cryptography.x509certificates.x509certificate2($sslStream.RemoteCertificate) | |
$sslStream | select-object | FT sslProtocol,CipherAlgorithm, HashAlgorithm,KeyExchangeAlgorithm,IsAuthenticated,IsEncrypted,IsSigned, CheckCertRevocationStatus |
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
# ============================================================================ | |
# Name: VM Management Role and Update Compliance Policy Setup Script | |
# ------------------------------------------------------------------ | |
# Description: This PowerShell script automates the creation or updating of a custom Azure role and policy definition | |
# for managing virtual machine (VM) security and compliance. It ensures VMs within specified subscriptions are managed | |
# with enhanced permissions, including disk encryption set reading, and comply with system update policies. If the | |
# targeted custom role does not exist, it creates one by extending the "Virtual Machine Contributor" role. It then | |
# duplicates a built-in Azure policy for system update assessments, integrating the custom role to enforce update | |
# compliance. Designed for Azure administrators, this script streamlines VM management, security, and compliance | |
# within Azure environments. |
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
#Author: Blake Drumm | |
#Date: August 7th, 2023 | |
#----------------------------------------------- | |
# REQUIRED | |
#----------------------------------------------- | |
# Prefil the XPlexToken before running the script | |
$XPlexToken = 'GZZ4qopzCuczOKW9qIPX' | |
#----------------------------------------------- |