Skip to content

Instantly share code, notes, and snippets.

View wangkai0351's full-sized avatar

wangkai0351 wangkai0351

View GitHub Profile
@wangkai0351
wangkai0351 / AD group enumeration with LDAP in PowerShell Core.ps1
Created January 3, 2023 11:06 — forked from msm-fc/AD group enumeration with LDAP in PowerShell Core.ps1
Demonstrates AD group enumeration with LDAP in PowerShell Core. Uses the Novell.Directory.LDAP.VQ DotNet Standard 2.0 library
#Demonstrates listing an Active Directory group membership with PowerShell Core
using namespace Novell.Directory.LDAP.VQ
#region environment-specific config
$DCname = 'DomainControllerName'
# Don't store user credentials in your powerShell scripts!!
# This is just here to demonstrate POC.
$ldapUser = 'CN=powershell-ldap,CN=Users,DC=Corporate,DC=Contoso,DC=com'