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
# Parameters | |
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] $ResourceGroupName, | |
[Parameter()] | |
[string] $OsName = "linux" | |
) | |
# Get all Azure Arc enabled servers in the resource group |
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
# A PowerShell script using the Az PowerShell module to remove a specific extension WindowsPatchExtension from all Azure Arc enabled machines in a specific resource group. | |
# The script will remove the extension from all machines in the resource group, regardless of the extension status. | |
# Parameters | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] $ResourceGroupName, | |
[Parameter()] | |
[string] $ExtensionName = "WindowsPatchExtension" |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string]$TargetSubscriptionId, | |
[Parameter(Mandatory)] | |
[string]$TargetResourceGroup, | |
[Parameter(Mandatory)] | |
[string]$DeploymentLocation | |
) | |
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
let startTime = ago(30d); | |
WVDConnections | |
| where TimeGenerated > startTime | |
| summarize min(TimeGenerated), max(TimeGenerated) by UserName, ClientOS, ClientType, ClientVersion | |
| sort by UserName, min_TimeGenerated |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "p:user_host-back", | |
"foreground": "p:white", | |
"leading_diamond": "", |
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
[CmdletBinding(SupportsShouldProcess = $True)] | |
Param( | |
[Parameter(Mandatory, Position = 1)] | |
[string]$ModuleName, | |
[Parameter(Position = 2)] | |
[bool]$DeleteChildModules = $true | |
) | |
$Latest = Get-InstalledModule $ModuleName -ErrorAction Ignore; | |
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
$deleteUnattachedNICs = $false | |
# List all unattached NICs | |
$unattachedNICs = Get-AzNetworkInterface | ` | |
Where-Object { $_.VirtualMachine -eq $null -and ($_.PrivateEndpointText -eq $null -or $_.PrivateEndpointText -eq 'null') } | |
# Iterate over the unattached NICs | |
foreach ($nic in $unattachedNICs) { | |
# Find a lock for the NIC (or resource group/subscription/...) | |
$lock = Get-AzResourceLock -ResourceName $nic.Name -ResourceGroupName $nic.ResourceGroupName -ResourceType 'Microsoft.Network/networkInterfaces' |
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
# From https://aztoso.com/security/microsoft-graph-permissions-managed-identity/ | |
# Your tenant id (in Azure Portal, under Azure Active Directory -> Overview ) | |
$TenantID = "" | |
# Microsoft Graph App ID (DON'T CHANGE) | |
$GraphAppId = "00000003-0000-0000-c000-000000000000" | |
# Name of the system managed identity (same as the Logic App name) | |
$DisplayNameOfMSI = "demoLogicApp" | |
# Check the Microsoft Graph documentation for the permission you need for the operation | |
$PermissionName = "Domain.Read.All" |
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
$contents = "Virtual" | |
$sql = "SELECT System.ItemName, System.ItemUrl FROM SYSTEMINDEX WHERE Contains(*,'$($contents)') AND System.ItemType='.VSSX'" | |
$Provider = "Provider=Search.CollatorDSO;Extended Properties=’Application=Windows’;" | |
$adapter = new-object system.data.oledb.oleDBDataadapter -argument $sql, $Provider | |
$ds = new-object system.data.dataset | |
if ($adapter.Fill($ds)) { $ds.Tables[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
#!/usr/bin/python3 | |
# Simple Python script designed to write to the local Syslog file in CEF format on an Azure Ubuntu 18.04 VM. | |
# Frank Cardinale, April 2020 | |
# Sven Aelterman, September 2021 | |
# Importing the libraries used in the script | |
import random | |
import syslog | |
import time |
NewerOlder