From 33802d0aa19e891e28fc1f31ac030b2dafc757e4 Mon Sep 17 00:00:00 2001 From: cortex-sa <98156827+cortex-sa@users.noreply.github.com> Date: Mon, 26 Jan 2026 11:35:02 +0000 Subject: [PATCH] Removed the Get-ADUser --- Grafana/Alloy/Scripts/Install-Alloy.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Grafana/Alloy/Scripts/Install-Alloy.psm1 b/Grafana/Alloy/Scripts/Install-Alloy.psm1 index 30aaae2..ed27d4b 100644 --- a/Grafana/Alloy/Scripts/Install-Alloy.psm1 +++ b/Grafana/Alloy/Scripts/Install-Alloy.psm1 @@ -333,8 +333,7 @@ function Set-LocalSecurityPolicy { process { Write-Output "Verifying Local Security Policy for $Username" - $FQDN = (Get-ADDomainController -Discover -DomainName $Username.substring(0, $Username.IndexOf("\"))).Domain - $UserSID = (Get-ADUser -ErrorAction Stop -Server "$FQDN" -Identity $Username.substring($Username.IndexOf("\") + 1)).SID + $UserSID = (New-Object System.Security.Principal.NTAccount($Username.substring($Username.IndexOf("\") + 1))).Translate([System.Security.Principal.SecurityIdentifier]).Value $secEditConfigurationExport = Export-LocalSecurityPolicy