This is a macOS and Linux compatible fork of the original Need4Admin PowerShell script by Vlad Johansen.
Version: 1.0-pesip.1 Original Author: Vlad Johansen Fork Maintainer: pesip Fork Repository: https://github.com/pesip/Need4Admin
This fork adds full cross-platform support while maintaining 100% compatibility with the original Windows version:
| Feature | Windows (Original) | macOS/Linux (Fork) |
|---|---|---|
| Module Path Detection | $env:USERPROFILE\Documents\WindowsPowerShell\Modules |
$HOME/.local/share/powershell/Modules |
| HTML Report Opening | Start-Process |
open (macOS) / xdg-open (Linux) |
| Module Loading | Fixed version requirement | MinimumVersion with fallback for version conflicts |
| Assembly Warnings | Visible | Suppressed for cleaner output |
- Platform Detection: Automatic detection of Windows/macOS/Linux using
$IsWindows,$IsMacOS,$IsLinux - Module Path Handling: Cross-platform PowerShell module path configuration
- Enhanced Module Loading: Graceful handling of module version conflicts
- Browser Opening: Platform-specific HTML report opening
A PowerShell script to audit privileged users in Microsoft Entra ID and Azure with detailed reporting
- UPN
- Entra Active Roles
- Entra Eligible Roles
- Azure Active Roles
- Azure Eligible Roles
- Total roles
- Account status (Active/Disabled)
- Account type (Cloud/Hybrid)
- MFA Status (YES/NO)
- Last interactive and non-interactive sign in date and time
- Authentication methods registered
- Total Users Without MFA
- Total Entra Active Roles
- Total Azure Active Roles
- Total Azure Eligible Roles
- Total Hybrid Users
- Total Users
- Total Active Users
- Total users with registered phishing resistant authentication methods
- Highlights Global admin and Owner roles with red text
- Highlights users without MFA with red text
- Highlights Hybrid users with yellow text
- Highlights Disabled status with red text
- Highlights Enabled users with green text
- Highlights users with MFA with green text
- Highlights Cloud users with blue text
- Highlights phishing resistant authentication methods
- Highlights if role is assigned via PIM group
- Search function in html report
- After script finishes running, it automatically opens an HTML Report in default browser
- HTML report columns are sortable and resizable
- Generates both .html and .csv files in a secure location outside the repository:
- Windows:
%USERPROFILE%\Need4Admin-Reports\ - macOS/Linux:
$HOME/Need4Admin-Reports/
- Windows:
- Reports are automatically excluded from Git to prevent accidental commit of sensitive data
- PowerShell Core 7.0+ (recommended for macOS/Linux)
- Microsoft Graph PowerShell SDK
- Azure PowerShell modules (if scanning Azure roles)
# Install PowerShell Core
brew install --cask powershell
# Launch PowerShell
pwsh
# Run the script
./Need4Admin_V1.0.ps1# Install PowerShell Core (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install -y powershell
# Or using Snap
sudo snap install powershell --classic
# Launch PowerShell
pwsh
# Run the script
./Need4Admin_V1.0.ps1# PowerShell 5.1+ or PowerShell Core 7.0+
.\Need4Admin_V1.0.ps1The script will automatically:
- Check for required AZ and Graph modules
- Install missing modules as CurrentUser if needed
- Prompt for Azure authentication (optional)
- Generate HTML and CSV reports
# Basic usage (interactive authentication)
pwsh ./Need4Admin_V1.0.ps1
# With service principal (certificate authentication)
pwsh ./Need4Admin_V1.0.ps1 -TenantId "your-tenant-id" -ClientId "your-app-id" -CertificateThumbprint "cert-thumbprint"# Check PowerShell module path
pwsh -Command '$env:PSModulePath'
# Manually create module directory if needed
mkdir -p ~/.local/share/powershell/Modules- macOS: Ensure
opencommand is available (default on macOS) - Linux: Install
xdg-utilspackage# Ubuntu/Debian sudo apt-get install xdg-utils # RHEL/CentOS/Fedora sudo yum install xdg-utils
The fork automatically handles version conflicts with fallback loading. If issues persist:
# Start fresh PowerShell session
pwsh
./Need4Admin_V1.0.ps1Please remove all modules which script uses in Documents folder WindowsPowerShell/Modules (for version 5.1) or in PowerShell (for version 7+), empty recycle bin and re-run the script. If it doesn't help, please open an issue.
This is a fork focused on cross-platform compatibility. For core functionality changes, please contribute to the original repository.
For macOS/Linux specific improvements:
- Fork this repository
- Create a feature branch
- Submit a pull request
This fork maintains the same license as the original project.
- Original Author: Vlad Johansen - Created the excellent Need4Admin scanner
- Fork Maintainer: pesip - Cross-platform compatibility
- β Added macOS support
- β Added Linux support
- β Enhanced module loading with version conflict resolution
- β Cross-platform HTML report opening
- β Cleaner console output (suppressed assembly warnings)
- Initial Windows release with full Entra ID and Azure scanning capabilities
