This page is not available for the language you chose. Would you like to view a Google Translate version for pages lacking translation?

Home > Artículos del Blog > Top 6 PowerShell Commands for Updating the GAL: A Complete Guide for IT Admins – CiraSync 
Compartir en Compartir en Facebook Compartir en Twitter Compartir en Facebook compartir por correo electrónico

The global address list (GAL) is a key element for keeping up the communication flow strategy in Exchange and Microsoft 365. Although PowerShell is a good way for filtering, troubleshooting, and updating the GAL, doing it manually can be slow and hard. Tools that automate this process, e. g., CiraSync, are great helpers for PowerShell as they can provide real-time updates, hybrid support, and less admin work. This article shares the six most important PowerShell commands, the best practices, the usual problems, and how automation can make GAL management easier. 

What Is the Global Address List (GAL)? 

The Global Address List (GAL) is a directory of all mail-enabled recipients in an Exchange organization, including user mailboxes, contacts, and groups. It’s the primary list users rely on in Outlook and Outlook Web Access when sending emails. 

In Exchange Online, updates are mostly automatic, but there are situations where admins need to validate, modify, or force changes using PowerShell. Combining PowerShell expertise with automation tools like CiraSync ensures the GAL is always accurate, visible, and synchronized across devices. 

Why Update the GAL? 

Maintaining an up-to-date GAL is crucial for: 

  • Ensuring new hires or role changes are visible immediately 
  • Applying department- or role-specific filters in segmented GALs 
  • Reducing email errors and improving collaboration 
  • Troubleshooting visibility issues in Outlook or the Offline Address Book 

While PowerShell gives you control and customization, automation tools save time, reduce human error, and ensure hybrid or multi-tenant environments stay fully synced. 

Prerequisites for PowerShell GAL Work 

Before running commands, ensure: 

  1. Exchange Online PowerShell Module is installed (ExchangeOnlineManagement v2 or v3). 
  2. Connect to your tenant using Connect-ExchangeOnline. 
  3. Address Lists role is assigned to your admin account, required for Get-AddressListSet-GlobalAddressList, and related cmdlets. 

Top 6 PowerShell Commands for Updating the GAL 

1. Connect-ExchangeOnline 

Purpose: Establishes a PowerShell session to your Exchange Online tenant. 

Connect-ExchangeOnline -UserPrincipalName admin@domain.com 

Run this at the start of any session to authenticate and enable access to GAL management commands. 

2. Get-GlobalAddressList 

Purpose: Retrieves information about all Global Address Lists. 

Get-GlobalAddressList 

This command displays the Default GAL and any custom GALs. It’s crucial for understanding your environment before making changes. 

3. Set-GlobalAddressList 

Purpose: Updates GAL properties or applies a new filter. 

Set-GlobalAddressList -Identity «Default Global Address List» 

Example: Adding a department filter: 

Set-GlobalAddressList -Identity «Contoso GAL» -ConditionalCompany @{Add=»Fabrikam»} 

Use it to apply custom filters or enforce configuration changes in Exchange Online. 

4. Get-AddressList 

Purpose: Lists all address lists, including GALs and other filtered lists. 

Get-AddressList 

It helps confirm the existence and properties of each list, ensuring filters are applied correctly. 

5. Update-GlobalAddressList (On-Premises Only) 

Purpose: Forces an immediate GAL update in on-premises Exchange. 

Update-GlobalAddressList -Identity «Default Global Address List» 

This command recalculates recipients and applies recent changes. It is not supported in Exchange Online. 

6. Get-Recipient -RecipientPreviewFilter 

Purpose: Tests which recipients will appear in a GAL based on its filter. 

Get-Recipient -RecipientPreviewFilter (Get-GlobalAddressList).RecipientFilter 

It helps validate filters before users notice visibility issues, especially for custom or segmented GALs. 

H2: Best Practices for Managing GAL Updates 

  • Ensure proper role assignment to avoid errors. 
  • Understand that Offline Address Books may take hours or days to sync. 
  • Use BITS resets to resolve client-side download delays: 

