
A Short History of Azurehound in PowerShell
When BloodHound first added Azure support, its collector was a PowerShell script named AzureHound.ps1. It shipped alongside the BloodHound application, relied on Microsoft's PowerShell modules for Azure and Azure AD, and produced output that the BloodHound version of the day could ingest. For many practitioners, that script was their first glimpse of Azure attack paths.
Over time, SpecterOps rebuilt the collector from the ground up in Go. The modern Azurehound is a standalone binary that talks directly to Microsoft Graph and Azure Resource Manager, runs on every major platform and is actively maintained. The PowerShell script is now a legacy artefact.
Yet people still search for "Azurehound PS1", usually because an older tutorial references it, because a team has scripts built around it, or because PowerShell is the only scripting environment allowed on their workstations. This guide explains what the script did, why it was replaced and how to move to the modern collector without losing the conveniences of PowerShell.
What AzureHound.ps1 Did
The legacy script followed a familiar PowerShell pattern:
- Import the required modules for Azure Resource Manager and Azure AD.
- Sign in interactively or with stored credentials.
- Enumerate users, groups, applications, service principals, roles, subscriptions and resources.
- Write a set of JSON files for the BloodHound version of that era.
Its dependence on PowerShell modules was both a strength and a weakness. It felt natural to Windows administrators, but it also meant collection speed and reliability depended on those modules, several of which Microsoft has since deprecated in favour of Microsoft Graph.
Why the PowerShell Collector Was Retired
Several factors drove the move to Go:
- Module deprecation. Microsoft retired the AzureAD and MSOnline PowerShell modules in favour of the Microsoft Graph PowerShell SDK, undermining the foundations the script relied on.
- Performance. Large tenants with tens of thousands of objects pushed a PowerShell-based collector to its limits. Go's concurrency and direct API access are far faster.
- Portability. A compiled binary runs on Windows, Linux and macOS without installing modules or adjusting execution policies.
- Data model evolution. BloodHound's Azure schema expanded considerably, and the new collector was built alongside those changes.
- Maintainability. A single, typed codebase is easier to test and extend than a growing script.
Comparing AzureHound.ps1 and Modern Azurehound
| Aspect | AzureHound.ps1 (legacy) | Azurehound (Go) |
|---|---|---|
| Runtime | PowerShell plus Azure modules | Single compiled binary |
| Platforms | Primarily Windows | Windows, Linux, macOS |
| API access | Through PowerShell modules | Directly to Graph and ARM APIs |
| Authentication | Interactive module sign-in | Password, refresh token, JWT, secret, certificate |
| Speed on large tenants | Slow | Considerably faster |
| Output compatibility | Older BloodHound releases | Current BloodHound CE and Enterprise |
| Maintenance status | Deprecated | Actively maintained |
The conclusion is clear: for any new work, the Go-based Azurehound is the right tool.
Can You Still Use AzureHound.ps1?
You may find copies of the script in old BloodHound repositories or archived blog posts. Technically, it might still run in some environments, but there are good reasons not to rely on it:
- Its output targets older BloodHound versions and will not ingest cleanly into BloodHound Community Edition.
- The modules it depends on are retired or being retired.
- It will not collect object types and relationships added in recent years, so your graph would be incomplete.
- It receives no security fixes.
If you encounter a tutorial that tells you to run AzureHound.ps1, treat it as historical and follow a current guide instead.
Running Modern Azurehound From PowerShell
Moving away from the script does not mean leaving PowerShell. The modern binary works perfectly well from a PowerShell console:
Expand-Archive .\azurehound-windows-amd64.zip -DestinationPath C:\Tools\AzureHound
Set-Location C:\Tools\AzureHound
.\azurehound.exe --version
A full collection using a refresh token:
$tenant = "contoso.onmicrosoft.com"
$token = Read-Host -Prompt "Refresh token" -AsSecureString
$plain = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($token))
.\azurehound.exe list -r $plain --tenant $tenant -o "C:\Audit\$tenant-$(Get-Date -f yyyy-MM-dd).json"
Remove-Variable plain
Reading the token as a secure string keeps it off the screen and out of the console history.
Wrapping Azurehound in a PowerShell Script
Many teams liked the PowerShell script because it fitted into their automation. You can keep that convenience by wrapping the binary in your own script:
param(
[Parameter(Mandatory)] [string]$Tenant,
[Parameter(Mandatory)] [string]$AppId,
[Parameter(Mandatory)] [string]$CertPath,
[Parameter(Mandatory)] [string]$KeyPath,
[string]$OutDir = "C:\Audit"
)
$stamp = Get-Date -Format "yyyy-MM-dd"
$out = Join-Path $OutDir "$Tenant-$stamp.json"
& C:\Tools\AzureHound\azurehound.exe list `
-a $AppId --cert $CertPath --key $KeyPath `
--tenant $Tenant -o $out --log-file (Join-Path $OutDir "azurehound-$stamp.log")
if ($LASTEXITCODE -ne 0) { throw "AzureHound collection failed" }
Write-Output "Collection saved to $out"
This wrapper uses certificate-based service principal authentication, which is well suited to scheduled tasks. Combine it with Windows Task Scheduler to produce regular, unattended collections.
Migrating Existing Workflows
If your organisation still has processes built around AzureHound.ps1, migration is straightforward:
- Inventory dependencies. Identify scripts, scheduled tasks and documentation referencing the old collector.
- Choose an authentication method. Replace interactive module sign-in with a service principal certificate or refresh token.
- Update BloodHound. Move to BloodHound Community Edition or Enterprise, which expect modern Azurehound output.
- Replace the call. Swap the script invocation for
azurehound.exe listwith equivalent scope. - Validate. Compare a new collection against an older graph to confirm coverage, noting that the modern collector will usually find more.
- Retire old copies. Remove the legacy script from shared drives so nobody uses it by accident.
Security Considerations for PowerShell Users
PowerShell environments are often monitored closely by endpoint detection tools. Running Azurehound from PowerShell may trigger alerts, which is a good thing in a mature security programme. Coordinate with your security operations team so legitimate collections are recognised, and use dedicated audit accounts or service principals whose activity can be clearly attributed.
Translating Old PowerShell Habits to Modern Azurehound
Administrators who used the legacy script often relied on familiar PowerShell patterns: piping objects, filtering with Where-Object and exporting to CSV. Those habits still have a place, just at a different stage of the workflow. Instead of driving collection, PowerShell now shines in post-processing.
For example, PowerShell can read Azurehound output and produce a quick summary for a change-advisory meeting:
$doc = Get-Content .\tenant.json -Raw | ConvertFrom-Json
$doc.data | Group-Object kind | Sort-Object Count -Descending |
Select-Object Name, Count | Format-Table -AutoSize
On very large files, ConvertFrom-Json can consume significant memory, so run such analysis on a workstation with ample RAM or use a streaming approach for the biggest tenants.
PowerShell is also useful for scheduling and housekeeping: rotating old output files, moving completed collections to encrypted storage, and writing entries to the Windows event log so that monitoring tools can confirm each run finished successfully.
Explaining the change to stakeholders
When retiring AzureHound.ps1, stakeholders may worry that results will change. They will, usually for the better. The modern collector recognises more object types and relationships, so the first new graph may show additional attack paths. Explain in advance that this reflects improved visibility rather than a sudden increase in risk, and treat the first modern collection as a new baseline for future comparisons.
A Note on Execution Policy
PowerShell execution policy applies to scripts, not to compiled executables. Your own wrapper scripts may need to be signed or run under an appropriate policy, but azurehound.exe itself is unaffected. If wrapper scripts are blocked, sign them with your organisation's code-signing certificate rather than relaxing the policy globally on audit workstations.
Key Takeaways
- AzureHound.ps1 is the deprecated PowerShell collector used with older BloodHound releases.
- The Go-based Azurehound is faster, cross-platform and compatible with current BloodHound versions.
- Modern Azurehound needs no PowerShell modules and runs perfectly from a PowerShell console.
- Wrap the binary in your own scripts and scheduled tasks to keep familiar automation.
- Use PowerShell for post-processing and housekeeping rather than collection itself.
- Treat the first collection with the modern tool as a new baseline for comparisons.
FAQs
Conclusion
Azurehound PS1 played an important role in bringing Azure into BloodHound, but its time has passed. The Go-based Azurehound is faster, cross-platform, actively maintained and compatible with current BloodHound releases. PowerShell users lose nothing by switching: the modern binary runs comfortably in PowerShell, fits neatly into scripts and scheduled tasks, and delivers a far more complete picture of Azure attack paths.


