Sunday, 30 January 2022

To show complete value of a property of a user without ...

Some time you want to see the value of an attribute of a user/mailbox through powershell command but the output you getting would be in ... at the end. so to get the complete value, should run the following command. 
Get-mailbox nawaz.khan* | select-object -expandproperty EmailAddresses

Thursday, 6 January 2022

Resolved: pick an account + there was an issue with forgetting user@domain.com. please try later

My outlook app on on mobile device was not connecting to my office 365 mailbox as i had recently changed my UserPrinciple name and primarySMTPAddress in office 365, as it was business requirement.

Tried to reset my account but no luck.

Tried to forget my old account but no luck, getting the following error in the outlook app.  

pick an account + there was an issue with forgetting nawaz@olddomain.com, please try later

Tried to add the account with the new smtp address (nawaz@newdomain.com) but no luck, as it again and again asking for the credentials and picking to that old smtp address (nawaz@olddomain.com)

At the end, open the company portal app and found that there was no user signed in. 

so in the company portal app , re-sign in with new PrimarySMTPaddress nawaz@newdomain.com. once the new address verified there, was able to add the office 365 account in the outlook App.

Wednesday, 5 January 2022

Your archive mailbox is almost full

  1. Connect to Exchange Online Powershell.
  2. Run the following commandlet for the user: Enable-Mailbox <user mailbox> -AutoExpandingArchive
  3. Run the following commandlet to confirm it is enabled for the user: Get-Mailbox <user mailbox> | FL AutoExpandingArchiveEnabled

 

As per below example:

Connect-ExchangeOnline

then run the following command to confirm the current "AutoExpandingArchiveEnabled" status. if it is not enabled/false. 

Get-Mailbox nawaz@domain.com| FL AutoExpandingArchiveEnabled

AutoExpandingArchiveEnabled : False


Lets enable it true with the following command.

PS C:\Users\Nawaz> Enable-Mailbox nawaz@domain.com -AutoExpandingArchive

Name                      Alias           Database                       ProhibitSendQuota    ExternalDirectoryObjectId

----                      -----           --------                       -----------------    -------------------------

nawaz     EURPdfR07DG198-db121             99 GB (106,300,44... 788cddcf3-f92f-4497-b95c-2b1dcea6982dff


And lets check it again.

PS C:\Users\Nawaz> Get-Mailbox nawaz@domain.com | FL AutoExpandingArchiveEnabled

AutoExpandingArchiveEnabled : True


To force the MFA (Managed Folder Assistant) to immediately process a specified mailbox

run 

Start-ManagedFolderAssistant -Identity nawaz@domain.com

Saturday, 25 December 2021

How to export office 365 mailbox in PST format

 Go to 

Content search - Microsoft 365 compliance

Then Content Search-->on Search--> Start Search with .+New Search--->Enter Name and description--->next-->select Location--it may be Exchange (You can include here the mailbox you want to search )/SharePoint sites/Exchange Public Folder--->Next-->can apply different conditions here, like sender/date/recipients etc...--->Next----> Review the search---click on submit

now you can monitor the status of Search in the Search tab, it may be in starting/completed etc. status.

and once completed, click on it and at the bottom click on Action and select Export result.

Now go to Export tab and here you will see your search name as the nameofSearch_Export.

Another window will open and here in the mid of the window, will see the status as preparing data/completed etc. and may wait for the status to be completed or you can start the download. To start The download, from the top of the window click on download result.

A small window of eDiscovery export tool will open, asking for Export key and location on your system where you want to save the result.

in the eDiscovery tool you can monitor the status of the download and once completed you may have a folder at the downloaded locations like (D:\Nawaz\SearchName_Export\12.25.2021-1659PM\Exchange) 

here you will find your pst file/files.


 



Friday, 17 December 2021

To Add another email address to a mailbox in office 365

 To Add another email address to a mailbox in office 365, you would be unable to do some from office 365/Exchange online in Exchange hybrid environment.

You have to run the following command from on premise exchange server. and then run the directorysync from directory  sync server/tool.


Set-remoteMailbox -Identity "Nawaz.Q2" -EmailAddresses@{add="nawaz.q2@pt4.onmicrosoft.com"}

Wednesday, 1 December 2021

How much emails received by each user in last one month in exchange server 2016

 To find How much emails received by each user in last one month in exchange server 2016

Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited -Start "10/23/2021 09:00:00" -End "11/23/2021 09:10:00" | where{$_.Recipients -like "*@mydomain.com"} | Group-Object -Property Sender | Select-Object name,count | sort count -desc | ft -auto >c:\path\EmailCountRecipt.csv

Tuesday, 23 November 2021

How much emails sent by each user in exchange server 2016

I used the following command to generate a report, have count of the number of emails sent by each user.

Note: it also had the email sent by external users (hotmail.com/gmail.com) so i had to remove those send from the report and leave only the internal users. 


Get-transportservice | Get-MessageTrackingLog -Start (Get-Date).adddays(-1) -EventId "send" -ResultSize unlimited | Group-Object sender | ft name, count >c:\path\AllSendcount.csv

Or you we can use the following command so only email sent by a specific domain's users will exported

Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited | where{$_.sender -like "*@domain.com"} | Group-Object -Property Sender | Select-Object name,count | sort count -desc | ft -auto >c:\path\EmailCount23Nov21.csv


To get number of emails in last one day or hour

(get-TransportServer | Get-MessageTrackingLog -Start (Get-Date).adddays(-1) -EventId "send" -ResultSize unlimited | where{$_.sender -eq "myemail@domain.com"}).count


(get-TransportServer | Get-MessageTrackingLog -Start (Get-Date).addhours(-1) -EventId "send" -ResultSize unlimited | where{$_.sender -eq "myemail@domain.com"}).count



Searching Message Tracking Logs by Sender or Recipient Email Address (practical365.com)