woops, forgot to add EnableComputer!

This commit is contained in:
Zachary Gorman 2024-10-25 15:05:21 -07:00
parent d25282f2f1
commit cc22d15bca

View file

@ -0,0 +1,16 @@
function Invoke-EnableComputer ($comp) {
$site = switch -Regex ($comp) {
'^A' {'SAGH'}
'^L' {'SLCH'}
'^S' {'SNLH'}
'^P' {'SPCH'}
'^G(AV|CN|WN)' {'Avery'}
default {'GSRMC'}
}
$comp | Get-ADComputer | Enable-ADAccount -PassThru | Move-ADObject -TargetPath "OU=$site,OU=Samaritan Workstations,DC=int,DC=samhealth,DC=net"
if (Get-ADUser -Filter "Name -like 'K_$comp'") {
Write-Host -ForegroundColor Yellow "Kiosk account found. Please re-submit a kiosk request and re-kiosk $comp."
} else {
Add-ADGroupMember -Identity 'SSO Workstations' -Members (Get-ADComputer $comp)
}
}