Showing posts with label o365issues. Show all posts
Showing posts with label o365issues. Show all posts

Friday, March 26, 2021

How to Update Office 365 Groups Primary Email Address

How to Update Office 365 Groups Primary

 Email Address


How to Update the primary SMTP address of Office 365 Groups.

To do this, we must use PowerShell as it is not possible to change the email address of such group using the EAC.

First, we connect to Exchange Online PowerShell, and then we need to use the *-UnifiedGroup cmdlet.

To retrieve the list of groups that need to be updated, we use the following code:

Get-UnifiedGroup -ResultSize Unlimited | Where {$_.PrimarySmtpAddress -like "*tenantname.onmicrosoft.com"}


To update the primary SMTP address of an Office 365 Group, we use the Set-UnifiedGroup cmdlet with the PrimarySmtpAddress parameter:

Set-UnifiedGroup “Test Group” -PrimarySmtpAddress “test.group@nunomota.pt”

 

For E.g.

1.  Run the below command to add required SMTP address as an alias.

Set-UnifiedGroup -Identity "X" -EmailAddresses: @{Add ="Y"}

here X is the Display Name of Office 365 group and Y is the required Email ID.

Set-UnifiedGroup -Identity Test o365Group" -EmailAddresses: @{Add ="test.o365group@abcd.com"}

2. Promote alias as a primary SMTP address,

Set-UnifiedGroup -Identity "Test O365Group" -PrimarySmtpAddress "test.o365group@abcd.com"

3. If not required, you can remove first ID using below command.

Set-UnifiedGroup -Identity "Test o365Group" -EmailAddresses: @{Remove="test.o365group@abcd.onmicrosoft.com"}

Friday, March 5, 2021

PowerShell Code: Find Users with Email Address From a Specific Domain

Searching Email addresses with a specific domain name suffix Using PowerShell | Office 365 


Find Users with Email Address From a Specific Domain


Get-Mailbox -ResultSize Unlimited | Where-Object {($_.EmailAddresses -like "*@YourDomain.Com*")}


Command may take long to run as it will run on your Tenant completely. 

Use | Export-CSV Command to extract the output to the CSV File. 

How to use mailbox audit logs in Office 365

Summary

In Microsoft Office 365, you can run mailbox audit logs to determine when a mailbox was updated unexpectedly or whether items are missing from a mailbox. You may have to do this, for example, if items are moved or if they're deleted unexpectedly or incorrectly.

For the vNext environment, please note that mailbox audit logs are not enabled by default and need to be turned on for a user before beginning a search

How to run and check mailbox audit logs

Mailbox audit logging lets users obtain information about actions that are performed by non-owners and administrators. Mailbox audit logging is available to members of the Audit Reporting Mailbox self-service group only by using Windows Remote PowerShell.


Step 1: Run the script

To run the script, follow these steps:

  1. Start Notepad, and then copy the following code into the file. The code uses the search-mailboxAuditLog command that is part of Microsoft Exchange Server.

Copy Below: 

param ([PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)]
[string]$Mailbox,
[PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)]
[string]$StartDate,
[PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)]
[string]$EndDate,
[PARAMETER(Mandatory=$FALSE,ValueFromPipeline=$FALSE)]
[string]$Subject,
[PARAMETER(Mandatory=$False,ValueFromPipeline=$FALSE)]
[switch]$IncludeFolderBind,
[PARAMETER(Mandatory=$False,ValueFromPipeline=$FALSE)]
[switch]$ReturnObject)
BEGIN {
  [string[]]$LogParameters = @('Operation', 'LogonUserDisplayName', 'LastAccessed', 'DestFolderPathName', 'FolderPathName', 'ClientInfoString', 'ClientIPAddress', 'ClientMachineName', 'ClientProcessName', 'ClientVersion', 'LogonType', 'MailboxResolvedOwnerName', 'OperationResult')
  }
  END {
    if ($ReturnObject)
    {return $SearchResults}
    elseif ($SearchResults.count -gt 0)
    {
    $Date = get-date -Format yyMMdd_HHmmss
    $OutFileName = "AuditLogResults$Date.csv"
    write-host
    write-host -fore green "Posting results to file: $OutfileName"
    $SearchResults | export-csv $OutFileName -notypeinformation -encoding UTF8
    }
    }
    PROCESS
    {
    write-host -fore green 'Searching Mailbox Audit Logs...'
    $SearchResults = @(search-mailboxAuditLog $Mailbox -StartDate $StartDate -EndDate $EndDate -LogonTypes Owner, Admin, Delegate -ShowDetails -resultsize 50000)
    write-host -fore green '$($SearchREsults.Count) Total entries Found'
    if (-not $IncludeFolderBind)
    {
    write-host -fore green 'Removing FolderBind operations.'
    $SearchResults = @($SearchResults | ? {$_.Operation -notlike 'FolderBind'})
    write-host -fore green 'Filtered to $($SearchREsults.Count) Entries'
    }
    $SearchResults = @($SearchResults | select ($LogParameters + @{Name='Subject';e={if (($_.SourceItems.Count -eq 0) -or ($_.SourceItems.Count -eq $null)){$_.ItemSubject} else {($_.SourceItems[0].SourceItemSubject).TrimStart(' ')}}},
    @{Name='CrossMailboxOp';e={if (@('SendAs','Create','Update') -contains $_.Operation) {'N/A'} else {$_.CrossMailboxOperation}}}))
    $LogParameters = @('Subject') + $LogParameters + @('CrossMailboxOp')
    If ($Subject -ne '' -and $Subject -ne $null)
    {
    write-host -fore green 'Searching for Subject: $Subject'
    $SearchResults = @($SearchResults | ? {$_.Subject -match $Subject -or $_.Subject -eq $Subject})
    write-host -fore green 'Filtered to $($SearchREsults.Count) Entries'
    }
    $SearchResults = @($SearchResults | select $LogParameters)
    }
  1. On the File menu, click Save As.

  2. In the Save as type box, click All File.

  3. In the File name box, type Run-MailboxAuditLogSearcher.ps1, and then click Save.

  4. Start Windows PowerShell, and then connect to Windows Remote PowerShell.

  5. Locate the directory in which you saved the script, and then run the script.

 Note

  • If you run the script without parameters, you will be prompted for the following default parameters:
    • Mailbox
    • StartDate
    • EndDate
  • To search for entries from the current day, add one day to the end-date value in the prompt window. For example, if the current date is 3/14/2017, and you want to include the current day in your search, enter 4/15/2017  as the end date.

