Feb 01 2023 05:17 AM
Hi,
I hope someone can help.
I am trying to create a script that allows me to import and update a customer global address list with a CSV file that they have sent. This script when run would basically change there global address list to match this CSV file, this will be done monthly and I am not 100% how to create this.
Feb 02 2023 10:04 PM
Feb 03 2023 05:49 AM
Feb 03 2023 06:36 AM
Sorry I don't know why I didn't post the script I have.
I'm just waiting to find out if the csv he is sending me has users that have been removed or if it is just additional users every time. If it is just additional users every time would the below script suffice? I understand if users need removing there would probably be more to it.
Import-Module ExchangeOnlineManagement
$UserCredential = Get-Credential
Connect-ExchangeOnline -Credential $UserCredential
$GAL = Get-GlobalAddressList -Identity "Default Global Address List"
$Members = Import-Csv -Path "C:\Temp\AddressListMembers.csv"
$Members | ForEach-Object {
$Recipient = Get-Recipient $_.EmailAddress
Add-AddressListMember -AddressList $GAL -Member $Recipient
}
Disconnect-ExchangeOnline
@aterneuzen@aterneuzen
Feb 03 2023 06:38 AM
Feb 03 2023 07:16 AM
Feb 03 2023 07:21 AM
Feb 03 2023 02:22 PM