reformat disable-computer

This commit is contained in:
Andreas Zweili 2017-07-15 10:44:49 +02:00
parent 306e3f6d80
commit 2a0bd36b95
1 changed files with 5 additions and 2 deletions

View File

@ -14,8 +14,11 @@ function Disable-Computer
$samAccountName = Read-Host 'Please enter a computer name'
$date = Get-Date -format "yyyy-MM-dd"
Get-ADComputer -Identity $samAccountName | Disable-ADAccount
Set-ADComputer -Identity $samAccountName `
-Description "disabled by $(whoami) $date"
$description-paramters = @{'Identity'=$samAccountName;
'Description'='disabled by $(whoami) $date'}
Set-ADComputer $description-parameters
Write-Host $samAccountName ' has been disabled' -backgroundcolor green
Read-Host 'Press a key to quit'
}
Disable-Computer