This file contains hidden or 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
Import-Module ADSync | |
$connector = (Get-ADSyncConnector | Where-Object {$_.Name -ilike "*AAD"}).Name | |
Get-ADSyncAADPasswordResetConfiguration -Connector $connector | |
Set-ADSyncAADPasswordResetConfiguration -Connector $connector -Enable:$false |
This file contains hidden or 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
Import-Module ADSync | |
$connector = (Get-ADSyncConnector | Where-Object {$_.Name -ilike "*AAD"}).Name | |
Get-ADSyncAADPasswordResetConfiguration -Connector $connector | |
Set-ADSyncAADPasswordResetConfiguration -Connector $connector -Enable:$true |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Get-MailboxItemsByClass.ps1 - Returns a count of mailbox items of the specified class. | |
.DESCRIPTION | |
This function will return a count of the number of items in a mailbox matching the specified class. | |
Uses EWS Managed API to perform the check | |
.EXAMPLE | |
.\Get-MailboxItemsByClass.ps1 -MailboxToSearch [email protected] -ItemStubClass IPM.Note -StoredCredentialUsername [email protected] | |
.LINK | |
https://flamingkeys.com/ |
This file contains hidden or 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
# Alert whenever the free space on disk falls below the following factor | |
# .20 = 20 % | |
# .10 = 10 % | |
$alarmThreshold = ".20" | |
$pushoverUrl = "https://api.pushover.net/1/messages.json" | |
$pushoverToken = "" | |
$pushoverUserKey = "" |
This file contains hidden or 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
function Compare-FileToHash { | |
<# | |
.SYNOPSIS | |
Compare-FileToHash - Compares a file to a given hash and returns a boolean of whether they match or not | |
.DESCRIPTION | |
This function will compare a file to a given hash (in string format) and | |
returns the boolean $true or $false depending on whether the hashes match. | |
Supported algorithms are all those supported by Get-FileHash. | |
.EXAMPLE |
This file contains hidden or 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
// Place your settings in this file to overwrite the default settings | |
{ | |
"window.zoomLevel": 1, | |
"editor.fontSize": 12, | |
"editor.formatOnType": true, | |
"editor.formatOnSave": true, | |
"editor.cursorStyle": "line", | |
"editor.cursorBlinking": "phase", | |
"editor.renderLineHighlight": "all", | |
"editor.renderIndentGuides": true, |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Copies Word Custom Document Properties from one document to another | |
.DESCRIPTION | |
Given two word documents (a source and a target), this script will copy all | |
custom document properties from the source document to the target document. | |
Document properties that already exist in the target document will remain | |
untouched. |
This file contains hidden or 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
#!/bin/bash | |
EMPTYGRANTS='{"Grants":[]}' | |
buckets=`aws s3api list-buckets --output json | jq -r '.Buckets[].Name'` | |
for bucket in $buckets; do | |
acl=`aws s3api get-bucket-acl --bucket $bucket --output json | jq -c 'del(.Owner) | .Grants |= map( select(.Grantee.URI == "http://acs.amazonaws.com/groups/global/AllUsers") )'` |
This file contains hidden or 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
#!/bin/bash | |
# Number of days old an access key is allowed to be | |
ACCESS_KEY_MAX_AGE=90 | |
# Get every user's username | |
users=`aws iam list-users | jq -r '.Users[] | .UserName'` | |
# Get the oldest Created Date that we can allow (now minus ACCESS_KEY_MAX_AGE days) | |
created_date_limit=`date -d "-$ACCESS_KEY_MAX_AGE days" +%s` |
This file contains hidden or 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
function OnlyWithValues { | |
PROCESS { | |
$properties = $_ | Get-Member | Select -ExpandProperty Name | |
$output = @{} | |
foreach ($property in $properties) { | |
if (-not ([String]::IsNullOrEmpty($_.$property))) { | |
$output[$property] = $_.$Property | |
} | |
} | |
return $output |