Skip to content

Instantly share code, notes, and snippets.

View hoetz's full-sized avatar

Florian Hötzinger hoetz

View GitHub Profile
@hoetz
hoetz / find-fsps-adgroup.ps1
Last active September 6, 2018 07:30
Find users from foreign domains in a Active Directory group and output them to CSV
#Find users from foreign domains in a Active Directory group and output them to CSV
$group=get-adgroup "mygroup" -Properties member
$domainController="mydc.company.loc"
$fsps = $group.member | where {$_ -like "*foreign*"}
$outputUsers = @()
foreach ($fsp in $fsps) {
$found = $fsp -match 'S-\d-\d-\d+-\d+-\d+-\d+-\w+'
if ($found) {
$usr = get-aduser $matches[0] -server $domainController -Properties displayname, useraccountcontrol, description, mail | select -Property samaccountname, displayname, useraccountcontrol, description, mail
$outputUsers += $usr
@hoetz
hoetz / AzureAdAuth.fs
Created October 20, 2018 10:23
Secure ASP.NET Core F# Api with Azure AD
module AzureAdAuth
open System
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Options
open Microsoft.AspNetCore.Authentication.JwtBearer
open Microsoft.IdentityModel.Tokens
open System.Text
open System.Threading.Tasks
@hoetz
hoetz / EditorServices.log
Created December 6, 2018 11:52
EditorServices.log
2018-12-06 11:44:32.283 [NORMAL] tid:13 in 'StartLogging' C:\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 181
PowerShell Editor Services Host v1.10.0.0 starting (PID 10624
Host application details:
Name: Visual Studio Code Host
Version: 1.10.0
ProfileId: Microsoft.VSCode
Arch: X64

Keybase proof

I hereby claim:

  • I am hoetz on github.
  • I am hoetz (https://keybase.io/hoetz) on keybase.
  • I have a public key whose fingerprint is 9554 A373 578A D037 C65A 6C76 904E 4E33 D948 ABD7

To claim this, I am signing this object: