This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |