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
Get-ADUser -Filter * -Properties * | | |
Select-Object userPrincipalName,@{N='lastLogon'; E={[Datetime]::FromFileTime($_.lastLogon)}} | | |
ConvertTo-CSV |
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
# AWS Version 4 signing example | |
# This version makes a POST request and passes request parameters | |
# in the body (payload) of the request. Auth information is passed in | |
# an Authorization header. | |
import sys, os, base64, datetime, hashlib, hmac | |
import requests # pip install requests | |
method = 'POST' | |
service = 'execute-api' |
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
// Non-jquery example from http://stackoverflow.com/questions/333634/http-head-request-in-javascript-ajax | |
/** | |
* The idea here is to poll against a route that requires authentication, | |
* in this case /session_health_check, on an interval. | |
* The important part is the header in the response. Because | |
* the current session goes with the request, polling against the endpoint | |
* can either trigger a refresh on the page which should initiate the auth | |
* flow, or you can popup a dialogue that says that you need to | |
* re-authenticate with a ?next= to send the use back to the page. |