Wednesday, 12 September 2018

Create activity alerts in the Office 365



Create activity alerts in the Office 365 Security & Compliance Center

You can create an activity alert that will send you an email notification when users perform specific activities in Office 365. Activity alerts are similar to searching for events in the Office 365 audit log, except that you'll be sent an email message when an event for an activity that you've created an alert for happens.

Before you begin

·         You must be assigned the Organization Configuration role in the Security & Compliance Center to manage activity alerts. By default, this role is assigned to the Compliance Administrator and Organization Management role groups. For more information about adding members to role 

Create an activity alert

2.    Sign in to Office 365 using your work or school account.
3.    In the left pane, click Alerts, and then click Manage alerts.
4.    On the Activity alerts page, click Add an alert.

Add an activity alert
5.       Complete the following fields to create an alert:
6.    Click Save to create the alert.
 The new alert is displayed in the list on the Activity alerts page.

A list of alerts is displayed on the Activity alerts page in the Security & Compliance Center

The status of the alert is set to On. Note that the recipients who will received an email notification when an alert is sent are also listed.

Turn off an activity alert

You can turn off an activity alert so that an email notification isn't sent. After you turn off the activity alert, it's still displayed in the list of activity alerts for your organization, and you can still view its properties.
2.    Sign in to Office 365 using your work or school account.
3.    In the left pane, click Alerts, and then click Manage activity alerts.
4.    In the list of alerts for your organization, click the alert that you want to turn off.
5.    On the Edit alert page, click the On toggle switch to change the status to Off, and then click Save.
The status of the alert on the Activity alerts pages is set to Off.


Audit log in the Office 365 Security & Compliance Center



Audit log in the Office 365 Security & Compliance Center



