Jump to content

Search the Community

Showing results for tags 'get-aduser'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. You must have the ActiveDirectory module available for import (usually done by installing RSAT). In reply to a question posed on the AD UDF thread. How to dump an array of users from AD with a partial Last Name: #include <AutoItConstants.au3> #include <Array.au3> $sName = inputbox("Get AD User Info" , "AD Lastname (or partial)") $sName = "*" & $sName & "*" $sCommands = "powershell -Command import-module ActiveDirectory; Get-ADUser -LDAPfilter '(name=" & $sName & ")'" $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_SHOW , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aOut = stringsplit($sOutput, @LF , 2) for $i = ubound($aOut) - 1 to 0 step -1 $aOut[$i] = StringStripWS($aOut[$i] , 8) If stringinstr($aOut[$i] , "GivenName") And Stringright($aOut[$i] , 1) <> ":" Then $aOut[$i] = stringtrimleft($aOut[$i] , 10) ElseIf stringinstr($aOut[$i] , "Surname") And Stringright($aOut[$i] , 1) <> ":" Then $aOut[$i] = stringtrimleft($aOut[$i] , 8) Else _ArrayDelete($aOut , $i) EndIf next ;~ _ArrayDisplay($aOut) Local $aFullName[0] For $i = 0 to ubound($aOut) - 1 step 2 _ArrayAdd ($aFullName , $aOut[$i] & " " & $aOut[$i + 1]) Next $aFullNameUnique = _ArrayUnique($aFullName, 0 ,0 ,0 ,0) _ArrayDisplay($aFullNameUnique)
×
×
  • Create New...