woops, forgot to add EnableComputer!
This commit is contained in:
parent
d25282f2f1
commit
cc22d15bca
16
Private/EnableComputer.ps1
Normal file
16
Private/EnableComputer.ps1
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue