Browse Source

add option to pass short user identity

Tobias Simetsreiter 2 năm trước cách đây
mục cha
commit
e3ab4ffb31
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      bin/Get-ADUserNestedGroups.ps1

+ 5 - 0
bin/Get-ADUserNestedGroups.ps1

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