Problem
- The machine does not have RSAT AD tools installed.
Fix
- Install RSAT Active Directory tools.
- Confirm
Get-Module -ListAvailable ActiveDirectoryreturns a result.
Problem
Scan-ADComputers.ps1is running under Windows PowerShell 5.1 or an earlier version.
Fix
- Run
Scan-ADComputers.ps1in PowerShell 7+.
For Manage-ADUserAccounts.ps1 and Get-ADAdminActivity.ps1, Windows
PowerShell 5.1 or later is supported.
Possible causes:
- wrong
ComputerType - narrow
SearchBase - too many exclusions in
ExcludeOU - targeted names not found in AD
- connectivity filtering removed targeted results
Things to check:
- run with
-TestMethod Nonein targeted mode - inspect the
_TargetedAuditexport - confirm the input list format
- verify queried OU scopes
For user account reports:
- use
-IncludeDisabledif disabled users should appear in broad scoped reports - use
-Mode LockedOut -IncludeEventswhen you need lockout event source details - confirm
-SearchBasepoints at user OUs, not computer-only OUs - use
-AllowPartialResultsfor event reports when one DC is unavailable
Possible causes:
- the account cannot read Security logs on Domain Controllers
- the events have aged out of the Security logs
- Advanced Audit Policy is not logging account management events
- lockout events were written to a different writable Domain Controller
Things to check:
- increase
-DaysBack - provide
-DomainControllersexplicitly - run from an elevated shell
- verify event IDs such as
4724,4738, and4740exist on the DC Security logs
Possible causes:
- insufficient delegated rights
- password does not meet domain policy
- the account is protected or managed by another process
- the target account is outside the delegated OU scope
Things to check:
- preview with
-WhatIf - use
-GenerateTemporaryPasswordor provide-NewPasswordas a secure string - add
-ShowGeneratedPasswordwhen using-GenerateTemporaryPassword - add
-ChangePasswordAtLogonfor temporary password workflows
Possible causes:
- WinRM not enabled
- firewall blocked
- insufficient credential rights
- CIM permissions denied
Things to check:
- use
-TestMethod WinRM - lower
-ThrottleLimitor-RemoteInventoryThrottleLimit - increase
-TimeoutSeconds - run without
-RemoteInventoryfirst - add
-PerformanceSummaryand compare theOperationalConnectivity,DnsResolution,PortChecks, andRemoteInventorytimings
Problem
RemoteInventoryStatusshowsSkippedUntrustedTarget.
Fix
- Confirm the computer object's
DNSHostNameis under the AD DNS suffix. - Supply the correct
-DomainNameif discovery is not returning the expected suffix. - Restrict scans with
-SearchBaseor-SearchBaseListso only trusted computer OUs are queried.
Problem
CredentialPathis rejected because it is under the repository or points at a UNC path.
Fix
- Store CLIXML credential files outside the repository, such as under
$env:USERPROFILE\.admintools. - Use
-AllowNetworkInputPathonly when a UNC credential location is trusted and access-controlled. - Use only one credential source:
-Credential,-CredentialSecretName, or-CredentialPath.
Problem
- A report or log path is rejected because it already exists or is a network path.
Fix
- Use a new output path, or pass
-ForceOverwritewhen replacement is intentional. - Use
-AllowNetworkOutputPathonly when the UNC location is trusted and access-controlled. - Use
-AllowNetworkInputPathonly when an input file UNC location is trusted and access-controlled.
Possible causes:
- previous file path is wrong
- previous file format is not CSV or JSON
- previous file schema is incompatible with current data
Basic full server inventory:
.\Scan-ADComputers.ps1 -ComputerType Server -Mode FullBasic targeted server scan:
.\Scan-ADComputers.ps1 -ComputerType Server -Mode Targeted -ComputerListPath ".\serverlist.txt"Targeted scan with audit and diagnostics:
.\Scan-ADComputers.ps1 `
-ComputerType Server `
-Mode Targeted `
-ComputerListPath ".\serverlist.txt" `
-ResolveDns `
-TestPorts 445,3389,5985 `
-SeparateStatusExportsWorkstation stale-device summary:
.\Scan-ADComputers.ps1 `
-ComputerType Workstation `
-Mode Full `
-InactiveDays 90 `
-SummaryOnly `
-ExportFormat Csv,HtmlBasic admin activity audit:
.\Get-ADAdminActivity.ps1 -DaysBack 7Privileged admin audit:
.\Get-ADAdminActivity.ps1 `
-DaysBack 30 `
-AdminOnly `
-AllowPartialResultsUser password age report:
.\Manage-ADUserAccounts.ps1 `
-Mode Report `
-ReportType PasswordAge `
-ExportFormat Csv,HtmlLocked-out user detail:
.\Manage-ADUserAccounts.ps1 `
-Mode LockedOut `
-IncludeEvents `
-DaysBack 7 `
-AllowPartialResults