Open Tom-Rudd opened 1 year ago
I solved this by adding this into the script, for anyone who needs it. This works when you have an onsite AD that has the correct emails of all the users you want to sync, and you have the powershell AD tools installed.
# If 'DIRECTORY' is used for $MailboxList, fetch all Mailboxes from the administrator account's Office 365 directory
if ($MailboxList -eq "DIRECTORY") {
$MailboxList = Get-Mailboxes -ConnectionUri https://outlook.office365.com/powershell-liveid/ -CertificatePath
$CertificatePath -CertificatePassword $CertificatePassword -ExchangeOrg $ExchangeOrg -ClientID $ClientID
}
if ($MailboxList -eq "GROUP") {
$MailboxList = (Get-ADGroupMember "YOUR USER ACCOUNT" -recursive | get-aduser | select
UserPrincipalName).userprincipalname
So say I want the script to apply to a security group called "Employees" instead of everyone using the default DIRECTORY parameter. Where do I put your line?
Hello all, I am trying to make it so I can query distribution lists to apply the sync to select users. So far, I have the command that seems to be pooping out just the email addresses as I would want.:
When I run the command in exchange online PowerShell, I get a list back of all the email addresses. However, when I insert it into the parameter statement I get:
What am I missing here, I thought that would be exactly what it needs. Do I need to insert that command into another location in the scripts?