How to check last run of Mailboxes’ Managed Folder Assistants.

WrongRetentionPolicy.jpg

Let’s say you have published wrong retention policy and you would like to check which mailboxes got this policy applied. To check when the last run of Mailboxes’ Managed Folder Assistant took place you might use below simple script – it is a mess but I’m sure you guys will retrieve from it what you want ^^.

Continue reading “How to check last run of Mailboxes’ Managed Folder Assistants.”

Advertisements

Outlook and huge OST file growing like crazy till reaching 50GB.

It has been few days since I was working on one case – OST file of one user was growing till 50GB at exponential speed despite mailbox had 5GB.

Case was really weird, what I did I added all of the shared mailboxes as additional accounts so I was able to turn off caching and put this particular mailbox in Online mode and recreated the profile – that didn’t help.

Well, I noticed that there were some sync issues (not much) – so I moved the mailbox to another database as move might omit some corrupted messages leaving user mailbox in healthy status in the target database – that didn’t help either.

So I took a completely separate computer, asked user to logged in there and enabled the cache mode – after weekend we had same issue.

I was like:

Brb_gonna_hang_myself

Continue reading “Outlook and huge OST file growing like crazy till reaching 50GB.”

[Exchange Online] Remove cancelled Outlook meetings using PowerShell and EWS!

Essay_Start

Actually it is 23:13 CEST, but still!

Some time ago I have published a script to remove cancelled calendar meetings from Exchange OnPremise (I have tested that on Exchange 2010).You can find this script here:

https://paweljarosz.wordpress.com/2016/05/04/remove-cancelled-meetings-using-powershell-and-ews/

I am currently at the end of the migration to Exchange Online from Exchange 2010 environment. Few days ago I had a call telling me that seems that the cancelled meetings are not being removed from room calendars as they supposed to be.

Yup, I forgot to rewrite the script…

TimeToPanic

Continue reading “[Exchange Online] Remove cancelled Outlook meetings using PowerShell and EWS!”

Match and Like shows that string has “$”,”*” and “?” while it doesn’t.

“Microsoft Office 365: Exchange Online Implementation and Migration” tells that we need to check following users’ attributes in regards to occurrence special characters:

    sAMAccountName: Invalid character examples are !, #, $, %, ^, &, {, }, \, /, `, ~, “, [, ], :, @, <, >, +, =, ;, ?, and *
    displayName: Invalid character examples are ?, @, and +
mail: Invalid character examples are [, !, #, $, %, &, *, +, \, /, =, ?, ^, `, {, }, and ]
    mailNickname: Invalid character examples are “, \, /, [, ], :, >, <, ;, and spaces
    proxyAddresses: Invalid character examples are [, !, #, $, %, &, *, +, \, /, =, ?, ^, `, {, }, and ]
userPrincipalName: Invalid character examples are }, {, #, ‘, *, +, ), (, >, <, \, /, =, ?, and `

Well, you agree that nothing easier. So I wrote a simple script that was checking for it, but to my surprise, I noticed that in 3 of the attributes I was getting “$”, “*” and “?” characters. But attributes definitely didn’t have that value, so I replaced “-match” with “-like” in the script.

Well, it was better but still not brill. I  was still getting $ and *. But the ? char was not being reported. I started to think what the hell is wrong felling a bit like:

ezgif.com-crop

I was using “-match” and “-like” all the time in scripts, I was shocked it was messing around with me. So I started to check if there are any other way to compare if char exist in a string. And there it was! Totally forgot about “contains” operator/method!

Changed all my “matches” and “likes” to “-contains” and taaaddaaam 🙂 All worked like a charm!

Answer to question why it might have not worked can be found for example under here:

http://www.tjrobinson.net/?p=109

Tom is telling there that:

-contains is designed to work on arrays, not strings (referred to as a containment operator)
-match looks for a match inside a string and supports regexes
–like looks for a match inside a string and supports wildcards

And here is the thing, my solution was about to check if string, ex. “mail” contains: one of [, !, #, $, %, &, *, +, \, /, =, ?, ^, `, {, }, ] . Syntax was:

$Characters_To_Check = @(“[“, “!”, “#”,”$”, “%”, “&”, “*”, “+”, “\”, “/”, “=”, “?”, “^”, “`”, “{“, “}”, “]”)

$String_To_Check = “$User.mail”

Foreach ($Character in $Characters_To_Check ) {

if ($String_To_Check -match $Character) {Do things}

}

because “match” and “like” operators support regex and wildcards, they were treating these special characters as these. Only contains was working properly in that particular case.

 

Repairing content index on database without DAG.

Repairing Content Index on DAG server can be easily done with Update-MailboxDatabaseCopy with switch -CatalogOnly.

But how to repair Content Index when there is no other DB copy?

Well, here is the great article:

https://theucguy.net/fix-corrupted-content-index-catalog-of-a-mailbox-database-with-single-copy/

On Exchange 2007 and Exchange 2010 there is ResetSearchIndex.ps1 script, which is placed in $exscript folder.

On Exchange 2013 there is no such script, so the only solution is to simply recreate the CI folder. To rename it/remove it, 2 services Microsoft Exchange Search and Microsoft Exchange Search Host Controller would need to be stopped.

IIS iisreset, recycle, refresh and restart – what are the differences?

Have you ever wondered what is the difference between iisreset, recycle, refresh and restart?

 

Here is great post that answers all the questions:

http://serverfault.com/questions/247425/what-is-the-difference-between-iisreset-recycle-refresh-and-restart

 

Vlad Mucescu explains that:

“As pointed out, iisreset will stop and start the World Wide Web Publishing Service. This, of course, applies to all of your application pools. I’m sure you noticed a process being created for each application pool. This process will handle requests for all websites associated with it. When you recycle an application pool, IIS will create a new process (keeping the old one) to serve requests. Then it tries to move all requests on the new process. After a timeout the old process will be killed automaticaly. You usualy recycle your application pool to get rid of leaked memory (you might have a problem in your application if this needs to be a regular operation, even though it is recommended to have a scheduled recycle). As for restarting a website, it just stops and restarts serving requests for that particular website. It will continue to serve other websites on the same app pool with no interruptions.

If you have a session oriented application, all of the above will cause loss of session objects.

Refreshing a websites has no effect on the service/process/website and is meerly a UI command to refresh the treeview (maybe you added a directory you don’t see in the management console).”