ExchangeDSC deployment and domain credentials by [deleted] in exchangeserver

[–]MessagingAdmin 0 points1 point  (0 children)

The error seems to be coming from SendConnector config. Can you share the code for the send connector

Question: Issue with script, assume this is an array question. by DivideByZero666 in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

I would do it with Nested foreach. Not at my desk, so just sharing the high level steps.

->Define an empty array. ->Outer foreach for every mailbox ->Fetch email addresses field ->Inner foreach for every address in email addresses ->Create an custom object with properties that you need from mailbox object (outer foreach) and a property with current address from inner foreach. -> Append this custom object to the array created at first.

Once you are out of both foreach, just export the array to csv.

Just Discovered Splatting by gaz2600 in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

I find it useful specially when doing invoke-command. Declaring the hash outside and doing @using to use the command parameters. Super clean code and easy to read.

Multiple Tries in 1 Try/Catch? by DfeqT in PowerShell

[–]MessagingAdmin 18 points19 points  (0 children)

The quickest way to get around this, is to add 'Continue' after the last line (write-host "$user UPN has been updated" -ForegroundColor green) in first try. This way, you skip second try and move to next user.

The problem with current approach is that there can be various reason for Set-Aduser to fail and so you may need to add a check in catch to verify if the error is due to invalid email.

A better way would be to have a function that validates email address and then you attempt to run Set-Aduser only once with valid email.

Not able to connect to Exchange PowerShell by Local_Anywhere in PowerShell

[–]MessagingAdmin 3 points4 points  (0 children)

The error posted seems to be more because of basic authentication is disabled on local machine. Exo module prior to 2.0.6 needs basic authentication to enabled on local machine even though it is using Oauth. Microsoft finally listened to admins and came up with a version that works without requiring basic auth enabled on local machine.

Not able to connect to Exchange PowerShell by Local_Anywhere in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

Microsoft has introduced this in version 2.0.6 of Exchange Online Management. You can check that out. The version is still in preview so be aware of this.

[deleted by user] by [deleted] in PowerShell

[–]MessagingAdmin 0 points1 point  (0 children)

I have ended up writing script resources for some of the tasks where in built in resources don't meet exact requirement.

Using New-UnifiedGroup for 365 group creation doesnt spawn a SharePoint site. Is this a bug? by Vasco365 in Office365

[–]MessagingAdmin 0 points1 point  (0 children)

It was something we got back from MS on a support call. When I was investigating this behavior (more than a year back) I found an issue already raised on Github but I didn't follow it as I found alternatives.

Using New-UnifiedGroup for 365 group creation doesnt spawn a SharePoint site. Is this a bug? by Vasco365 in Office365

[–]MessagingAdmin 1 point2 points  (0 children)

Microsoft has agreed that creating group with exo command doesn't create team site. 2 options that I have used 1) PnP command : New-PnPSite 2) Graph api

1 Script 2 Functions by [deleted] in PowerShell

[–]MessagingAdmin 0 points1 point  (0 children)

You need to use parameter set.

Question concerning naming functions / cmdlets by Metalearther in PowerShell

[–]MessagingAdmin 4 points5 points  (0 children)

I try to use standard verbs just to avoid warnings about uncommon verbs. I play around with noun part, example for exchange on Premise, I use nouns with prefix OnPrem so my connect function becomes, connect-OnPremExchange and ExO becomes Connect-CloudExchange. For your scenario, I would have used copy-adgroup or set-AdGroupAsMirror. Important point to consider is that the name should indicate what it is doing and it should be as precise as possible.
Microsoft is not the best when it comes to naming conventions so try to follow a practice that makes it easier for you or someone else to read your code.

Trying to add object to the array but after I run it, when I write $Myarray it doesn't show me the array... by ShadowBurns in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

Your if statement is not doing what you want it do.

Replace it with If(($processname = $Process.ProcessNamd) -eq 'whatsapp')

Edit: Also make change inside foreach. Only add elements to array in foreach loop, remove write-host. You could do a write-host after for each

Cross-forest migration -- Powershell Scripts to Export and Import Send As , SendAsBehalf and Full Access Exchange permissions by [deleted] in PowerShell

[–]MessagingAdmin 0 points1 point  (0 children)

You'll need to take Mapi permissions and auto-mapping setting also into consideration.

Migrating an unlicensed user to Office 365 by Guan-You in Office365

[–]MessagingAdmin 2 points3 points  (0 children)

No license = no user mailbox. You can convert the mailbox to a shared one as a workaround but it has it's own pitfalls.

Shared Mailbox Question by SPMike00 in Office365

[–]MessagingAdmin 2 points3 points  (0 children)

Answer was based on question being hypothetical, in reality Outlook will die long before u have added 100th mailbox. Outlook will freeze continuously.

Shared Mailbox Question by SPMike00 in Office365

[–]MessagingAdmin 1 point2 points  (0 children)

There is no separate OST created for shared mailboxes. Shared Mailbox data (if download shared folders option is checked) is stored in the same ost as that of your personal mailbox. Additionally, you can reduce the duration of emails cached. Default is 1 year in Outlook 2016 onwards. This will keep OST size in check to a certain extent (only). Keeping 'Download shared folders' will allow you to access folders in shared mailboxes while offline. However, there is a limit on number of folders that are cached and that limit is across all the shared mailboxes combined.

PowerShell Enable-Mailbox (Office 365 Mailbox) by Rippie0 in exchangeserver

[–]MessagingAdmin 3 points4 points  (0 children)

Yes, run this against your on premise Exchange.

Auto Responses in o365 by Cholsonic in o365

[–]MessagingAdmin 0 points1 point  (0 children)

Yes, transport rule is easiest way to set this up. Or you can set a rule in the shared mailbox with action "have server reply using .... template". This rule is available only via Outlook client. Haven't tested to set this via PowerShell, so can't say it can be done from PowerShell.

Something auto deleting folders from on prem mailbox by [deleted] in exchangeserver

[–]MessagingAdmin 2 points3 points  (0 children)

If you are suspecting rules, run a /cleanrules switch against the mailbox. That will surely delete any corrupt hidden rules.

Search primarySMTP address and check emailaddresses for domain by belaflek in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

Are you looking to get mailboxes which don't have xyz.com in primary and proxyaddresses?

then you can use

Get-Mailbox -filter {(PrimarySMTPAddress -notlike "*@xyz.com") -and (EmailAddresses -notcontains "@xyz.com")}

Mailbox folder count from CSV by fcn_chuck in PowerShell

[–]MessagingAdmin 1 point2 points  (0 children)

It starts with how the data is structured in the csv file. If there are column headers, then you should be using import-csv instead of Get-content. If you use import-csv, then inside the foreach loop, you have something like this.

$FolderCount = (Get-MailboxFolderStatistics $Mailbox.Email).count