Skip to content

Instantly share code, notes, and snippets.

View Pome-ro's full-sized avatar
🐲
Roll for Initiative!

Tom Pomeroy Pome-ro

🐲
Roll for Initiative!
View GitHub Profile
@Pome-ro
Pome-ro / Script_Template.ps1
Created March 28, 2016 16:09 — forked from 9to5IT/Script_Template.ps1
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@Pome-ro
Pome-ro / find-ccleanermalware.ps1
Last active September 18, 2017 22:11
Find if computers on your network have the CCleaner Malware.
# Finds Regkey for CCleaner Malware in v5.33. 2017-09-18
# Read More Here: http://blog.talosintelligence.com/2017/09/avast-distributes-malware.html
$Computers = Get-AdComputer -filter #Put your filter here.
$cred = Get-Credential
$logpath = $env:USERPROFILE+"\desktop\ccleaner-malware.csv"
foreach ($Computer in $Computers) {
if($(Test-NetConnection $computer.name).PingSucceeded){
$WinRM = Get-Service -Name WinRM -ComputerName $computer.name
if ($i -eq $null) {$i = 8080}
$i++
$Colors = @{
BackgroundColor = "#12A5EC"
FontColor = "#FFFFFFFF"
}
$Data = @();
$Data += [PSCustomObject]@{"DataName" = "DataSet 1"; "Dogs" = 54; "Cats" = 23; "Birds" = 12}
# Com Object for making SNMP calls
$SNMP = new-object -ComObject olePrn.OleSNMP
# Printer objects from our print server
$All_Printers = get-printer -ComputerName $Config.PrintServer
# Array of printers to output, which will contain toner data, and some data from our print server.
$Printers = New-Object System.Collections.ArrayList
@Pome-ro
Pome-ro / New-Blogpost.ps1
Last active November 20, 2017 04:29
Script to generate a new blog post for your github pages jekyll site.
[CmdletBinding()]
param (
# Name
[Parameter(Mandatory)]
[string]
$Name,
# Date
[Parameter()]
[String]
$Date = (Get-Date -Format yyyy-M-d),
@Pome-ro
Pome-ro / Send-GHCWebhookMessage.ps1
Created March 7, 2018 02:31
Send-GHCWebhookMessage - Used for sending Text only messages to a Google Hangouts Chat Room Webhook.
function Send-GHCWebhookMessage {
[CmdletBinding()]
param (
# uri
[Parameter(Mandatory)]
[string]
$URI,
# Message
[Parameter(Mandatory)]
[string]
@Pome-ro
Pome-ro / Test-DC.ps1
Created December 10, 2018 21:29
Test the Difficulty Class of a given trap/event/skill in D&D
function Test-DC {
param (
# Parameter help description
[Parameter()]
[int]
$DC,
[Parameter()]
[int]
$Bonus,
[Parameter()]
@Pome-ro
Pome-ro / Remove-ADUserFromGroup.ps1
Created April 19, 2021 15:19
Remove User from Group shell menu
function Remove-ADUserFromGroup {
[CmdletBinding()]
param (
[Parameter(mandatory)]
[string]
$identity,
[Parameter(mandatory)]
[string]
$credential
)
<#
The CSV should have a list of serialnumbers
#>
$CSV = "~\Desktop\devices.csv"
$Devices = Import-Csv $CSV
$OU = ""
foreach ($SerialNumber in $Devices) {
Write-Host "Modifying " $Item "to $OU" -ForegroundColor Green
Function Remove-Symbols {
param(
[string]
$string
)
[regex]$reg = "[^\p{L}\p{Nd}]"
return $string -replace $reg
}