-
Notifications
You must be signed in to change notification settings - Fork 0
Get LyncServiceStatus
Generates a comprehensive service status report for Lync/Skype for Business environments. This monitoring tool analyzes Windows services, Lync Management Shell services, and related processes to provide administrators with complete visibility into service health and operational status.
- Windows Services Analysis: Status of all Lync-related Windows services
- Lync Management Shell Services: Lync-specific service information
- Process Information: Related process metrics including resource usage
- Service Dependencies: Service dependency and startup configuration
- Performance Metrics: CPU and memory usage by process
- Customizable Service Patterns: Flexible service identification
- Specific Service Checks: Critical service validation
- Real-Time Status: Current operational state
- PowerShell Version: 3.0 or higher
-
Required Permissions:
- Local Administrator (for service query)
- Read access to process information
- Optional: Lync/Skype for Business Management Shell (for enhanced reporting)
- Network Requirements: Local or remote server access
-
OrganizationName: Organization name
- Type: String
- Default:
"Organization" - Description: Organization name for report headers
-
ReportPath: Output file path
- Type: String
- Default:
"C:\Reports\Lync_Service_Status_{timestamp}.txt" - Description: Full path where service status report will be saved
-
ServicePatterns: Service identification patterns
- Type: String Array
- Default:
@("*RTC*", "*Lync*", "*Skype*") - Description: Wildcard patterns to identify Lync/SfB related services
-
SpecificServices: Critical services to check
- Type: String Array
- Default:
@("RTCSRV", "RTCCLSAGT", "RTCATS", "RTCDSS", "RTCMCU", "RTCASMCU") - Description: Specific service names checked individually regardless of patterns
.\Get-LyncServiceStatus.ps1Generates service status report with default patterns and organization name.
.\Get-LyncServiceStatus.ps1 -OrganizationName "Contoso Corp" -ReportPath "D:\Reports\Contoso_Services.txt"Creates report with custom organization name and output location.
.\Get-LyncServiceStatus.ps1 -ServicePatterns @("*Teams*", "*SfB*", "*RTC*") -SpecificServices @("TeamsService", "SfBService")Monitors services in Teams/Skype hybrid environment with custom patterns.
.\Get-LyncServiceStatus.ps1 -ServicePatterns @("*RTC*") -SpecificServices @("RTCSRV", "RTCMCU")Focuses on core RTC services only.
.\Get-LyncServiceStatus.ps1 -ServicePatterns @("*RTC*", "*Lync*", "*Skype*", "*MSSQL*", "*FabricHost*")Includes SQL Server and Fabric services for complete infrastructure monitoring.
For each service matching patterns:
- Service Name: System service name
- Display Name: Friendly service name
- Status: Running, Stopped, Paused, etc.
- Startup Type: Automatic, Manual, Disabled
- Account: Service logon account
- Dependencies: Services this service depends on
- Dependent Services: Services that depend on this service
Service Status Indicators:
- β Running (Automatic): Healthy
β οΈ Stopped (Automatic): Issue - service should be running- βΉοΈ Stopped (Manual/Disabled): Expected state
- π΄ Failed: Critical - service in error state
(If Lync Management Shell available):
- Service Identity: Lync service pool and role
- Computer: Server hosting service
- Status: Active, Inactive, Quiesced
- Service Type: Registrar, WebServices, etc.
- Dependent Features: Features depending on service
For each Lync-related process:
- Process Name: Executable name
- Process ID: PID
- CPU Usage: Current CPU percentage
- Memory Usage: Private memory in MB
- Handle Count: System handles in use
- Thread Count: Active threads
- Start Time: When process started
- Responding: Process responsiveness status
Process Health Indicators:
- β Normal: CPU < 50%, Memory stable, Responding
β οΈ Warning: CPU 50-80%, High memory, Responsive- π΄ Critical: CPU > 80%, Memory leak, Not responding
Visual representation of service dependencies:
RTCSRV (Front-End Service)
βββ Depends on: RPC, EventLog, MSSQLSERVER
βββ Required by: RTCMCU, RTCATS
RTCMCU (MCU Service)
βββ Depends on: RTCSRV
βββ Required by: None
- Total Services Monitored: Count of services checked
- Services Running: Count of active services
- Services Stopped: Count of stopped services (with startup type analysis)
- Critical Issues: Services that should be running but are stopped
- Process Count: Total Lync-related processes
- Total CPU Usage: Combined CPU across all Lync processes
- Total Memory Usage: Combined memory across all Lync processes
Default: C:\Reports\
Pattern: Lync_Service_Status_{YYYYMMDD_HHmmss}.txt
Example: Lync_Service_Status_20251223_143052.txt
Real-time status messages:
- Service discovery progress
- Process enumeration status
- Critical service alerts
- Report generation confirmation
Solution: Run PowerShell as Administrator:
# Right-click PowerShell or Lync Management Shell
# Select "Run as Administrator"
.\Get-LyncServiceStatus.ps1Possible Causes:
- Lync not installed on this server
- Service patterns don't match your services
- Services renamed or customized
Solution: Verify services and adjust patterns:
# List all services with "RTC" in name
Get-Service -DisplayName "*RTC*"
# List all services with "Lync" in name
Get-Service -DisplayName "*Lync*"
# Adjust pattern accordingly
.\Get-LyncServiceStatus.ps1 -ServicePatterns @("*YourPattern*")Solution: Add to SpecificServices parameter:
.\Get-LyncServiceStatus.ps1 -SpecificServices @("RTCSRV", "RTCMCU", "YourServiceName")Solution: Ensure Lync processes are running:
# Check for Lync processes
Get-Process | Where-Object {$_.ProcessName -like "*rtc*" -or $_.ProcessName -like "*lync*"}
# If none running, services may be stopped
Get-Service -DisplayName "*RTC*" | Where-Object {$_.Status -eq "Stopped"}Solution: This is expected if:
- Script run outside Lync Management Shell
- Lync cmdlets not available
- Remote server querying
The script continues with Windows Services information only. For full reporting:
# Launch Lync Management Shell
# Start Menu β Lync Server Management Shell
.\Get-LyncServiceStatus.ps1Solution: Verify service name:
# Get exact service name
Get-Service | Select-Object Name, DisplayName | Where-Object {$_.DisplayName -like "*lync*"}
# Use exact Name (not DisplayName)
.\Get-LyncServiceStatus.ps1 -SpecificServices @("ExactServiceName")Interpretation:
- Normal during calls: High activity expected during peak usage
- Idle system: May indicate issue - investigate process
Troubleshooting:
# Identify specific high-usage process
Get-Process | Where-Object {$_.CPU -gt 50} | Select-Object ProcessName, CPU, WorkingSet
# Check event logs for errors
Get-EventLog -LogName Application -Source "Lync*" -Newest 20Daily service status checks:
# Create scheduled task
$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File `"C:\Scripts\Get-LyncServiceStatus.ps1`""
$Trigger = New-ScheduledTaskTrigger -Daily -At 8:00AM
Register-ScheduledTask -TaskName "Lync Daily Service Check" -Action $Action -Trigger $TriggerPost-maintenance health check:
# Before maintenance
.\Get-LyncServiceStatus.ps1 -ReportPath "C:\Reports\Pre-Maintenance-Status.txt"
# Perform maintenance
# After maintenance
.\Get-LyncServiceStatus.ps1 -ReportPath "C:\Reports\Post-Maintenance-Status.txt"
# Compare
Compare-Object (Get-Content "C:\Reports\Pre-Maintenance-Status.txt") (Get-Content "C:\Reports\Post-Maintenance-Status.txt")During service outages:
- Run service status report immediately
- Identify stopped services
- Check process status and resource usage
- Review service dependencies
- Restart services as needed
Monitor resource trends:
# Run regularly and track metrics over time
.\Get-LyncServiceStatus.ps1
# Extract metrics
$report = Get-Content "C:\Reports\Lync_Service_Status_*.txt" | Select-String "CPU Usage|Memory Usage"Validate service recovery:
- Generate baseline service status
- Simulate failure (stop services)
- Execute recovery procedures
- Generate post-recovery status
- Verify all services restored
Monitor multiple Front End servers:
# Create function to run on remote servers
$Servers = @("lyncfe01", "lyncfe02", "lyncfe03")
foreach ($Server in $Servers) {
Invoke-Command -ComputerName $Server -FilePath "C:\Scripts\Get-LyncServiceStatus.ps1" -ArgumentList @{
ReportPath = "C:\Reports\${Server}_Service_Status.txt"
}
}Alert on service failures:
# Generate report
.\Get-LyncServiceStatus.ps1 -ReportPath "C:\Reports\Status.txt"
# Parse for stopped services
$report = Get-Content "C:\Reports\Status.txt"
$stoppedServices = $report | Select-String "Stopped.*Automatic"
# Send alert if issues found
if ($stoppedServices) {
Send-MailMessage -To "admin@contoso.com" -Subject "Lync Service Alert" -Body "Services stopped: $stoppedServices"
}| Service Name | Display Name | Purpose | Critical |
|---|---|---|---|
| RTCSRV | Lync Server Front-End | Core communication service | Yes |
| RTCCLSAGT | Lync Server Centralized Logging Service Agent | Diagnostic logging | No |
| RTCATS | Lync Server Audio/Video Conferencing | A/V conferencing | Yes (if A/V used) |
| RTCDSS | Lync Server Storage Service | Data storage | Yes |
| RTCMCU | Lync Server Conferencing MCU | Multipoint conferencing | Yes (if conferencing used) |
| RTCASMCU | Lync Server Application Sharing MCU | Application sharing | Yes (if app sharing used) |
| RTCMEDSRV | Lync Server Mediation | PSTN gateway mediation | Yes (if voice enabled) |
| RTCSRVACC | Lync Server Audio Conferencing Server | Audio conferencing | Yes (if audio conf used) |
Automatic + Running: Normal operational state Automatic + Stopped: Problem - service should be running Manual + Stopped: Normal - service starts on demand Disabled + Stopped: Normal - service intentionally disabled
- Get-LyncHealthReport.ps1 - Comprehensive health diagnostics
- Get-LyncInfrastructureReport.ps1 - Infrastructure configuration
- Get-ComprehensiveLyncReport.ps1 - Complete environment assessment
-
v2.0 (2025-09-17): Enhanced service monitoring
- Added process performance metrics
- Enhanced service dependency mapping
- Added customizable service patterns
- Improved service status indicators
- Added resource usage reporting
-
v1.0 (2024): Initial release
- Basic service status reporting
- Windows service enumeration
- Overview
- Start-LyncCsvExporter
- Get-ComprehensiveLyncReport
- Get-LyncHealthReport
- Get-LyncInfrastructureReport
- Get-LyncServiceStatus
- Get-LyncUserRegistrationReport
- Export-ADLyncTeamsMigrationData
- New-Office365Accounts
- Sync-ContactsFromCsv
- Set-EmailToSharedAccount
- Set-SMTPForward
- Invoke-UserSignOutAndBlock
- Security Assessment Scripts (coming soon)
- Azure Automation (documentation pending)
- Get-GraphToken
- Get-GraphHeaders
- Get-AzureResourcePaging
- Get-EnterpriseAppUsage
- Get-ExchangeErrorsGraph
- Get-PBIWorkspaceUsageReport
- Intune Management (documentation pending)