Skip to content

Instantly share code, notes, and snippets.

View bevinduplessis's full-sized avatar

Bevin Du Plessis bevinduplessis

View GitHub Profile
@bevinduplessis
bevinduplessis / PS-ResetWUMU.ps1
Created February 5, 2021 22:59 — forked from livkx/PS-ResetWUMU.ps1
Reset WUMU config, cache, certs. Then, run a scan and try check in with WSUS.
#Name: PS-ResetWUMU.ps1
#Author: github.com/livkx
#Decription: Reset WUMU config, cache, certs. Then, run a scan and try check in with WSUS.
#Version: 1.0
#Declare the functions we're going to use in the main function.
Function ServiceControlAndWait{ #Function stops the Windows Update related services.
param([Parameter(Position = 0)] [String[]] $Services, [String] $MaxWait, [String] $Action)
ForEach($Service in $Services){
@bevinduplessis
bevinduplessis / Ping.ps1
Last active May 4, 2017 10:06
Powershell Ping Class
class Ping
{
# Property
[array] $Results
[array] $Online
[array] $Offline
$ExecutionTime
$TotalComputers
$OnlineCount
$OnlinePercent
[ONLINE]
;DataCenterHint =>
; default 'ping based'
; eus 'us east'
; cus 'us central'
; scus 'us south central'
; wus 'us west'
; sbr 'brazil south'
; neu 'europe north'
@bevinduplessis
bevinduplessis / Get-ServiceUsers.ps1
Created January 17, 2017 09:34
Get a list of unique usernames being used to run services on a computer
Function Get-ServiceUsers
{
<#
.Synopsis
Get a list of unique usernames being used to run services on a computer.
.DESCRIPTION
Get a list of unique user's being used to run services on one or more computers.
.PARAMETER ComputerName
public static string NumberToCurrencyText(decimal number, MidpointRounding midpointRounding)
{
// Round the value just in case the decimal value is longer than two digits
number = decimal.Round(number, 2, midpointRounding);
string wordNumber = string.Empty;
// Divide the number into the whole and fractional part strings
string[] arrNumber = number.ToString().Split('.');
<#
.SYNOPSIS
Backup-CiscoConfig.ps1 SSHs to a Cisco device and backs up the running configuration to a TFTP server.. Utilizes the Posh-SSH module.
.DESCRIPTION
This script is not possible without darkoperator's Posh-SSH module. Thanks!
To do: Parameterize the device list. 10/05/16
Grab the output of long commands by setting the terminal length to 0 to disable pagination. "term len 0"
Log commands entered on the Cisco device to ensure they're running:
<#
.SYNOPSIS
An MTR clone for PowerShell.
Written by Tyler Applebaum.
Version 2.0
.LINK
https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2
http://www.team-cymru.org/IP-ASN-mapping.html#dns
@bevinduplessis
bevinduplessis / send-whatsapp.ps1
Created December 7, 2016 07:04 — forked from whatsmate/send-whatsapp.ps1
Sending a WhatsApp message from a Powershell script
$number = "12025550108"
$message = "Howdy, this is a message from PowerShell."
$clientId = "FREE_TRIAL_ACCOUNT" # No need to change
$clientSecret = "PUBLIC_SECRET" # No need to change
$jsonObj = @{'number'=$number;
'message'=$message;}
Try {