Before you begin
Be sure to read the following items before you start searching the Office 365 audit log.
·         You (or another admin) must first turn on audit logging before you can start searching the Office 365 audit log. To turn it on, just click ** Start recording user and admin activity ** on the Audit log search page in the Security & Compliance Center. (If you don't see this link, auditing has already been turned on for your organization.) After you turn it on, a message is displayed that says the audit log is being prepared and that you can run a search in a couple of hours after the preparation is complete. You only have to do this once.

If you want to turn off audit log search in Office 365 for your organization, you can run the following command in remote PowerShell connected to your Exchange Online organization:
Copy
Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $false
To turn on audit search again, you can run the following command in Exchange Online PowerShell:
Copy
Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true

·         You can search the Office 365 audit log for activities that were performed within the last 90 days.
·         It can take up to 30 minutes or up to 24 hours after an event occurs for the corresponding audit log entry to be displayed in the search results. The following table shows the time it takes for the different services in Office 365.

Search the audit log
Here's the process for searching the audit log in Office 365.
Step 1: Run an audit log search
Step 2: View the search results
Step 3: Filter the search results
Step 4: Export the search results to a file

Step 1: Run an audit log search

1.    Sign in to Office 365 using your work or school account.
2.    In the left pane of the Security & Compliance Center, click Search & investigation, and then click Audit log search.
The Audit log search page is displayed.
1.    Configure the following search criteria:
2.    Activities Click the drop-down list to display the activities that you can search for. User and admin activities are organized in to groups of related activities. You can select specific activities or you can click the activity group name to select all activities in the group. You can also click a selected activity to clear the selection. After you run the search, only the audit log entries for the selected activities are displayed. Selecting Show results for all activities will display results for all activities performed by the selected user or group of users.
Over 100 user and admin activities are logged in the Office 365 audit log. Click the Audited activities tab at the topic of this article to see the descriptions of every activity in each of the different Office 365 services.
3.    Start date and End date The last seven days are selected by default. Select a date and time range to display the events that occurred within that period. The date and time are presented in Coordinated Universal Time (UTC) format. The maximum date range that you can specify is 90 days. An error is displayed if the selected date range is greater than 90 days.

  1. Users Click in this box and then select one or more users to display search results for. The audit log entries for the selected activity performed by the users you select in this box are displayed in the list of results. Leave this box blank to return entries for all users (and service accounts) in your organization.
  2. File or folder Type some or all of a file or folder name to search for activity related to the file of folder that contains the specified keyword. You can also specify a URL of a file or folder. If you use a URL, be sure the type the full URL path or if you just type a portion of the URL, don't include any special characters or spaces.
Leave this box blank to return entries for all files and folders in your organization.
  1. Click Search to run the search using your search criteria.
The search results are loaded, and after a few moments they are displayed under Results. When the search is finished, the number of results found is displayed. Note that a maximum of 5,000 events will be displayed in the Results pane in increments of 150 events; if more than 5,000 events meet the search criteria, the most recent 5,000 events are displayed.

Tips for searching the audit log

·         You can select specific activities to search for by clicking on the activity name. Or you can search for all activities in a group (such as File and folder activities) by clicking on the group name. If an activity is selected, you can click it to cancel the selection. You can also use the search box to display the activities that contain the keyword that you type.


·         You have to select Show results for all activities in the Activities list to display events from the Exchange admin audit log. Events from this audit log display a cmdlet name (for example, Set-Mailbox ) in the Activity column in the results. For more information, click the Audited activities tab in this topic and then click Exchange admin activities.
Similarly, there are some auditing activities that don't have a corresponding item in the Activities list. If you know the name of the operation for these activities, you can search for all activities, then filter the results by typing the name of the operation in the box for the Activitycolumn. See Step 3: Filter the search results for more information about filtering the results.
·         Click Clear to clear the current search criteria. The date range returns to the default of the last seven days. You can also click Clear all to show results for all activities to cancel all selected activities.
·         If 5,000 results are found, you can probably assume there are more than 5,000 events that met the search criteria. You can either refine the search criteria and rerun the search to return fewer results, or you can export all of the search results by selecting Export results > Download all results.

Step 2: View the search results


The results of an audit log search are displayed under Results on the Audit log search page. As previously stated a maximum of 5,000 (newest) events are displayed in increments of 150 events. To display more events you can use the scroll bar in the Results pane or you can press Shift + End to display the next 150 events.
The results contain the following information about each event returned by the search.
·         Date: The date and time (in UTC format) when the event occurred.
·         IP address: The IP address of the device that was used when the activity was logged. The IP address is displayed in either an IPv4 or IPv6 address format.
·         User: The user (or service account) who performed the action that triggered the event.
·         Activity: The activity performed by the user. This value corresponds to the activities that you selected in the Activities drop down list. For an event from the Exchange admin audit log, the value in this column is an Exchange cmdlet.
·         Item: The object that was created or modified as a result of the corresponding activity. For example, the file that was viewed or modified or the user account that was updated. Not all activities have a value in this column.
·         Detail: Additional detail about an activity. Again, not all activities will have a value.

Click More information to view the detailed properties of the audit log event record

Step 3: Filter the search results

To filter the results:
1.    Run an audit log search.
2.    When the results are displayed, click Filter results.
Keyword boxes are displayed under each column header.
3.    Click one of the boxes under a column header and type a word or phrase, depending on the column you're filtering on. The results will dynamically readjust to display the events that match your filter.

Step 4: Export the search results to a file

You can export the results of an audit log search to a comma separated value (CSV) file on your local computer. You can open this file in Microsoft Excel and use features such as search, sorting, filtering, and splitting a single column (that contains multi-value cells) into multiple columns.

Wednesday, 5 September 2018

Moving Individual Mailboxes to Office 365 via PowerShell



Move Individual Mailboxes
Run this command to initiate and run the bulk moves…
New-MoveRequest -Identity "INSERT_USER_ALIAS_HERE" -Remote -RemoteHostName hybridserver.domainname.com -TargetDeliveryDomain domainname.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS -BadItemLimit 1000

Monitor Move Requests
To monitor move requests, run this command…
Get-MoveRequest | Get-MoveRequestStatistics

To remove move requests, run this command…
Get-MoveRequest | Remove-MoveRequest

Moving Bulk Mailboxes in to Office 365

Create User list
The list must be a CSV file (i.e. userlist.csv) and must contain a header named ‘Alias’.
Here is an example of the ‘userlist.csv’ file…
Alias
JohnDoe
JoeSmith
JaneDoe
Connect to Office 365
Run the Bulk Migration
Now, we’ll use the CSV file we created earlier to perform the bulk move.  Make sure the path to the CSV is local.  Run this command to set the variable…
$MAILBOXLIST = Import-CSV "C:\Userlist.csv"
Last, using values based on your environment for the items in red, run this command to initiate and run the bulk moves…
foreach ($line in $MAILBOXLIST) {New-MoveRequest -Identity $line.alias -Remote -RemoteHostName hybridserver.domainname.com -TargetDeliveryDomain domainname.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS -BadItemLimit 1000}
Monitor Move Requests
To monitor the mailbox moves, run this command…
Get-MoveRequest | Get-MoveRequestStatistics
To remove mailbox move requests, run this command…
Get-MoveRequest | Remove-MoveRequest
Good luck

Monday, 3 September 2018

Office 365 - Manage User Account with Powershell

To view details about the Office 365 services that are available in all of your license plans, run the following command:

Get-MsolAccountSku | Select -ExpandProperty ServiceStatus

To view details about the Office 365 services that are available in a specific licensing plan, use the following syntax

(Get-MsolAccountSku | where {$_.AccountSkuId -eq "<AccountSkuId>"}).ServiceStatus

To find the unlicensed accounts in your organization, run the command

Get-MsolUser -All -UnlicensedUsersOnly


To find accounts that don't have a UsageLocation value, run the command 

Get-MsolUser -All | where {$_.UsageLocation -eq $null}

To assign a license to a user, use the following syntax in Office 365 PowerShell:

Set-MsolUserLicense -UserPrincipalName "<Account>" -AddLicenses "<AccountSkuId>"

To assign a license to many unlicensed users, use the following syntax:

$x = Get-MsolUser -All -UnlicensedUsersOnly [<FilterableAttributes>]; $x | foreach {Set-MsolUserLicense -AddLicenses "<AccountSkuId>"}

This example assigns those same licenses to unlicensed users in the Sales department in the United States.
$USSales = Get-MsolUser -All -Department "Sales" -UsageLocation "US" -UnlicensedUsersOnly; $USSales | foreach {Set-MsolUserLicense -AddLicenses "litwareinc:ENTERPRISEPACK"}