How to use ADSearch
- Unzip the ZIP and put the
ADSearchfolder on your machine or a file share - In PowerShell, run
Import-ModulewithADSearch.psd1 - Run
Invoke-ADSearchSelfTestto check that it loaded and the DC is reachable
Import-Module C:\tools\ADSearch\ADSearch.psd1
Invoke-ADSearchSelfTest -Server dc01.corp.local
The domain name in the example is fictitious.
If the execution policy (RemoteSigned etc.) blocks it, use the bundled Import-ADSearch.ps1.
. ([scriptblock]::Create((Get-Content 'C:\tools\ADSearch\Import-ADSearch.ps1' -Raw)))
Import-ADSearch -Path 'C:\tools\ADSearch'
FAQ
- Does it work without RSAT (the ActiveDirectory module)?
- Yes. It uses only .NET's System.DirectoryServices (ADSI/LDAP), so RSAT is not needed. It runs as an ordinary domain user on a domain-joined Windows machine.
- Does it ever change anything in AD?
- No. Every exported command only gets, searches or runs a self-test. The scripts in the forTest folder that create test data are for test environments only; do not run them in production.
- Does it give the same results as RSAT's Get-ADUser?
- The main parameters and output properties follow RSAT. -Identity accepts a DN, ObjectGUID, SID or sAMAccountName, and throws if nothing is found, as RSAT does. Differences are listed in the README and the reference.
- The execution policy stops it from loading.
- Use the bundled Import-ADSearch.ps1. It reads the files as text and loads them as script blocks, so the file execution policy does not apply. If you can copy the files locally, running Unblock-File on them first also works.
Notes
- Before using it on a work machine, check your employer's rules (on bringing in software and on querying the directory)
- Running many searches in quick succession puts load on the DC. Narrow the scope with
-Filterand-SearchBase - The module runs entirely on your machine and sends nothing to this site
- It is provided as is, with no warranty
Feedback and bug reports: reports are used to fix things; replies are not sent. The form is in Japanese, but you can write in English.
The site-wide about page and disclaimer and privacy policy apply to all tools.
Changes
- Added this usage page (the FAQ, notes and changes moved here from the overview page)
- Version 1.4.1: fixed
'$true'in-Filter,Get-ADComputer PC001(without$), and-Identityby name for trusts, sites and Exchange configuration. Added a test that runs without AD - Released (version 1.4.0)
This is an English translation of the Japanese page. If the two differ, the Japanese version prevails.