pretefy the outputs of the various commands

This commit is contained in:
Andreas Zweili 2017-07-15 12:18:07 +02:00
parent 4a3a12d4d9
commit 2014e55817
5 changed files with 15 additions and 3 deletions

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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
{