reformat disable-computer
This commit is contained in:
parent
306e3f6d80
commit
2a0bd36b95
|
@ -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
|
||||
|
|
Reference in New Issue