Skip to content

Instantly share code, notes, and snippets.

View RippieUK's full-sized avatar

Ronnie Jorgensen RippieUK

View GitHub Profile
@RippieUK
RippieUK / Find-Uptime.ps1
Created January 17, 2020 13:13
Finding up time from remote computers - compatible with PS2
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
## 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\"
@RippieUK
RippieUK / Test-Gist.ps1
Created September 19, 2019 15:59
Test Gist
```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.'
}
```