pretefy the outputs of the various commands
This commit is contained in:
parent
4a3a12d4d9
commit
2014e55817
|
@ -41,7 +41,7 @@ do
|
|||
} '3' {
|
||||
cls
|
||||
start powershell `
|
||||
-ArgumentList '-noexit .\scripts\users\get-lockout-location.ps1'
|
||||
-ArgumentList '.\scripts\users\get-lockout-location.ps1'
|
||||
} '4' {
|
||||
cls
|
||||
.\scripts\computers\disable-computer.ps1
|
||||
|
@ -56,6 +56,5 @@ do
|
|||
return
|
||||
}
|
||||
}
|
||||
sleep 1
|
||||
}
|
||||
until ($input -eq 'q')
|
||||
|
|
|
@ -17,8 +17,10 @@ function Disable-Computer
|
|||
$description-paramters = @{'Identity'=$samAccountName;
|
||||
'Description'='disabled by $(whoami) $date'}
|
||||
Set-ADComputer $description-parameters
|
||||
Write-Host
|
||||
Write-Host $samAccountName ' has been disabled' -backgroundcolor green
|
||||
Read-Host 'Press a key to quit'
|
||||
Write-Host
|
||||
Read-Host 'Press a key to continue'
|
||||
}
|
||||
|
||||
Disable-Computer
|
||||
|
|
|
@ -3,6 +3,10 @@ function Remove-Public-Desktop-Icons
|
|||
$computername = Read-Host 'Enter the name of the computer'
|
||||
Remove-Item \\$computername\c$\users\public\desktop\*.lnk `
|
||||
-Exclude "SAP Logon Pad.lnk"
|
||||
Write-Host
|
||||
Write-Host 'Desktop icons removed' -backgroundcolor green
|
||||
Write-Host
|
||||
Read-Host 'Press a key to continue'
|
||||
}
|
||||
|
||||
Remove-Public-Desktop-Icons
|
||||
|
|
|
@ -19,5 +19,10 @@ function Reset-Password
|
|||
ConvertTo-SecureString -AsPlainText $default_password -Force
|
||||
)
|
||||
Set-ADuser $username -ChangePasswordAtLogon $True
|
||||
Write-Host
|
||||
Write-Host 'Password of ' $username 'reset to ' $default_password `
|
||||
-backgroundcolor green
|
||||
Write-Host
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ function Unlock-Account
|
|||
Try
|
||||
{
|
||||
Unlock-ADAccount -Identity $username -ErrorAction Stop
|
||||
Write-Host
|
||||
Write-Host $username ' unlocked' -backgroundcolor green
|
||||
Write-Host
|
||||
}
|
||||
Catch
|
||||
{
|
||||
|
|
Reference in New Issue