-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Howto specify more than one mailbox to sync from command line ? #88
Comments
You can't define a PowerShell list in a batch file. The easiest way to do this is to edit the EWSContactSync.ps1 file. Change the Mandatory value of the MailboxList parameter from $True to $False. Then, write in your custom addresses in the following format: @(email1, email2, emai3, etc...). At this point, you should remove the MailboxList argument from your batch file since you already defined the emails in EWSContactSync.ps1. See below for an example of what EWSContactSync.ps1 should look like. Hopefully this helps.
|
Thx for response. I've ended up by modifying the ps1 file but just let get the email addresses list from an external file and then populate the array via foreach loop. Thx for help |
Hi Buzzzo, Do you have an example of the modified ps1 file? |
@buzzzo do you have an example of the file/foreach loop that you can share? |
Hi I've manage to create a txt file with all the mailbox name to sync and calling it in the EWSContactSync script to populate an array. So:
$file = "c:\o365\gal-exo\mailboxtosync.txt" if (Test-Path $file ) { $users = Get-ADGroupMember Group_To_Sync | %{get-aduser $_.SamAccountName | select userPrincipalName } | Select-Object -ExpandProperty userPrincipalName |Out-File -filepath $file
if ( Test-Path -Path "c:\o365\gal-exo\mailboxtosync.txt" -PathType Leaf ) { Of course you need to run script1 BEFORE ewcontactsync script in order to create the mailboxtosync.txt script Hope this can help |
As per subject I can't figure out the exact syntax of -mailboxlist when using more than one entries.
Every time i'm trying to specify in some format the script gives error.
Thx
The text was updated successfully, but these errors were encountered: