From dea28caaa484ecdf693956150c67d23456369e66 Mon Sep 17 00:00:00 2001 From: "Mr.Un1k0d3r" Date: Thu, 21 Mar 2019 10:57:31 -0400 Subject: [PATCH] Update Utility.ps1 --- scripts/Utility.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/Utility.ps1 b/scripts/Utility.ps1 index 6568ad4..c485ae5 100644 --- a/scripts/Utility.ps1 +++ b/scripts/Utility.ps1 @@ -222,6 +222,32 @@ function DumpAll-UserInfo { } } +function Dump-UserGroup { + param( + [Parameter(Mandatory=$True, ValueFromPipeline=$True)] + [string]$UserName + ) + + BEGIN { + + } + + PROCESS { + ForEach($User in $UserName) { + Write-Output "Dumping $($User) Groups" + Write-Output "-----------------------------------------------" + $Groups = (Ldap-GetProperty -Filter "(&(objectCategory=User)(samaccountname=$($User)))" -Property memberOf) + ForEach($Group in $Groups) { + Write-Output $Group + } + } + } + + END { + Write-Output "[+] Process completed..." + } +} + function Search-UserPassword { param(