Skip to content

Instantly share code, notes, and snippets.

@jebbster88
jebbster88 / waitForKeyElements.js
Created October 3, 2022 07:12 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@jebbster88
jebbster88 / activityevents.ps1
Last active January 23, 2018 11:58
get logon/off/lock events to determine activity
$events = Get-EventLog security -source microsoft-windows-security-auditing -ComputerName $computername |
where-object {
($_.instanceID -eq 4624 -and $_.replacementstrings[5] -eq $username -and $_.replacementstrings[8] -eq 2) -or #Local Logon
($_.instanceID -eq 4634 -and $_.replacementstrings[5] -eq $username -and $_.replacementstrings[8] -eq 2) -or #Local Logoff
($_.instanceID -eq 4647 -and $_.replacementstrings[1] -eq $username) -or #Local Logoff 2
($_.instanceID -eq 4778 -and $_.replacementstrings[0] -eq $username) -or #RDP Logon
($_.instanceID -eq 4779 -and $_.replacementstrings[0] -eq $username) -or #RDP Logoff
($_.instanceID -eq 4800 -and $_.replacementstrings[1] -eq $username) -or #Lock
($_.instanceID -eq 4801 -and $_.replacementstrings[1] -eq $username) #Unlock
} | select Index, TimeGenerated, InstanceID,
add-pssnapin microsoft.sharepoint.powershell
$MySiteUrl = "https://mysiteurl.domain.com"
$DomainNamePrefix = "MYDOMAIN"
$strImageFolder = "\\UNC\PATH\TO\IMAGES"
$imageDepth = 1 #Images are in subfolders off of the specified folder, but we dont want sub-sub folders
$logFile = "C:\Scripts\UploadProfilePhotos.log"
$tempImageFolder = "C:\Scripts\Temp"
@jebbster88
jebbster88 / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console