Skip to content

Instantly share code, notes, and snippets.

View azurekid's full-sized avatar
🎯
Focusing

Rogier Dijkman azurekid

🎯
Focusing
View GitHub Profile
@azurekid
azurekid / sas-scraper.ps1
Last active August 25, 2022 10:53
PowerShell script to scrape SAS Token properties
[CmdletBinding()]
param (
[Parameter(Mandatory = $false)]
[string]$SasUri,
[Parameter(Mandatory = $false)]
[string]$SasToken
)
Clear-Host
@azurekid
azurekid / TokenHeader.ps1
Last active May 18, 2022 21:01
TokenHeader
$authenticationHeader = @{
"Sec-Fetch-Dest" = "empty";
"Sec-Fetch-Mode" = "cors";
"accept-encoding" = "gzip, deflate, br";
"accept-language" = "en";
"x-ms-effective-locale" = "en.en-us"
"Authorization" = "Bearer <#TokenValuePlainText#>";
"Content-Type" = "application/json";
"x-ms-client-request-id" = (New-Guid).Guid;
"x-ms-session-id" = "12345678910111213141516";
@azurekid
azurekid / Get-AccessToken.ps1
Last active May 2, 2022 12:33
Create Azure Access token for Microsoft Graph
function Get-AccessToken {
<#
.Synopsis
Creates an Access token for Microsoft Graph
.DESCRIPTION
This function can be used to create an Access Token to query the Microsoft Graph API.
.PARAMETER ApplicationId [string]
Enter the Application ID
.PARAMETER ApplicationSecret [string]
Enter the Application Secret
@azurekid
azurekid / show-credentials.yml
Last active April 28, 2022 15:25
Dump DevOps pipeline credentials
pr: none
trigger: none
variables:
serviceConnection: '<NameOfYourServiceConnection>'
pool:
vmImage: 'ubuntu-latest'
stages:
[CmdletBinding()]
param (
[Parameter(Mandatory = $True)]
[guid]$UserObjectId,
[Parameter(Mandatory = $True)]
[guid]$roleDefinitionId
)
function Get-GraphToken {
@azurekid
azurekid / bing-to-teams.ps1
Last active April 16, 2020 14:03
Add Bing image to Microsoft Teams backgrounds
$TeamsPath = "$($env:appdata)\Microsoft\Teams\Backgrounds\Uploads"
$web = New-Object Net.WebClient
$webclient = New-Object System.Net.WebClient
$baseUrl = "https://www.bing.com"
$jsonUrl = "https://www.bing.com/HPImageArchive.aspx?format=js&mbl=1&idx=0&n=1&cc=auto"
if (-not(Test-Path $TeamsPath)) {
New-Item -ItemType Directory -Path $TeamsPath
}
@azurekid
azurekid / QualysAgent.json
Last active August 31, 2020 11:56
Installing Qualys Cloud Agents with ARM Template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachines": {
"type": "Array"
}
},
"resources": [
{
@azurekid
azurekid / get-extensions.ps1
Last active July 14, 2023 07:00
PowerShell script to download DevOps Extensions from the marketplace as a local file
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[string] $Publisher,
[Parameter(Mandatory = $true)]
[string] $ExtensionName,
[Parameter(Mandatory = $true)]