Skip to content

Instantly share code, notes, and snippets.

View hsmalley's full-sized avatar
🚀
🐐 💨 🍰

Hugh Smalley hsmalley

🚀
🐐 💨 🍰
View GitHub Profile
@hsmalley
hsmalley / PasswordExpiryReport.ps1
Created October 4, 2012 12:18 — forked from theagreeablecow/PasswordExpiryReport.ps1
Password Expiry Email Report
<#
.SYNOPSIS
Reports on Users whose passwords are about to expire
.NOTES
Requires Quest.ActiveRoles.ADManagementsnapin to get the AD attributes.
.LINK
http://www.theagreeablecow.com/2012/06/preventing-password-expirations-with.html
#>
# --------------------------------------------------
@hsmalley
hsmalley / Deploy-Files.ps1
Created October 4, 2012 17:54
I needed to deploy some DLLs to patch a program. This will copy files to a computer and log it in excel. The logging is the only weak link in this script because it uses the credentials of what ever user is running the script. I even included a backout fu
# Get User/Pass
$Cred = Get-Credential
# Add Quest CMDLETS
Add-PSSnapin Quest.ActiveRoles.ADManagement -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
# Get Computer's from AD
$Computers = Get-QADComputer -SearchRoot "OU=Workstations,DC=Domain,DC=com" -Credential $Cred
# Import BITS for the file transfers
Import-Module BitsTransfer
# Let's Copy the files!
@hsmalley
hsmalley / Get-IniContent.ps1
Created October 4, 2012 20:53
Powershell to/from INI Files
function Get-IniContent ($filePath)
{
$ini = @{}
switch -regex -file $FilePath
{
"^\[(.+)\]" # Section
{
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0
@hsmalley
hsmalley / DropboxRemoval.cmd
Last active August 29, 2015 14:00
Detects and Removes Dropbox
@ECHO OFF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: SETUP DATE FOR LOGGING ERRORS
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:SETUPDATE
FOR /F "TOKENS=2,3,4 DELIMS=-/.: " %%F IN ("%DATE%") DO SET FORMATTED_DATE=%%F-%%G-%%H
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dropbox Detection & Removal
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:DROPBOX

Keybase proof

I hereby claim:

  • I am hsmalley on github.
  • I am hsmalley (https://keybase.io/hsmalley) on keybase.
  • I have a public key ASCE9BTprgV-epjXocQ2-mkUSlSbT99hOAnGB7-F0KQe1go

To claim this, I am signing this object:

@hsmalley
hsmalley / enphase_envoy_token.py
Created April 27, 2023 20:33
Get the token for local logins
"""Module to read production and consumption values from an Enphase Envoy on the local network."""
"""https://support.enphase.com/s/question/0D53m00007a2WcDCAU/instructions-to-get-access-token"""
import asyncio
import logging
import re
import time
import jwt
from html.parser import HTMLParser
from json.decoder import JSONDecodeError