Thursday, March 4, 2021

Remote Server returned '550 5.7.520 Access denied, Your organization does not allow external forwarding

Delivery has failed to these recipients or groups:

Your message wasn't delivered because the recipient's email provider rejected it.

Remote Server returned '550 5.7.520 Access denied, Your organization does not allow external forwarding. Please contact your administrator for further assistance. AS(7555)


If you have received above error recently in an NDR, Check below settings and make changes as suggested to start the mail flow as usual. 


What caused it: Oct 2020: MC221119: Office 365 ATP External email forwarding controls and policy change


Above Policy Changes your Rules for automatic external forwarding in your Outbound Spam Filter Policy.


Which is by default set to AUTOMATIC - That blocks automatic external forwarding
  • Automatic: Automatic external forwarding is blocked. Internal automatic forwarding of messages will continue to work. This is the default setting.

  • On: Automatic external forwarding is allowed and not restricted.
  • Off: Automatic external forwarding is disabled and will result in a non-delivery report (also known as an NDR or bounce message) to the sender.
In order to fix this issue, change your Policy from AUTOMATIC to ON. 

Changing policy setting to ON will allow Automatic External Forwarding that is been set on your Email Addresses inside your O365 Tenant.

Thursday, September 24, 2020

Shared Mailbox or Distribution List

This article will set out the differences between a Shared Mailbox and a Distribution Group to help you choose which is the right option for you.


1. Shared Mailbox

  • A Shared Mailbox is a separate mailbox that users can be given access to. This mailbox has its own Inbox, Drafts, Sent Items but cannot be a user's primary mailbox.
  • Users who are given Full Access to a Shared Mailbox will see this mailbox in Outlook underneath their own Inbox and other folders on the left hand side of the screen (shown below).


  • A single copy of any emails sent to the Shared Mailbox's email address will be stored in the Shared Mailbox's Inbox and can be read by any user with access.
  • Users can also be given Send As permissions which will allow them to change the address in the From field of an email they write. This will send the email from the Shared Mailbox's address.
  • Deleting an email from a Shared Mailbox will delete the email for all users who have access to the mailbox.
  • Shared Mailboxes cannot be accessed on a mobile phone, only in the Outlook application on a PC or OWA in a web browser.

 

2. Distribution List


  • Users in a Distribution List will receive their own copy of any emails sent to the Distribution List's address.
  • When replying to an email received through a Distribution List, the reply will be sent with the user's email address. Mail can NOT be sent from the Distribution List's address.
  • Deleting an email received through a Distribution List will delete the email only for the user who deletes the email.

     



Friday, June 26, 2020

SHAREPOINT - DELETED AND RECREATED USER DOESN’T HAVE PERMISSIONS TO SITE, ACCESS DENIED! Reused email causes SharePoint Issue

SHAREPOINT  - DELETED AND RECREATED USER DOESN’T HAVE PERMISSIONS TO SITE, ACCESS DENIED! Reused email causes SharePoint Issue

Problem

When onboarding a new employee for a customer, we ran into an issue when giving the new user access to sites in SharePoint. Assigning the license to the user and initially adding her to SharePoint went smoothly. But when it came to giving her site permissions (in the site settings), we ran into an issue.

