Exchange
84 TopicsRemote execution with exchange powershell
I'm trying to extract the primarysmtpaddress of each member of a distribution group from an exchange server in a remote forest. The bulk of the script is something link this $parameters = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = 'http://srvwex.company.local/powershell' Credential = $sourceCred # Authentication = 'Basic' ScriptBlock = {{(Get-DistributionGroup $args[0] |Get-DistributionGroupMember).PrimarySmtpAddress }} ArgumentList = $DG.Alias } $RemoteMembership=(Invoke-Command @parameters) but I got the following error The syntax is not supported by this runspace. This can occur if the runspace is in no-language mode. + CategoryInfo : ParserError: ({(Get-Distribut...rySmtpAddress }:String) [], ParseException + FullyQualifiedErrorId : ScriptsNotAllowed Running the command (Get-DistributionGroup distributiongroup | Get-DistributionGroupMember).PrimarySmtpAddress locally on the remote exchange server obviously works Is there a way I can do it ? thanksSolved34Views0likes1Commentchange the primary address (prefix) distribution list group
change the prefix on the primary address distribution list group how to bulk change primary smtp address distribution list group (before @ / prefix) with powershell? can use csv file? if possible, what is the csv format and how is the script? please help, thank you.Solved226Views0likes6CommentsM365 Exchange & Shared Mailbox Calendar Notifications
M365 Business Premium tenant here. We have a shared mailbox (not resource mailbox) called meetings@ The aim is to have an anonymous email address staff can send out meeting requests to our clients and have a dedicated calandar for those meetings. I've set up the staff members with Receive and SendAs permissions so everyone can set up meetings using that account so that the meeting invite appears to come from meetings@ instead of the staff members email address. Staff can create meetings and the invite is anonymous so that part is working as planned. The problem is, all the staff gets flooded with Accept/Decline messages going to their personal mailboxes. Is there a way to set it so that only the shared mailbox gets the notifications or even supress those messages entirely. I've resorted to email rules for each staff member to either block or divert the messages but I'd really prefer it if there was a one stop shop rahter than having to configure individual's mailboxes to block them. I tried Set-CalendarProcessing -Identity "email address removed for privacy reasons" -RemoveForwardedMeetingNotifications $true -AutomateProcessing AutoUpdate but it didn't seem to do much. Any other ideas?13Views0likes0CommentsExchange Online Powershell get User without Address Book Policy
Hey, I have the following problem. I have a script that assigns users to an ABP based on the attributes Company and Department. function Set-ABPstoUser { Write-StatusLog -Type "SECTION" -Message "Assigne ABPs" -StatusFile $status_file $abps = Get-AddressBookPolicy $counter = 0 foreach ($abp in $abps) { $abpName = $abp.Name $abpCompanyName = $abpName.Split('_')[1] $abpDepartment = $abpName.Split('_')[2] $usersWithCompanyAndDepartment = Get-User -Filter "Company -eq '$abpCompanyName' -and Department -eq '$abpDepartment'" Write-StatusLog -Type "SECTION" -Message "Log of Assigments" -StatusFile $status_file foreach ($user in $usersWithCompanyAndDepartment) { Set-Mailbox -Identity $user.Identity -AddressBookPolicy $abpName Write-Host "Die ABP '$abpName' wurde der Mailbox '$($user.DisplayName)' zugewiesen." $counter++ } Write-StatusLog -Type "COMPLETE" -Message "Log of Assigments" -StatusFile $status_file Write-StatusLog -Type "MESSAGE" -Message "$counter User geht assigned new ABP" -StatusFile $status_file } Write-StatusLog -Type "COMPLETE" -Message "Assigne ABPs" -StatusFile $status_file } There are currently 2 thousand mailboxes, but this number will rise to 50 thousand mailboxes. The script currently takes 8 minutes to assign 2 thousand mailboxes. The problem is that mailboxes that already have an ABP are also touched. This makes the script extremely long and unnecessary. So far I have not been able to filter for mailboxes that do not have an ABP. I have tried the following (the first one throws an error saying it cannot be filtered and the second one runs through all of them without any changes): $usersWithCompanyAndDepartment = Get-User -Filter "Company -eq '$abpCompanyName' -and Department -eq '$abpDepartment' -and AddressBookPolicy -eq `$null" $usersWithCompanyAndDepartment = Get-User -Filter "Company -eq '$abpCompanyName' -and Department -eq '$abpDepartment'" $usersWithoutABP = $usersWithCompanyAndDepartment | Where-Object { $_.AddressBookPolicy -eq $null } $usersWithCompanyAndDepartment = Get-Mailbox -Filter "Company -eq '$abpCompanyName' -and Department -eq '$abpDepartment'" $usersWithoutABP = $usersWithCompanyAndDepartment | Where-Object { $_.AddressBookPolicy -eq $null } Do you have any ideas what can be done? Thank you very much! Luca215Views0likes3CommentsExchangeOnlineManagement v3.5.1 Breaks Application Authentication
We use and provide services that leverage the application authentication method of the ExchangeOnlineManagement PowerShell module. The latest stable version of the module, 3.5.1, breaks this functionality. Additionally, any errors are unavailble as they are now behind a GDPR compliant error message: OperationStopped: IDX12729: Unable to decode the header '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]' as Base64Url encoded string. There does not appear to be a way to disable the PII bit through the PowerShell Module to troubleshoot this either. We have reverted to v 3.5.0 to continue to be able to use our current scripts and processes.454Views0likes2CommentsSet exchange policy with filter?
I am trying to figure out how to run a command to create a exchange online emailadresspolicy. New-EmailAddressPolicy -Name Groups1 -IncludeUnifiedGroupRecipients -EnabledEmailAddressTemplates "SMTP:@santa.mycompany.com","smtp:@santa.mycompany.com" -RecipientFilter {mailNickname -like 'Santa_*'} -Priority 1 I want all groups that are that have a mailnickname that starts with "Santa_" to be created with a specific subdomain. I can not create it tho, i get error that recipientFilter is not a valid attribute. New-EmailAddressPolicy: A parameter cannot be found that matches parameter name 'RecipientFilter'. i have also tried ConditionalCustomAttribute1 but get the same error: anyone able to help?442Views0likes5CommentsHelp using a file for input
Hello everybody, I am currently using this script to automate a process, the problem, is it only processes one user at a time. Add-MailboxPermission -Identity "USERNAME" -User "sa_sourceone" -AccessRights FullAccess -InheritanceType All -AutoMapping $false I would like to pull in entries from a text file for the USERNAME field so I can process more than one at a time. Any help would be appreciated, Thanks.241Views0likes1CommentError - Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException
Error Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Remote name could not be resolved: 'server.proxy.local'496Views0likes1Comment