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)

Wednesday, 13 October 2021

How to Migrate Skype for business on premise users to skype for business online

 As we know that Microsoft have deprecated skype for business online, so we have to connect Microsoft Teams for migration of skype for business on premise users. 

We have to user Skype for business Power shell on the FE server having internet access.

First save the credentials in a variable $cred.

$cred=Get-Credential

then connect to teams:

Type Connect-MicrosoftTeams and enter the credentials

Place the skype HostedMigrationOverrideUrl in a variable $url

$url=https://admin1e.online.lync.com/HostedMigration/hostedmigrationService.svc

Then use the following command

Move-CsUser -Identity nawaz@domain.com -Target sipfed.online.lync.com -Credential $cred -HostedMigrationOverrideUrl $url

then you should get the prompt for confirmation, after entering "Y" the command should be successful and the user should be migrated.

Note: in the skype HostedMigrationOverrideUrl the two yellow highlighted characters (1e) will be different for each organization.

$url=https://admin1e.online.lync.com/HostedMigration/hostedmigrationService.svc

How to restore deleted emails in office 365 through powershell

 You may use different commands, for example you want to restore 1 day emails of a user


New-MailboxSearch -Name "Nawaz11-Oct-DeletedEmails" -SourceMailboxes Nawaz@domain.com -TargetMailbox khan@domain.com -StartDate "10/10/2021" -EndDate "10/10/2021"

Friday, 1 October 2021

How to identify the proxy server in Azure AD Password Protection on premise environment

Environment:

Have Active directory 2016 environment, synchronized with Azure AD. Few months back got a requirement from the management to deploy "Azure AD password protection policy for cloud and on-premise". The deployment was completed successfully.

Issue:

Today the management asked for the detail of servers in this environment.

We know that we had installed the agents on all DCs but we also had one Azure AD Password Protection Proxy server as well but lost its name.

Solution:

Could search in the inventory but the easy/quick way was to run the following command. 

 PS C:\Windows\system32> Get-AzureADPasswordProtectionProxy

ServerFQDN      : ap1.domain.com

SoftwareVersion : 1.2.172.0

Domain          : domain.com    

Forest          : domain.com

HeartbeatUTC    : 10/1/2021 10:27:49 AM

AzureTenant     : domain.com