Skip to content

Instantly share code, notes, and snippets.

View Kaidja's full-sized avatar

Kaido Järvemets Kaidja

View GitHub Profile
#Add the AMA Extension - this may take a few minutes to run
$AMAExtension = @{
Name = "AMAWindows"
ExtensionType = "AzureMonitorWindowsAgent"
Publisher = "Microsoft.Azure.Monitor"
ResourceGroupName = $ResourceGroup
MachineName = $ServerName
Location = $Location
#Query AD tiering level from AD
Function Get-ADTieringLevel
{
Param(
$ServerName
)
$OU = ([adsisearcher]"(&(name=$ServerName)(objectClass=computer))").FindOne().path