This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Find-Uptime { | |
<# | |
.SYNOPSIS | |
Find uptime of remote computer | |
.Description | |
Find uptime of remote computer | |
.EXAPLE | |
Get-ADComputer -Identity uppsrvadmin | Select-Object * | Find-Uptime -Credential (Get-Credential) | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Copied and cleaned up the script from https://gallery.technet.microsoft.com/Clear-Exchange-2013-Log-71abba44 | |
## Tested on Exchange 2016 | |
$executionPolicy = Get-ExecutionPolicy | |
if ($executionPolicy -ne 'RemoteSigned') { | |
Set-Executionpolicy RemoteSigned -Force | |
} | |
$days = 7 | |
$IISLogPath = "C:\inetpub\logs\LogFiles\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```powershell | |
$procs = Get-Process | |
if ($procs.count -gt 20) { | |
Write-Output 'Wow! thats a lot of processes.' | |
} | |
else { | |
Write-Output 'Oops, running a bit low.' | |
} | |
``` |