Deleting Stale Office 365 online Mailboxes with Powershell

We are using Office 365 online for our student email system.
I want to remove any mailbox that hasn't been accessed in the last year.

Once you determine that, you can remove the mailboxes a number of ways - depending on how your onsite AD interacts with Office 365.
If you use DirSync, the users that have been deleted onsite should eventually be purged from Office 365, mailboxes included.
*To be honest, I have always deleted users manually using the method below, so I cannot affirm, from experience, that this is the case, so someone may correct me.*
You can manaully purge mailboxes as well (I had to do this a while ago) with PowerShell cmdlets.
$cred = get-credential
connect-msolservice -credential $cred
Remove-MsolUser –UserPrincipalName [email protected]
Yes, you have to install what is known as the Windows Azure Active Directory Module for PowerShell to use those commands (cmdlets).
http://technet.microsoft.com/en-us/library/jj151815.aspx
If that's not clear, please ask follow up questions.
Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

Similar Messages

  • Project 2007 with Office 365 online

    Hi,
    I am looking for the Project 2007 compatibility with Office 365 online with SP 2013.
    Is this possible? If yes, what is the procedure to configure that.
    I have not worked on Project Server, if anyone can help me or provide any reference links that will be very helpful.
    Thanks
    Ankit
    Thanks Ankit

    Ankit,
    You are talking about multiple things in your question, so let me try and clarify the question.
    1) Office 365 +SP 2013 is not Project Server. Project Server is a totally separate application built on SharePoint. And in Office 365, Project Server is offered as Project Online, which is an additional license you need to purchase.
    2) With that settled, I will assume you are talking about Project Stand-alone with SharePoint. As far as I know, this "Sync" functionality was only available starting Project 2010, so I am guessing using Project 2007 will not work.
    3) That pretty much leaves us with Manually uploading Project (.mpp) files into SharePoint, just like any other document, and if this is what you want, then it should work with no issues.
    If none of the above answered your question, please post some more details, and we will try to help.
    Prasanna Adavi,PMP,MCTS,MCITP,MCT http://thinkepm.blogspot.com

  • Is it possible to switch from Office 365 online user management to Active Directory after Exchange online migration?

    If we utilize the Cutover method to migrate from on-premise Exchange (2007) to Office 365, which to my understanding will hand over user management/authentication to Office 365 online during the process, is possible to later switch from Office 365 user management
    to Active Directory (synced to a future local domain, or even possibly via AD federation single sign-on)? If so, how difficult is this process and is there any documentation available?
    Asking this because the organization  I'm working for plans to upgrade (re-do actually) its entire infrastructure. There will be a completely brand new domain/AD set up that's totally unrelated to the old one. At the same time, we also plan to migrate
    all emails (previously hosted locally on Exchange 2007) to Office 365 and get rid of local exchange. Now because we will set up new domain, we do not want to carry over the older AD to the cloud, hence we will not use the "Staged Migration". 
    So the plan is to to use "Cutover" migration first, which means all authentications will become Office 365 managed. That's fine for now. But later, after we set up our new domain and AD controller etc, we'd like to have Exchange Online switch back
    to syncing with our new on-premise AD. We'd also like to consider the AD Federation Services if it's not too complicated to set up.
    Your advice on this would be greatly appreciated!

    In principle, you cannot sync back from the cloud AD to the on-prem, yet. But you can take advantage of the soft-matching mechanism once you have the new AD in place:
    http://support.microsoft.com/kb/2641663
    Be careful though, as the moment you turn on Dirsync, all the matching users in the cloud will have their attributes overwritten. A very good idea is to do an 'export' of the cloud AD first, using the WAAD module for PowerShell and the Get-MsolUser cmdlets,
    which you can then use to compare or import data in the new on-prem AD. Some links:
    http://technet.microsoft.com/en-us/library/hh974317.aspx
    http://msdn.microsoft.com/en-us/library/azure/dn194133.aspx

  • Office 365 online Sharepoint (Business Premium) - pre-build intranet site that can be installed

    Hello, 
    Is their any possibility to setup in the new Office 365 online a SharePoint with a pre-build intranet website?
    Those options exists in many intranet systems. Example: in Bitrix24 their is possebility to start with a theme for intranet site. The basic theme includes: Several internal departments (Management, IT, Sales, HR ect), tasks by deparment, users groups (by
    department) with permissions for each departments, news feed by department ect. 
    Is their any pre-build option with a simple intranet configuration?
    Sometimes it is much easier to configure when using a common simple company structures. 
    Thank you

    Hi,
    For SharePoint Online backup and restore, there are basically 4 options:
    Use the recycle bin and version history.
    Use a 3rd party tool for backup and restore (there are several).
    Manually backup sites, lists, and libraries (see:
    Information about manual migration of SharePoint Online content and
    How to back-up an Office 365 SharePoint Online site and data)
    Create an Office 365 support request (see:
    Restore options in SharePoint Online)
    For more information,you can have a look at the blog:
    http://www.threewill.com/the-4-options-you-need-to-know-about-sharepoint-online-backup-and-restore/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Office 365 Shared Mailboxes - Auto Reply

    We've just migrated from an exchange 2003 to Office 365.
    We have several shared mailboxes where previously they had an out of office setup with a generic message on it.  Now that those mailboxes have been turned into'Office 365 Shared Mailboxes' without licenses attatched, i can't seem to work out how to
    setup a similar auto reply for each of the mailboxes. 
    The only thing i can see is to assign a license to each of the mailboxes that we want to have an auto reply and treat them as normal users, but this just seems a waste of money.
    Any Help?

    It appears you may have bumped into a limitation of Office 365.
    You might try this workaround.  License the mailbox, log in, set the out of office message, log out, and remove the license.  If the out of office message stays, then you have your workaround.  Please post here whether or not that works so
    others will benefit from your experience.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Replication of contacts in iPhone 4 using office 365 online

    We are using Office 365 Online mail service in our organization. One of our Director is using Mac, iPhone 4 & iPad to access his mails. He is having some problem in his Contacts. Some of contatcs replicated in the list again and again. We have tried to rectify the problem as instructions received from our service provider but same problem occur again.
    We have applied following operations on iPhone :
    * Removed duplicate contacts from MS Exchange Online and removed contacts on iPhone 4 and re-sync.
    * Removed Exchange id from iPhone 4 and re-create id on iPhone 4.
    We have never sync iPhone 4 contacts through iTunes or iCloud.
    Our Director using 4 MS Exchange online ID on his all apple devices. His Contacts and Calendar associated with only on id.

    You should setup domain for Office 365 - Add your users and domain to Office 365
    [custom.development]

  • How can I download content of wiki pages from Office 365 online Sharepoint site using c#?

    How can I download content of wiki pages from Office 365 online Sharepoint site using c#?
    Ratnesh[MSFT]

    Hi,
    According to your post, my understanding is that you want to download content of wiki pages on SharePoint Online.
    If just for getting the text of the page, I suggest you convert page to PDF file first and then download the PDF file via a Visual Web Part as a Sandboxed solution.
    A sample about export HTML to PDF:
    http://hamang.net/2008/08/14/html-to-pdf-in-net/
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Email going to deleted items Office 365

    I am using Office 365 for small business and have installed a local copy of Outlook on my laptop.  No rhyme or reason, some of my emails wind up in My Deleted Items as Unread.  I have no rules in place, no spam settings in place.  Has anyone
    seen this before.
    Thanks in advance,
    Brad

    First of all, please check this on Outlook Web APP to see if emails still go to Deleted Items folder. If yes, then it’s not an issue on Outlook client side. I would suggest you to check on Exchange Online side.
    On Outlook client side, I would suggest you to run Outlook with /cleanrules switch anyway to clean any hidden rules:Outlook.exe /cleanclientrules
    A corrupted data file also could cause this issue, I would suggest you to use scanpst.exe tool to repair your data file. Please refer to this article on how to use scanpst.exe:
    http://office.microsoft.com/en-us/outlook-help/repair-outlook-data-files-pst-and-ost-HA102749454.aspx
    Thanks,
    Ethan Hua CHN
    TechNet Community Support

  • Office 365 Shared Mailbox in Exchange Admin

    I am creating shared mailboxes in my Office 365 account and I want all the users on my domain to have access to all of the mailboxes. Is there any way I can set this up automatically, instead of manually adding each user to each shared mailbox and
    then having to remember to add all new users into each shared mailbox?
    Also is there anyway I can only allow them to have View-Only permissions on these mailboxes?
    Thanks 

    Hi Lauren,
    the cmdlet add-mailboxpermission is avaliable for Exchange Online, too.
    http://technet.microsoft.com/de-de/library/bb124097(v=exchg.150).aspx
     So you can receive a list for all your users mailboxes, and then you run add-mailboxpermission to all of them.
    $mymailboxlist = get-mailbox -resultsize unlimited
    $mymailboxlist | foreach-object {
                     $resourceMailbox = $_
                     $mymailboxlist | foreach-object {
                             $permittedMailboxAccess = $_
        add-mailboxpermission -identity $resourceMailbox -user $permittedMailboxAccess -accessRights FullAccess -InheritanceType All
    In that example script you may ignore warning messages that a user already had access to her own mailbox.
    You may add logic to the code to avoid that :)
    If you do not know how to connect to Exchange online (required to run that code) please see
    http://technet.microsoft.com/en-us/library/jj984289(v=exchg.150).aspx
    Regards,
    Martin

  • Exchange 2013 (Office 365) shared mailbox not staying up to date.

    We have created a new shared folder for multiple users to access in Office 365 and were having some issues. There are a few users where this mailbox works great, but others users aren't able to see any changes that are made in the shared mailbox.
    Opening the mailbox in O365 shows all folders, emails, etc... but for some reason syncing stops working randomly after a bit of time. Removing and re-adding permissions to the mailbox does fix this issue, but that's not a feasable fix for us.
    Users can add folders to the shared mailbox, and those added folders do show up in the mailbox when opened in O365, but the changes do not push down to multiple other clients. 
    Anyone else seen this or have any info? Thanks!

    Hi,
    Are the users using Cached Exchange Mode or Online Mode? When the issue comes next time, have the user switch to the other mode and test if this helps.
    We can disable Cached Mode for Shared folders, check if this helps resolve the sync issue:
    Go to FILE -> Account Settings -> Account Settings -> Double click on the Exchange account -> More Settings -> Advanced tab -> Uncheck "Use Cached Exchange Mode", and click Apply then OK.
    In Cached Mode, it doesn't connect to Exchange Server all the time but keeps a cache of the mailbox locally to sync the local cache and mailbox according to a period, this may cause some items not sync immediately. By switching to Online Mode, it should
    be immediate.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to get Office 365 shared mailbox rights properly.

    hi,
    How do I retrieve the shared mailbox rights properly.
    Currently I find that I can get Full Access permission by using Get-MailboxPermission but it returned me along with the user I'm looking for other junk accounts.  See below sample result, i'm only interested in user01FN.
    Identity             User                 AccessRights                                      
             IsInherited Deny 
    cm01                 NT AUTHORITY\SELF    {FullAccess, ReadPermission}                                False      
    False
    cm01                 user01FN user01LN    {FullAccess}                                            
       False       False
    cm01                 APCPRD02\Administ... {FullAccess}                                                True
           True 
    cm01                 APCPRD02\Domain A... {FullAccess}                                                True
           True 
    cm01                 APCPRD02\Enterpri... {FullAccess}                                                True
           True 
    cm01                 APCPRD02\Organiza... {FullAccess}                                                True
           True 
    cm01                 NT AUTHORITY\SYSTEM  {FullAccess}                                              
     True        False
    cm01                 NT AUTHORITY\NETW... {ReadPermission}                                            True
           False
    cm01                 APCPRD02\Administ... {FullAccess, DeleteItem, ReadPermission, ChangePermissio... True        False
    cm01                 APCPRD02\Domain A... {FullAccess, DeleteItem, ReadPermission, ChangePermissio... True        False
    cm01                 APCPRD02\Enterpri... {FullAccess, DeleteItem, ReadPermission, ChangePermissio... True        False
    cm01                 APCPRD02\Organiza... {FullAccess, DeleteItem, ReadPermission, ChangePermissio... True        False
    cm01                 APCPRD02\Public F... {ReadPermission}                                            True
           False
    cm01                 APCPRD02\Exchange... {FullAccess, ReadPermission}                                True        False
    cm01                 APCPRD02\Exchange... {FullAccess, DeleteItem, ReadPermission, ChangePermissio... True        False
    cm01                 APCPRD02\Managed ... {ReadPermission}                                            True
           False
    cm01                 PRDMGT01\View-Onl... {ReadPermission}                                            True
           False
    Also, is it possible to return them in a manageable format like xml or csv?

    hi Michael,
    Thanks for the reply, I found some filter suggestions from another website as follows:
    Get-MailboxPermission "[email protected]"  | where { ($_.AccessRights -eq “FullAccess”) -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) }  | ft User -AutoSize
    Get-RecipientPermission "[email protected]" | Where { ($_.AccessRights -eq “SendAs”) -and -not ($_.Trustee -like “NT AUTHORITY\SELF”) -and ($_.IsInherited -eq $false)} | ft Trustee -AutoSize
    They work for the moment, but since they are not Office 365 official I don't know whether it will break if I have more users.
    Also is it possible to get output in CSV or XML format instead of text.  If not possible, can you provide me how to parse the text format?
    thanks and regards,
    --Leo

  • OFFICE 365 ISNT WORKING WITH OS X YOSEMITE

    I tried to open Office 365 for Mac on my MacBook Pro but comes up with a message saying there is a problem but does not specify what the problem is.

    http://answers.microsoft.com/en-us/mac
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10.1), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • It is possible to run a timer job in Office 365 online?

    Hi All,
    Is it possible to run a timer job on 1st of every month  for a list in office 365? I have a requirement that I need to send data of current month via email on 1st of every month. should I use timer job in Office 365?
    Thanks in Advance.

    Hi Darsh,
    There is no option available to run a timer job in SharePoint Online (Office 365), SharePoint timer job option is available only in SharePoint On-premise.
    Microsoft Office 365 provide an alternate of the SharePoint timer Job "Web Jobs" on Azure. You can create Web Job by 2 types
    Web Job as a App on SharePoint
    Web Job as a scheduler
    Read the below articles 
    http://blogs.msdn.com/b/kaevans/archive/2014/03/02/building-a-sharepoint-app-as-a-timer-job.aspx
    http://blogs.msdn.com/b/richard_dizeregas_blog/archive/2014/04/07/sharepoint-timer-jobs-running-as-windows-azure-web-jobs.aspx
    Vivek Jagga 
    My Blog

  • Removing Exchange 2007 from SBS 2008 after Migrating to Office 365 Mid Sized with DirSync and SSO

    We have recently completed off a Migration of Exchange 2007 to Office 365 Mid Sized platform.
    I now need to decomission the old SBS 2008 server as they have moved to a Windows Server 2012 R2 server setup for DC, File and print and application servers.
    I need to know what are the ramifications of removing the Exchange 2007 server from the SBS 2008 server and will this remove the LegacyDN details from AD and cause any issues with internal emails between users using Outlook linked through to Office365.
    I understand that after removing Exchange 2007 there will be no friendly GUI to update and maintain proxyAddress, targetAddress and LegacyDN addresses, I am comfortable doing this in ADSI edit or with a script.
    Will this remove the x500 addresses relating to the on premise Exchange Orgainisation and just leave behind the x500 addresses for Exchange Labs which I assume is the x500 addresses for the Azure AD intergration for Office365.

    Hi ,
    Thank you for posting your issue in the forum.
    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Thank you for your understanding and support.
    Best Regards,
    Andy Qi
    Andy Qi
    TechNet Community Support

  • Office 365 - Changing Domain using Powershell

    Hi,
    I have about a hundred users on a domain ([email protected]) and I need to change to another domain ([email protected]) using Powershell.
    May I know what commands are needed to accomplish this? I need to change the userPrincipalName, SIP and Primary SMTP to the new domain.
    I have all the users in a CSV file.
    Thanks!!

    Hi Kindovic,
    To bulk add user information from CSV file, please check the script below:
    Bulk import the user information from CSV file
    How to create users in bulk using csv file import
    For the issue of office 365, I also recommend you to post this in Office 365 forum for more effective support:
    Manage Office 365
    Best Regards,
    Anna

Maybe you are looking for

  • Open Document Link on PO Approval WF

    In the PO Approval Workflow, if you have the proper responsibility, an "open document" link is displayed that, when clicked, takes the user to a screen entitled "Notifications to Releases". This function is available to our Purchasing Super User resp

  • Open Hub Destination over a Datasource as a source

    Hi Expert,                 I am trying to create Open hub destination over Datasource as a source it showing me an error "Cannot connect DataSource to an open hub destination". Can anyone tell me is it possible to create an open hub destination over

  • Wordreport with graph an 2 y axes

    Hallo, I have this VI and i want to insert a second y axe in the graph and append the last 2 signals at this axe. The last Column (Index 0) is the timestamp of the values. I searched for a solution but I only found something with macros, but I don't

  • Muvo TX voice recording noise/buzz very h

    bought yesterday Muvo TX 256MB (non FM), latest firmware installed (.0.05) and heawy noise while recording speach. Actually the noise has more intensity than what is ment to be recorded. The buzz/noise continues 00% of the recorded time, all time the

  • Crystal Reports with stored procedures

    Hello Members, I have come across a unique problem (only for me I guess). When I develop a report using a sql command (with sql script), I can run this report against any server or any datatbase dynamically with out using the "Set Data Source Loactio