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