Exporting Active Directory User Emails and Job Titles to Excel for Dell Laptop Management
Overview
This guide explains how to extract all active user email addresses and job titles from Active Directory and export them into a readable Excel spreadsheet. This process is especially useful for IT administrators managing Dell laptops in a corporate environment, where centralized user information is important for asset assignment, support, and reporting.
Note: This guide is not specific to a single Dell laptop model and can be applied across various devices in your Dell fleet.
Prerequisites
- A Windows machine with:
- PowerShell 5.1 or higher
- Active Directory module installed (RSAT: Active Directory Tools)
- Access to query Active Directory (domain user with read permissions)
- ImportExcel (opens in a new tab) module (optional, for Excel export)
- Microsoft Excel installed (for .xlsx export)
Script Functionality
The script performs the following tasks: 1. Loads the Active Directory
PowerShell module. 2. Queries all enabled users in Active Directory.
3. Filters only users with a valid email address. 4. Selects the
Email and Job Title ("Title") attributes. 5. Exports the results
to an Excel file (.xlsx) or a CSV as a fallback.
PowerShell Script
# Load Active Directory module
Import-Module ActiveDirectory
# Query active users with Email and Job Title
$users = Get-ADUser -Filter {Enabled -eq $true -and EmailAddress -like "*"} \
-Property EmailAddress, Title | Where-Object {
$_.EmailAddress -ne $null
} | Select-Object @{Name="Email";Expression={$_.EmailAddress}}, \
@{Name="JobTitle";Expression={$_.Title}}
# Export path (Desktop)
$exportPath = "$env:USERPROFILE\Desktop\ActiveUsers.xlsx"
# Check for ImportExcel module
if (-not (Get-Module -ListAvailable -Name ImportExcel)) {
Write-Host "Installing 'ImportExcel' module..."
Install-Module -Name ImportExcel -Scope CurrentUser -Force
}
# Export to Excel
$users | Export-Excel -Path $exportPath -AutoSize -WorksheetName 'Users'
Write-Host "Export completed: $exportPath"Alternative: CSV Export
If you prefer not to install the ImportExcel module, use this instead:
$users | Export-Csv -Path "$env:USERPROFILE\Desktop\ActiveUsers.csv" -NoTypeInformation -Encoding UTF8Example Output
Email JobTitle
john.doe@company.com IT Support Specialist jane.smith@company.com HR Manager
Use Cases for Dell Laptop Environments
- Assigning devices based on user role
- Validating hardware distribution per department/job title
- Creating reports for Dell warranty and asset tracking systems
- Cross-checking Dell Command | Monitor outputs with AD user data
Security Considerations
- Always run PowerShell scripts in a secure environment.
- Do not expose exported files to unauthorized users.
- Review data privacy policies before sharing AD exports.
Troubleshooting
- Missing Data: Ensure the AD user objects have
EmailAddressandTitlefields populated. - Permission Denied: Run PowerShell as a user with read access to AD.
- Module Not Found: Install the Active Directory module via RSAT if missing.
Notes
- This script works on all Windows-based Dell laptops that can run PowerShell.
- Customization is possible by adding more fields such as
Department,Manager, etc.
Created by IT for Dell Laptop Fleet Management.