How to search notes deleted in Exchange 2016


If the notes disappear from your outlook and you can’t find them, execute the follow command in Exchange Power Shell:
PS C:\> Search-Mailbox agonzalez -SearchQuery kind:Notes -TargetMailbox “Support” -TargetFolder “Recover” -LogLevel full -LogOnly
The switch –logonly means you are not going to copy the information, only you want to know if the notes are in the mailbox. You will have a result something like this:
ResultItemsCount : 134
Then you can remove the –logonly switch and copy the information to the target folder:
PS C:\> Search-Mailbox agonzalez -SearchQuery kind:Notes -TargetMailbox “Support” -TargetFolder “Recover” -LogLevel full 
In this case I used the support mailbox creating a new folder called Recover where I will copy the information from agonzalez.


Some special operators in PowerShell: $($Variable), @( ), &, S_., %, ?

There are some operators that they are not common in PowerShell and we have problems to figure out the logic when we are reading a script written by another person.

For example $($Variable) operator. This is a subexpression operator that always will evaluate first the expression contained into the parenthesis and return the value as an array, and therefore you can use this information directly. Let’s see the follow example:

$c = Aduser 430001150
The variable $C contains all the information for this Active Directory object, and therefore If I want to know only the first name and last name I can write this:

Write-Host “The firstname is: $($c.GivenName)-ForegroundColor Yellow
Write-Host “The firstname is: $($c.Surname)-ForegroundColor Yellow
And the output will be:
The first name is: Tony
The last name is: Gonzalez

@() Array expression

Returns the result of one or more statements as an array, when you have the construct @() you are creating an array without any elements at all. Otherwise, if you add elements to the array they will have an index;

$array = @()   #We declare this variable as array
$array = @(1,2,5,6,9,”Hello”,”World”)   #We are adding elements to the array, the first element has the index 0, in this case has the value 1.
If we want to know what information contains this array:

PS C:\> $array
& Call operator. We use this operator to run a command, script, or script block. For example:

PS C:\> $b = “Get-ChildItem”
If we execute this value to see the result, will be the string stored in quotes.

PS C:\> $b
But if we put the call operator & we are going to get another result

PS C:\> & $b
    Directory: C:\
Mode                LastWriteTime     Length Name                                                                                                                                                
—-                ————-     —— —-                                                                                                                                                 
d—-         12/7/2016   2:52 PM            Dell                                                                                                                                                  
% Is an Alias for the command let ForEach-Object is a loop who returns each pipeline object one after the other. Which means that you can use both in a sentence.

? Is an alias for the command let Where-Object. We use this sentence to select an object from a collection.

In both aliases we can use $_. To reference to a filed into the result. For example:

PS C:\> Get-ChildItem “C:\” | ?{$_.Name -eq “temp”}
    Directory: C:\
Mode                LastWriteTime     Length Name                                  
—-                ————-     —— —-                                  
d—-          2/1/2018  11:51 AM            temp                                   

These are only some of the operator that sometimes we do not know how they mean when we are analyzing a script that has been created by another person, but obviously, there are much more. 

I will put another post with a little more. 

Error in skype for business “Create skype meeting failed. Please make sure that Skype for Business is running and signed-in and try again”

Error in Skype for business “Create Skype meeting failed. Please make sure that Skype for Business is running and signed-in and try again”
I saw an error when a user with outlook 2016 and windows 10 tried to create a Skype meeting and this message error showed up.

After check the policies configured for this user in the server, I thought it was an outlook issue related, because all policies were configured correctly.

My Troubleshooting was:
  • The first step check the Add in in outlook and verify if it was enabled. The add in was already enabled and the issue persists.
  • The second was recreate outlook and Skype profiles but the problem still was there.

As the user has two pools in Skype, I moved the user to the second pool and it solved the problem.

Now the user is able to create Skype meetings from outlook.

I hope this information helps.