Skip to content

Instantly share code, notes, and snippets.

View austinsonger's full-sized avatar
🙃
Localhost

Austin Songer, CISSP austinsonger

🙃
Localhost
View GitHub Profile
@JacobErnst98
JacobErnst98 / Reset-password.ps1
Created March 2, 2020 15:55
Reset a local ad password from the rest value given in office 365, for environments not running azure ad sync
Connect-MsolService
$people = "<sam1>,<sam2>"
$domain = "<@website.com>"
foreach($person in $people){
$tmpPass = Set-MsolUserPassword -UserPrincipalName $($person + $domain)
Set-ADAccountPassword -Identity $person -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $tmpPass -Force)
Add-ADGroupMember -Identity "E2" -Members $person
Write-Host $person "---Password---" $tmpPass
}
#Depending if you are already connected execute this first part
Connect-AzureAD
#Get the Service Principal that was created when you created a Managed Identity from your Web App
$MyMI = Get-AzureADServicePrincipal -ObjectId <ID(GUID) of your managed identity shown in the Azure portal>
#Get the Office 365 SharePoint Online API
$SharePointAPI = Get-AzureADServicePrincipal -SearchString “Office 365 SharePoint”
#Select the User.ReadWrite.All App-Only Permissions. If you want another App-Only permission then search for another value
@webmat
webmat / README.md
Last active December 18, 2023 07:10
Understanding Filebeat modules

Filebeat modules are all either open source, or provided via the Elastic License. You can look at them all, to understand how the parsing, the conversion and the mapping to ECS are done.

Looking for the modules

Looking at the code of the pipelines

@glides
glides / Geo_IP_Audit_O365.ps1
Created February 4, 2020 09:14
Find all out of country logins Office 365 Unified Audit Log
########## Connect to o365 ##########
## Change $username and $pass to match your environment
## See: https://blogs.technet.microsoft.com/robcost/2008/05/01/powershell-tip-storing-and-using-password-credentials/ for how to create a cred file.
$username = "[email protected]"
$pass = gc "F:\PSScripts\Office365-PowershellCreds.txt" | convertto-securestring
$creds = New-Object -typename System.Management.Automation.PSCredential `
-argumentlist $username, $pass
$MESession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Creds -Authentication Basic -AllowRedirection
Import-PSSession $MESession -AllowClobber
Connect-MsolService -Credential $creds
@glides
glides / o365_enable_user_logging.ps1
Last active May 4, 2021 19:01
Enabled logging for all o365 users.
## There are oneliners that try to enable logging for all users but in a large environment you will run into a data cap for the session - that is why this is split up using a foreach loop
$mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox" -or RecipientTypeDetails -eq "SharedMailbox" -or RecipientTypeDetails -eq "RoomMailbox" -or RecipientTypeDetails -eq "DiscoveryMailbox"}
foreach($m in $mailboxes) {
Set-Mailbox $m.Identity.ToString() -AuditEnabled $true -AuditLogAgeLimit 180 -AuditOwner Create,HardDelete,MailboxLogin,Move,MoveToDeletedItems,SoftDelete,Update,UpdateFolderPermissions -AuditDelegate Create,HardDelete,Move,MoveToDeletedItems,SendAs,SendOnBehalf,SoftDelete,Update,UpdateFolderPermissions -AuditAdmin Copy,Create ,HardDelete ,Move,MoveToDeletedItems,SendAs,SendOnBehalf,SoftDelete,Update,UpdateFolderPermissions
Start-Sleep -Milliseconds 75
}
@kerr-bighealth
kerr-bighealth / config.tf
Created January 28, 2020 20:08
iam-user module
terraform {
required_version = ">=0.12, <0.13"
}
@jhucpp
jhucpp / PY0101EN-2-2-Lists.ipynb
Created January 13, 2020 19:58
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lushkant
lushkant / wordpress.conf
Created January 13, 2020 19:15
WordPress multiste nginx configuration
# WordPress multisite subdirectory rules.
# Designed to be included in any server {} block.
# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
try_files $uri $uri/ /index.php?$args;
}
# Directives to send expires headers and turn off 404 error logging.
@kmjaimes
kmjaimes / gist:1ded0501357db9005bc5fd520348657e
Created January 13, 2020 19:15 — forked from sumardi/gist:5559896
Subdirectory checkouts with Git sparse-checkout
# New repository
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>
# Existing repository
@jhaddix
jhaddix / Github bash generated search links (from hunter.sh)
Created January 12, 2020 19:55
Github bash generated search links (from hunter.sh)