Skip to content

Instantly share code, notes, and snippets.

@blueflightx7
blueflightx7 / Export-AzServiceTagPrefixes.ps1
Created September 6, 2025 12:08
PowerShell function to export Azure Service Tag IP prefixes with flexible output options.
<#
.SYNOPSIS
Export Azure Service Tag IP prefixes to multiple formats
.DESCRIPTION
PowerShell function to export Azure Service Tag IP prefixes using the Azure REST API.
Supports CSV, JSON, and PSObject outputs with flexible filtering options.
.AUTHOR
Generated with GitHub Copilot
@blueflightx7
blueflightx7 / ADonpremise-accessreview.ps1
Created September 24, 2024 14:29
AD On-premise Access Review Powershell Script
# Define the Event IDs to retrieve
$eventIDs = @(4672, 4673, 4674, 4720, 4722, 4726, 4732, 4733, 4756, 4757, 4767, 4624, 4625, 5136)
# Define the time range for the query
$startTime = (Get-Date).AddDays(-30) # Change to the desired number of days back
$endTime = Get-Date
# Define the domain controller to query (use localhost if running on the domain controller)
$domainController = "YourDomainControllerName" # Replace with your domain controller name
@blueflightx7
blueflightx7 / TokenTimeLockERC1155.sol
Created February 10, 2024 19:19
Adapted and Updated Token Contract for Time Lock using ERC1155 as ERC1155TokenTimelock
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol";
/**
* @dev A token holder contract that allows a beneficiary to extract the
* @author https://github.com/blueflightx7
@blueflightx7
blueflightx7 / ghactionselfhostedtoken.ps1
Created August 17, 2020 03:31
Github Action Self Hosted Runner Token Retrieval
$ghuname = '' #github username PAT created under
$pat = '' #Github PAT with Correct Permission Level (ORG/Per Repo)
$org = '' #Github Org Name
$ghaccesspat = $ghuname + ':' + $pat
#base64 encode Github Login PAT
$ghtokenencoded = [Convert]::ToBase64String([char[]]$ghaccesspat)
#Create REST Header for Powershell
$headers = @{ Authorization = 'Basic {0}' -f $ghtokenencoded }
@blueflightx7
blueflightx7 / StrongAuthMSOL.ps1
Created August 28, 2019 17:36
Using MSOnline to update Strong Authentication Methods in Powershell
$st = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$st.RelyingParty = "*"
$st.State = “Disabled”
$sta = @($st)
$Sta = @()
Set-MsolUser -UserPrincipalName user@contoso.com -StrongAuthenticationRequirements $sta
$result= (Get-MsolUser -MaxResults 2000 |select -ExpandProperty StrongAuthenticationRequirements).state
@blueflightx7
blueflightx7 / DSCLCMreset.ps1
Created August 28, 2019 17:34
Desired State Configuration, Reset Local Configuration Manager
Param(
[string[]]$Computername = "chi-test02"
)
[DscLocalConfigurationManager()]
Configuration ResetLCM {
@blueflightx7
blueflightx7 / AADusergenerator.ps1
Created August 28, 2019 17:31
User Generator for Azure Active Directory (AAD). Requires to be logged in to ARM
$numusers= '100'
for ($i=1; $i -le $numusers; $i++)
{
$randomnum=get-random
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$PasswordProfile.Password = "uP@su" + $randomnum