Skip to content

Instantly share code, notes, and snippets.

@mr64bit
mr64bit / Get-RecursiveGroupMembers.ps1
Last active June 29, 2018 15:42
Recursively get users that are part of a local or domain group
function Get-RecursiveGroupMembers {
[CmdletBinding(DefaultParametersetname="DomainGroup")]
param(
[Parameter(ValueFromPipeline=$true,ParameterSetName="LocalGroup")]
[String[]]$ComputerName,
[Parameter(ParameterSetName="DomainGroup")]
[String]$Domain,
[String]$Group = "Administrators"
)
@mr64bit
mr64bit / empire-onedrive.txt
Last active October 13, 2021 14:49
Microsoft Graph setup for Empire Onedrive
Create an app at https://apps.dev.microsoft.com
The only things you need are an app password ("Generate new password"), an app platform with a redirect url, ("https://login.live.com/oauth20_desktop.srf" works good as a default) and the delegated permissions Files.ReadWrite, User.Read, and offline_access.
Example: https://imgur.com/a/rd47l
Once you create the app, you will be given an Application ID. Enter this into your listener options.
"set ClientId <your application id>"
"set ClientSecret <you application secret/password>"
Then do "execute". This will not start the listener yet, but will give you an OAuth URL to sign in to.
You will be redirected to a URL like "https://login.live.com/oauth20_desktop.srf?code=M12ac16111-a605-42e9-9dbf-c155de30cfc6&lc=1033". Take the code parameter from that URL and enter it into the listener options.