The actual process of adding her to sites appeared to work – until you refreshed the user lists on that site. She wasn’t actually being added. We went through the process a few times, with the same result.

That’s when we noticed something funny – the new user wasn’t being added. An old user, however, WAS being added.

Root Cause 

It turns out – the old user being added was the key to figuring out what was going on.

This customer uses the first name@company for their email addresses and Office 365 aliases. The customer previously had an employee with the same name and the same email address who was no longer at the company.

When trying to add the new user, SharePoint was associating the email with the old user (who previously used on SharePoint) and pulling her in rather than the new user.

The old user had been deleted entirely from their Office 365 tenant. For some reason, despite that, the user wasn’t deleted entirely from SharePoint. When we talked to Microsoft, we were told it was a glitch in their system. Not great news, but it did mean there wasn’t anything we (or the customer) could’ve done differently while offboarding the old user.

How to Fix

This turned out to be an easy fix once the root problem was discovered. We just had to completely delete the old user from SharePoint.

To do this, we had to bring up the list of ALL users for each SharePoint site. The easiest way to get to this list is by replacing the last number In the URL for the site with zero. Once we were on that screen, we deleted the old user from each site (this had to be done individually).

Once the old user was deleted, the new user was added to the sites using the normal method.

  1. Browse to the site and edit the URL by adding the following string to the end of it: /_layouts/15/people.aspx?MembershipGroupId=0

    For example, the full URL will resemble the following: https://fabrikam.sharepoint.com/_layouts/15/people.aspx/membershipGroupId=0

  2. Select the person from the list, and then on the Actions menu, select Delete Users from Site Collection.

  3. Now add the user again following normal process & now the new profile should get picked up. 


Above issue occurs due to mismatch in PUID - Read More

Clear browser history

SharePoint uses browser caching in several scenarios, including in the people picker. Even when a user is fully removed, he or she may still remain in the browser cache. Clearing the browser history resolves this issue. For info about doing this in Edge,

Restore SharePoint Deleted Site

Restore SharePoint Deleted Site

When you delete a user in the Microsoft 365 admin center (or when a user is removed through Active Directory synchronization), the user's OneDrive will be retained for the number of days you specify in the OneDrive admin center. (For info, see Set the default file retention for deleted OneDrive users.) The default is 30 days. During this time, shared content can still be accessed by other users. At the end of the time, the OneDrive will be in a deleted state for 93 days and can only be restored by a global or SharePoint admin.

For info about using Files Restore to restore a OneDrive to a previous point in time, see Restore your OneDrive.

For info about restoring items from the recycle bin in OneDrive, see Restore deleted files or folders.

Restore a deleted OneDrive when the deleted user no longer appears in the Microsoft 365 admin center

If the user was deleted within 30 days, you can restore the user and all their data from the Microsoft 365 admin center. To learn how, see Restore a user in Microsoft 365. If you deleted the user more than 30 days ago, the user will no longer appear in the Microsoft 365 admin center, and you'll need to use PowerShell to restore the OneDrive.

  1. Download the latest SharePoint Online Management Shell.

     Note

    If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."
    On the Download Center page, select your language and then click the Download button. You'll be asked to choose between downloading a x64 and x86 .msi file. Download the x64 file if you're running the 64-bit version of Windows or the x86 file if you're running the 32-bit version. If you don't know, see Which version of Windows operating system am I running?. After the file downloads, run it and follow the steps in the Setup Wizard.

  2. Connect to SharePoint as a global admin or SharePoint admin in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell.

  3. Determine if the OneDrive is available for restore

  • If you know the URL of the OneDrive, run the following command:
PowerShell
Get-SPODeletedSite -Identity <URL>
A user's OneDrive URL is based on their username. For example, 
https://microsoft-my.sharepoint.com/personal/user1_contoso_com. You can find their username on the Active users (or Deleted users) page in the Microsoft 365 admin center. 
  • If you don't know the URL of the deleted OneDrive, run the following command:
PowerShell
Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url
  • If the OneDrive appears in the results, it can be restored.
  1. Restore the OneDrive to an active state:
PowerShell
Restore-SPODeletedSite -Identity <URL>
  1. Assign an administrator to the OneDrive to access the needed data:
PowerShell
Set-SPOUser -Site <URL> -LoginName <UPNofDesiredAdmin> -IsSiteCollectionAdmin $True

For more info about these cmdlets, see Get-SPODeletedSite and Restore-SPODeletedSite.

Permanently delete a OneDrive

After you recover the data you need from the OneDrive, we recommend that you permanently delete the OneDrive by running the following command:

PowerShell
Remove-SPODeletedSite -Identity <URL>

 Caution

When you permanently delete a OneDrive, you will not be able to restore it

Windows Administrator Level 1 Interview Question & Answers

 Windows Administrator Level 1 Interview Question & Answers What is an active directory?  An Active Directory (AD) is a directory ...