Connect Office 365 Exchange Online through Powershell

I am trying to perform some operations on Exchange online(Office 365) through powershell.
First I created a new powershell session and exported the modules to local as "o365", so that on any later operation I no need to use Import-PsSession to download the required modules
$cred = Get-Credential
$s = New-PSSession -ConfigurationName "Microsoft.Exchange" -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $cred -Authentication Basic -AllowRedirection
Export-PsSession -session $s -outputModule o365
Now, I am creating new session and importing the existing module "o365".
$cred = Get-Credential
$s = New-PSSession -ConfigurationName "Microsoft.Exchange" -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $cred -Authentication Basic -AllowRedirection
Import-Module o365
Get-DistributionGroup
While running the command "Get-DistributionGroup", powershell prompts me to enter the office 365 credentials once again. Is it possible to avoid entering the credentials once again? I don't want to use Import-PsSession, since it takes more time.

Hi,
Not sure, if the following cmdlets can make a difference. Anyway, suggest you to try these:
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $SessionGet-DistributionGroup
Regards from ExchangeOnline.in|Windows Administrator Area | Skype:[email protected]

Similar Messages

  • Office 365 / Exchange Online - Hybrid Setup - On Premise User cannot see calendar of an Exchange Online User.

    Hi All, 
    The below will help if:
    You have a hybrid setup and cannot see Free/Busy info from an On Premise user for anyone on Office 365 / Exchange Online.
    You have your network firewall configured to allow your Exchange servers out through the proxy for O365/EXO url's
    - Get hold of SysInternals PSEXEC from Microsoft. 
    Run PSEXEC -i -s C"\Program Files (x86)\Internet Explorer\iexplore.exe"  (This opens Internet Explorer as the SYSTEM account)
    Goto Internet Options > Connections > LAN Settings and untick the "Automatically Detect Settings"
    Had this bouncing around at Microsoft for a few days until one of the guys tried this and it worked immediately.

    Forgot to mention, the PSEXEC command needs to be run as an Administrator
    Run PSEXEC -i -s C"\Program Files (x86)\Internet Explorer\iexplore.exe"  (This opens Internet Explorer as the SYSTEM account)
    Goto Internet Options > Connections > LAN Settings and untick the "Automatically Detect Settings"

  • Questions on managing Office 365/Exchange Online Mailboxes in Server 2012 Essentials

    Wondered if anyone could answer a couple of queries:
    When managing Office 365/Exchange Online mailboxes in Windows Server 2012 Essentials:-
    1. Does the server itself act as the Exchange server i.e. does it do all of the downloading/sending of emails or does Outlook on each workstation still communicate direct with the Office 365/Exchange Online server address?
    2. Does Outlook on each workstation have the Exchange server address set to the internal address of the Server 2012 Essentials box or does it still have the external Office 365/Exchange Online server address?
    I don't work for Microsoft - I just use their products.

    Hi,
    When you integrate Office 365/Exchange Online mailboxes in Windows Server 2012 Essentials,you can see the mailbox usage information on the Essentials Dashboard and manager users. However, the essentials server won't download/send emails and Outlook
    will still communicate with the O365/Exchange Online Server. In addition, the Exchange server address would be point to the external server address.
    You can also refer to the article below to get more related information:
    Email Options Supported by Windows Server 2012 Essentials
    Best regards,
    Susie
    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]

  • Synchronize Lotus Domino Directory with Office 365/Exchange Online

    I have someone who is asking me to migrate them from a Lotus Domino server to Office 360/Exchange online. However they want to maintain a sync between Lotus Domino Directory and Office 365/Exchange Online. I'm wondering if that is even possible
    or would they need to have a regular Active Directory server act as a go between the two. Can anyone provide me some guidance/suggestions?
    Vincent Sprague

    Curious, did you ever get this setup?
    Reason I'm asking is I was involved with a large MSO365 migration (15k) from Lotus Notes. We had a separate AD forest just for email Dirsync. We involved a third party to setup the sync and migration between Notes and AD, and coexistence. It was rather complex.
    Out of the box, it would have been extremely difficult.
    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php
    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

  • Office 365 Exchange Online not syncing on 4G

    I have been using Office 365 for over a year now and have not had problems like today.  None of my devices will connect to the Exchange Online server via the Verizon Mobile Data connection.  It works fine on Wifi, but not 4G LTE.  I spent and hour and half on chat with Verizon and they tried to reset some things with no success.  I have submitted a ticket with Microsoft, but I was busy with something else when they called.  I am now waiting for a call back.  Anyone else have this issue?  I only have Verizon devices, anyone with another carrier experience this?  Unfortunately I only have Samsung devices as well.

    Forgot to mention, the PSEXEC command needs to be run as an Administrator
    Run PSEXEC -i -s C"\Program Files (x86)\Internet Explorer\iexplore.exe"  (This opens Internet Explorer as the SYSTEM account)
    Goto Internet Options > Connections > LAN Settings and untick the "Automatically Detect Settings"

  • Error while Connecting Office 365/SharePoint online

    Hi,
    I'm trying to connect Office 365 from my local and when the execute query runs, it returns an error "For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to
    Parse and pass the settings into XmlReader.Create method." Can anyone pls help ?
                var securePassword = new SecureString();
                foreach (char c in password)
                    securePassword.AppendChar(c);
                var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
                using (ClientContext clientContext = new ClientContext(targetSite))
                    clientContext.Credentials = onlineCredentials;
                    Web web = clientContext.Web;
                    clientContext.Load(web,
                    webSite => webSite.Title);
                    clientContext.ExecuteQuery();
                    Console.WriteLine(web.Title);
                    Console.Read();
                    return clientContext;
    Thanks
    Rajdeep
    rajdeep

    Hi,
    According to your post, my understanding is that you had an issue to connect to the SharePoint online.
    I had tested with your code, and it worked well as below.
    Did your project contain other code? Such as parse the XML file?
    You can create a new clean project to check with it works.
    More reference:
    http://stackoverflow.com/questions/215854/prevent-dtd-download-when-parsing-xml
    http://stackoverflow.com/questions/13854068/dtd-prohibited-in-xml-document-exception
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Exchange Management Tools? Hybrid Exchange 2010 SP3 - Exchange 2013 (Office 365 - Exchange Online)

    When running in Hybrid mode... is there any advantage to installing the Exchange 2013 server management tools on my machine versus the Exchange 2010 management tools? 
    Any advantages/disadvantages? 
    I still do have some on premises mailboxes that need to be migrated to the cloud (Exchange Online). 
    Thoughts? Suggestions? Experiences? 

    Hi Viva,
    We don't have Exchange Management Console in Exchagne 2013 in all the web interface we used in Exchange server 2013. In Exchange 2010 we are having Exchange management console. Hence we can able to access exchange 2010 and 2013 both on the same server.
    Exchange Queries

  • Server Essientials DashBoard wont connect to Office 365 / Exchange Tenant

    We logged a ticket with Microsoft support nearly a month ago and to date still no solution. 
    Server essentials is connecting to Office 365, however isn't retrieving any user or exchange online information. 
    Exchange Online comes back as not available.  Have built a fresh DC, tried a different admin account, same problem.
    Believe the problem is to do with the Exchange Online Tenant but the error is cryptic
    This is the error we have found in the log
    [3388] 150202.084044.2621: PSRunspace: Release PS runspace failed with the exception : System.Management.Automation.Remoting.PSRemotingTransportException: Closing the remote server shell instance failed with the following error
    message : The server certificate on the destination computer (pod51053psh.outlook.com:443) has the following errors:      
    Encountered an internal error in the SSL library. For more information, see the about_Remote_Troubleshooting Help topic.
       at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndClose(IAsyncResult asyncResult)
       at System.Management.Automation.RemoteRunspace.Close()
    Have tried the following work arounds as well, no good.
    Re: http://support.microsoft.com/kb/2974308 - We don’t have multiple forests, and our servers are up to date.
    <u5:p> </u5:p>
    Re:
    http://blogs.technet.com/b/sbs/archive/2012/12/12/connection-to-office-365-account-may-fail-or-timeout-when-you-try-to-connect-from-windows-server-2012-essentials-dashboard.aspx  - Tried this but no matter how I tried the workaround I wasn’t able to
    get psexec to run on the server (Tried under admin command and normal user command prompt, same result, under a domain admin account).
    If anyone has any suggestions please let me now, is very frustrating for end users having to maintain 2 passwords (2k+ users).
    Thanks in advance.

    Thanks Cliff, I will investigate decommissioning essientials proir to adfs / dir sync. 
    It should be noted Essentials was working OK until Server Essentials was moved to another DC (Which according to MS is possible if the DCs are up to date).   Therefore I believe we have a cert / CA issue.
    I don't believe the user amount is the cause of the current issue, it is a SSL connection issue with the Exchange Online Tenant, which is shown in the logs.
    At this stage I'm not marking your answer as correct as I am looking for a solution to the SSL connection error.    In the event no one comes back with any information around how to resolve an SSL connection to the Exchange Online Tenant
    / How to force the Online tenant start a new connection with Essentials (e.g. On a cert level is my guess), I will then mark your answer as correct and move on.
    I do agree that the user amount is not supported therefore will be going down the ADFS / DirSync route, but would like to resolve the Connection to the Exchange Online Tenant issue as it is clear that MS Support don't know how to, and may be helpful for
    others in this situation
    Thank you Cliff for your input to date.

  • Email configuration with Office 365 exchange- MS CRM online 2015

    Hi,
    Is there any link available which I can refer to configure Office 365 exchange with Ms Dynamics CRM 2015?
    Thanks
    Regards.

    Please refer this:
    https://msdn.microsoft.com/en-us/library/hh670607.aspx?f=255&MSPPError=-2147217396
    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

  • Office 365 Exchange for Non-profit

    Hi
    Previous a Website Hosting was own mailing server (Sample)
    [email protected]   is Mailbox only in the hosting
    [email protected]  (as non-mailbox)  come automatic-forward to     [email protected]
    [email protected]  (as non-mailbox) come automatic-forward to    
    joe@other_isp.co.nz
    Now, We bought a Office 365 non-profit in clouding.   I setup a new user for 
    [email protected] in the mailbox via exchange clouding.  And I changed our DNS in our Web hosting, Then I setting a exchange with Outlook app were successfully. 
    I tried find Office 365 about the another add user for [email protected] (as non-mailbox) should be automatic forward to 
    [email protected] (in own mailbox). 
    My experience Windows Server with Exchange 2003, 2008 & 2011.  Now, I first time this Office 365 exchange for business & non-profit.  I never seen this. 
    Help me, Where I can find the "Domain email (non-mailbox) Auto-Forward email to domain email (mailbox) or also external email"
    Thanks for your help
    Mike

    You can nicely do this with Distribution Group or by Transport Rules. Distribution Group will be maybe the easy way.
    You can referer to article Create and use distribution groups.
    Basically, you create DL with address [email protected] and allow to receive e-mail from external sources. Then you add [email protected] as member of this group.
    If you want also sent e-mails from this DL, you can use PowerShell to set rights for it.

  • Error During install Exchange 2013 through Powershell on Server 2012 "Mailbox role: Client Access service"

    Dear all
    During install Exchange 2013 through Powershell on Server 2012 I got this error in Mailbox role: Client Access service :
    The following error was generated when "$error.Clear();
    $BEVdirIdentity = $RoleNetBIOSName + "\OWA (Exchange Back End)";
    new-OwaVirtualDirectory -Role Mailbox -WebSiteName "Exchange Back End" -DomainController $RoleDomainController
    set-OwaVirtualdirectory -Identity $BEVdirIdentity -FormsAuthentication:$false -WindowsAuthentication:$true;
    " was run: "An error occurred while creating the IIS virtual directory 'IIS://MONAMBX2.mona.local/W3SVC/2/ROOT/o
    wa' on 'MONAMBX2'.".
    The following error was generated when "$error.Clear();
    $BEVdirIdentity = $RoleNetBIOSName + "\OWA (Exchange Back End)";
    new-OwaVirtualDirectory -Role Mailbox -WebSiteName "Exchange Back End" -DomainController $RoleDomainController
    set-OwaVirtualdirectory -Identity $BEVdirIdentity -FormsAuthentication:$false -WindowsAuthentication:$true;
    " was run: "The operation couldn't be performed because object 'MONAMBX2\OWA (Exchange Back End)' couldn't be fo
    und on 'MonaDc1.mona.local'.".
    Any advice please !!

    I can't answer your question but I had a similar issue when I was trying to move our mailbox database off the C: drive.  Our environment still has an Exchange 2007 server in it and when I was trying to move the database on the 2013 server, I would get
    error messages saying the database does not exist.  It seemed like it was trying to move the database on the 2007 server from the similar error messages that I was getting.  To get around it, I deleted the database and created a new one on the drive
    where we wanted it.
    I discovered this when I was configuring the Antispam settings.  I deleted our 2007 settings, added them to the 2013 shell, the settings appeared on our 2007 server.  The shell on 2013 was making changes to 2007.
    I'm not sure if there is a "Get|Set or New" command that I/we should be using when this happens.  Or maybe my issues will be fixed if I just remove the Exchange 2007 server?  I'm not ready to do that yet because I can't configure the spam filtering
    on 2013 yet with its shell not being able to make the changes that we need.
    I don't know if your environment is in coexistence mode like mine.
    Hopefully someone else out there has an answer or can tell us when/how the shell can make the appropriate changes to the 2013 server.  Does this happen after the 2007 server is removed?

  • Office 365 Exchange Account Deleted & Overwritten?

    I've run into a problem where I need to recover an Office 365 Exchange account, but it doesn't exist in Deleted Accounts. Below is a summary of the events leading up to this problem:
    An Office 365 account was deleted
    A shared mailbox (using the exact same email address as the deleted account in step 1) was created
    It was determined that there were email and contacts that needed to be saved from the original account
    In the Deleted Mailboxes list, the deleted mailbox did not exist
    The shared mailbox was deleted
    In the Deleted Mailboxes list, the deleted shared mailbox existed, but not the original
    I'm currently in the process of using eDiscovery to try to recover the email from the account, but is there a way to actually recover the original account at this point?
    I realize that the smarter option would have been to convert the original account into a shared mailbox, but at the time none of the old data was needed. Deleting the account was an easy way to clean out all of the old data.

    Hi,
    Please note in this forum we mainly discuss questions and feedbacks about Office client issues, since your question is related to Office 365 Exchange Account, I suggest you post the question in Office 365 Community Forum:
    http://community.office365.com/en-us/f/default.aspx
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • ADFS, Office 365 + Exchange 2012

    Need information on How to configure the ADFS, Office 365 + Exchange 2012 on IOS device.

    Hi,
    Based on my research, we can join iOS devices to a workplace with
    Windows Server 2012 R2:
    Overview: Join to Workplace from Any Device for SSO and Seamless Second Factor Authentication Across Company Applications
    http://technet.microsoft.com/en-us/library/dn280945.aspx
    Walkthrough Guide: Workplace Join with an iOS Device
    http://technet.microsoft.com/en-us/library/dn280933.aspx
    Best Regards,
    Amy

  • Can we custom set workflow throttle and batch size in Office 365 SharePoint online ?

    Hi All,
    I am new to sharepoint online administration. I want to know that can we custom
    set workflow throttle and batch size in Office 365 SharePoint online ?? likewise we were able to do in SP Farm environment using stsadm cmdlets.
    Can we use SP Online management shell to do the same ?
    Please help !!!

    Thanks for the reply...
    But then how can I optimize my workflow against these properties in Sharepoint online site environment  ?
    Throttle
    Batch size
    Timeout
    Workflow timer interval
    AutoCleanUpDays ()
    refer : http://www.codeproject.com/Articles/251828/How-to-Improve-Workflow-Performance-in-SharePoint

  • Apple Mail with Office 365 Exchange server

    Is anyone here using Apple Mail with Office 365 Exchange server on Mountain Lion? I have just upgraded to Mt Lion and decided to switch from Outlook to Apple Mail.app. My account was added successfully. Even contacts, calendar, tasks and notes work very well. My problem with Mail.app is that it does not sync any emails in subfolders prior to the day I added the account to Mail. For any older emails I have to open Outlook for Mac and look it up there. Other than this issue Mail is working well for all new incoming and outgoing emails.
    Thanks

    I Found a workaround.  Please look at this other link:  https://discussions.apple.com/thread/6615135

Maybe you are looking for