Interactive menu-driven tool for exporting Lync/Skype for Business data to CSV files. This comprehensive exporter provides organized access to user data, phone/device inventory, infrastructure configuration, and voice policies through an easy-to-use menu interface.
- Interactive Menu System: User-friendly categorized export options
- User Data Exports: Summary, voice-enabled, SBA users, and complete user records
- Phone/Device Inventory: Common area phones, analog devices, USB devices
- Infrastructure Exports: Pools, policies, and configuration
- Bulk Export Options: Export all data types at once
- CSV Format: Excel and Power BI compatible exports
- Timestamp-Based Naming: Prevents file overwrites with automatic timestamps
- Progress Indicators: Real-time feedback during export operations
- Error Handling: Robust error reporting with color-coded messages
- PowerShell Version: 3.0 or higher
- Required Environment: Lync/Skype for Business Management Shell
- Required Permissions:
- Read access to Lync configuration
- CsUserAdministrator or CsAdministrator role
- Network Requirements: Access to Lync Front End servers
-
OutputDirectory: Directory for CSV exports
- Type: String
- Default:
C:\Reports\CSV_Exports - Description: All CSV files will be saved to this location
-
OrganizationName: Organization name for reports
- Type: String
- Default:
"Organization" - Description: Used in file naming and report headers
-
SBAPattern: Pattern to identify SBA pools
- Type: String
- Default:
"*MSSBA*" - Description: Wildcard pattern for Survivable Branch Appliance identification
.\Start-LyncCsvExporter.ps1Launches the interactive menu with default output directory and organization name.
.\Start-LyncCsvExporter.ps1 -OutputDirectory "D:\Lync_Reports" -OrganizationName "Contoso"Sets custom output path and organization name for all exports.
.\Start-LyncCsvExporter.ps1 -OrganizationName "Fabrikam" -SBAPattern "*Branch*"Uses custom pattern to identify branch office SBA pools.
- Users - Summary: Basic user information (name, SIP, pool, voice status)
- Users - Voice Enabled Only: Enterprise Voice enabled users with routing details
- Users - SBA Users: Users registered to Survivable Branch Appliances
- Users - Complete: All available user attributes (comprehensive)
- Common Area Phones: Shared phones (lobbies, conference rooms)
- Analog Devices: Fax machines, modems, overhead paging
- USB Devices: USB-connected phones and headsets
- Pools: All Lync pools and their configuration
- Voice Policies: Enterprise Voice policy definitions
- Export All User Types: All user export types at once
- Export All Phone Inventory: All device types in one operation
- Export Everything: Complete data export (all categories)
- [Q] Quit: Exit the application
Summary Export includes:
- DisplayName, SIPAddress, UPN
- Enabled status
- Pool assignment
- VoiceEnabled (EnterpriseVoiceEnabled)
- LineURI (phone number)
- VoicePolicy
Voice Users Export includes:
- All summary fields plus:
- VoiceRoutingPolicy
- HostedVoiceMail status
- LocationPolicy
SBA Users Export includes:
- DisplayName, SIPAddress
- SchoolSite (extracted from pool name)
- SBAPool (full pool FQDN)
- VoiceEnabled, LineURI, VoicePolicy
Complete User Export includes:
- All standard user properties
- All policy assignments
- Federation settings
- Rich presence configuration
- Public network settings
- GUID, SID, Distinguished Name
- Timestamps (WhenCreated, WhenChanged)
Common Area Phones includes:
- DisplayName, LineURI
- SIPAddress, RegistrarPool
- Description, OU location
Analog Devices includes:
- DisplayName, LineURI
- Gateway assignment
- AnalogFax status
- SIPAddress, RegistrarPool
USB Devices includes:
- DisplayName, LineURI
- SIPAddress, RegistrarPool
- Policy assignments
Pools Export includes:
- Pool Identity (FQDN)
- Site assignment
- Services (Registrar, WebServices, etc.)
- Computer count
Voice Policies Export includes:
- Policy Identity and Description
- PSTN usage configurations
- Call forwarding settings
- Simultaneous ring settings
Default: C:\Reports\CSV_Exports\
The script creates this directory automatically if it doesn't exist.
Pattern: Lync_{Category}_{Type}_{YYYYMMDD_HHmmss}.csv
Examples:
Lync_Users_Summary_20251223_143052.csvLync_Users_Voice_20251223_143105.csvLync_CommonAreaPhones_20251223_143120.csvLync_Pools_20251223_143135.csv
Color-coded status messages:
- 🟢 Green: Successful exports with record counts
- 🟡 Yellow: Processing indicators
- 🔴 Red: Errors and failures
- 🔵 Cyan: Menu headers and section dividers
Error: "The term 'Get-CsUser' is not recognized..."
Solution: This script must be run from Lync/Skype for Business Management Shell:
- Start Menu → Lync Server Management Shell (or Skype for Business Server Management Shell)
- Navigate to script directory
- Run the script
Alternatively, import the Lync module:
Import-Module "C:\Program Files\Common Files\Skype for Business Server 2015\Modules\SkypeForBusiness\SkypeForBusiness.psd1"Solution: Ensure you have appropriate permissions:
- CsUserAdministrator role (minimum)
- CsAdministrator role (recommended)
Request role assignment from Lync administrators:
# Admin runs this to grant access
Grant-CsUserAdministrator -Identity "DOMAIN\Username"Possible Causes:
-
No data exists: Verify data with manual commands
Get-CsUser | Measure-Object Get-CsCommonAreaPhone | Measure-Object
-
Incorrect SBA pattern: Adjust the
-SBAPatternparameter# Check actual pool names Get-CsPool | Select-Object Identity
-
Permissions issue: Verify cmdlet access
Get-CsAdministratorRole | Where-Object {$_.Identity -match $env:USERNAME}
Solution: The CSV uses UTF8 encoding. In Excel:
- Open Excel (don't double-click the CSV)
- Data → From Text/CSV
- File Origin: 65001 (UTF-8)
- Click Load
Or use PowerShell to convert:
Import-Csv "file.csv" -Encoding UTF8 | Export-Csv "file_fixed.csv" -NoTypeInformationSolution: For large environments (>10,000 users):
- Export specific categories instead of "Export Everything"
- Run during off-peak hours
- Consider using filters (e.g., SBA users only)
Before Teams migration:
- Export "Users - Complete" for baseline inventory
- Export all phone inventory for hardware tracking
- Export voice policies for Teams policy mapping
- Document pools for cloud connector planning
For voice infrastructure documentation:
- Export "Common Area Phones" for shared device inventory
- Export "Analog Devices" for gateway planning
- Export "Voice Users" for extension directory
- Export "Voice Policies" for dial plan mapping
For SBA evaluation:
- Export "Users - SBA Users" for branch user count
- Identify school sites from pool names
- Plan Teams survivability requirements
- Document extension patterns
For compliance reporting:
- Export "Users - Complete" for full user audit
- Export "Pools" for infrastructure inventory
- Regular exports for change tracking
- Compare exports over time for drift analysis
Before Lync decommissioning:
- "Export Everything" for complete historical record
- Validate all users migrated to Teams
- Document remaining analog devices
- Archive pool configurations
Sequentially exports:
- Users - Summary
- Users - Voice Enabled
- Users - SBA Users
- Users - Complete
Sequentially exports:
- Common Area Phones
- Analog Devices
- USB Devices
Complete data export including:
- All user types (4 exports)
- All phone inventory (3 exports)
- Pools
- Voice Policies
Total: 9 CSV files with complete environment snapshot.
- Export-ADLyncTeamsMigrationData.ps1 - AD attribute export for migration
- Get-ComprehensiveLyncReport.ps1 - Detailed text report
- Get-LyncUserRegistrationReport.ps1 - User registration analysis
- v2.0 (2025-09-17): Phone inventory support
- Added Common Area Phones export
- Added Analog Devices export
- Added USB Devices export
- Enhanced menu structure
- Updated bulk export operations
- v1.0 (2024): Initial release
- User export functionality
- Infrastructure exports
- Interactive menu system