Explorar o código

add option to pass short user identity

Tobias Simetsreiter %!s(int64=2) %!d(string=hai) anos
pai
achega
e3ab4ffb31
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      bin/Get-ADUserNestedGroups.ps1

+ 5 - 0
bin/Get-ADUserNestedGroups.ps1

@@ -1,10 +1,15 @@
 Param
 Param
 (
 (
     [string]$DistinguishedName,
     [string]$DistinguishedName,
+    [string]$UserIdentity = "",
     [array]$Groups = @(),
     [array]$Groups = @(),
     [switch]$Duplicates
     [switch]$Duplicates
 )
 )
 
 
+if ($UserIdentity -notin @($null, "")){
+    $DistinguishedName = (Get-ADUser -Identity $UserIdentity).distinguishedname
+}
+
 #The user to check.
 #The user to check.
 # $User = "max.mustermann@domain.com";
 # $User = "max.mustermann@domain.com";