bitsadmin.exe /reset /allusers 

  • Validate filters using Get-Recipient -RecipientPreviewFilter before deployment. 

Common GAL Update Challenges and How PowerShell Helps 

Even seasoned Exchange admins may face: 

  • Missing or delayed user entries 
  • Deleted accounts lingering in GAL 
  • Title or department changes not appearing 

Most issues stem from timing, permissions, or backend processing. PowerShell helps by validating configuration, confirming recipient filters, and checking directory object compliance. Hybrid setups add complexity, as Azure AD Connect sync may affect results. Understanding these mechanics allows admins to proactively manage GALs rather than reacting to user complaints. 

PowerShell vs Automated GAL Sync Tools 

Feature  PowerShell  Automated GAL Sync Tools (e.g., CiraSync) 
Ease of Use  Requires familiarity with cmdlets and syntax  Simple, no coding required; user-friendly interface 
Speed  Changes depend on execution and client sync cycles  Real-time or near real-time updates across all devices 
Error Handling  Manual troubleshooting required for issues  Built-in error detection and alerts 
Hybrid Support  Can work with hybrid environments, but may require multiple scripts  Seamless support for hybrid setups with automatic synchronization 
Customization  High flexibility with filters, custom scripts  Pre-built options plus some customizable filters 
Maintenance  Needs ongoing admin attention  Minimal ongoing management; automated processes 
Offline Address Book Updates  Cannot force client OAB updates; depends on Outlook  Automatically ensures updates propagate to Outlook and mobile devices 
Scalability  Can be scripted for large organizations, but may be complex  Designed to scale easily across multiple tenants or locations 
Time Efficiency  Can be time-consuming for repetitive tasks  Saves significant admin time with automation 
Reliability  Relies on correct execution and permission setup  Highly reliable with consistent sync across all endpoints 

PowerShell is ideal for admins who need flexibility and control, while automated tools like CiraSync save time, reduce errors, and streamline hybrid or multi-tenant GAL management. Using both together gives the best of both worlds: control and efficiency. 

Conclusion 

PowerShell is still very much a go-to tool for working with the Global Address List. Besides, it gives admins the power to check the filters, apply custom configurations, and figure out problems with the directory visibility. For hybrid and multi-tenant environments, a PowerShell expert who is combining his skills with automation tools like CiraSync will see to it that the GALs are correct, the latest, and synced to all devices, thus cutting down manual work and raising user experience. 

10 FAQs About PowerShell and the GAL 

1. What is the GAL?

The Global Address List is a directory of all mail-enabled objects in Exchange, including users, contacts, and groups. 

2. Why doesn’t Update-GlobalAddressList work in Exchange Online?

It is only available in on-premises Exchange. Exchange Online updates GALs automatically; Set-GlobalAddressList is used for configuration changes. 

3. How do I force a GAL refresh in Exchange Online?

Use Set-GlobalAddressList with updated filters or properties. Outlook clients may still require time to sync the Offline Address Book. 

4. Do GAL updates appear instantly?

Not always. Exchange Online updates in the background. Outlook cached mode may take 24-48 hours to reflect changes. 

5. Do I need special roles to run these commands?

Yes. The Address Lists role is required for most GAL and address list management cmdlets. 

6. Can I create a custom GAL?

Yes. Use New-GlobalAddressList with specific filters to segment users by department, location, or other attributes. 

7. How do I test a GAL filter?

Run Get-Recipient -RecipientPreviewFilter (Get-GlobalAddressList).RecipientFilter to see which recipients will appear. 

8. Is it possible to segment the GAL?

Yes. Use custom filters and Address Book Policies to create department or role-specific lists. 

9. What’s the difference between GAL and Address List?

The GAL is the master directory; address lists are filtered subsets designed for specific groups or criteria. 

10. Does Exchange Online automatically update the GAL?

Yes, Exchange Online syncs changes automatically, but PowerShell gives admins visibility and control over configuration and filters. 

 

 

 

 

soc2comliant
GDPR
[gtranslate]