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

Similar Messages

  • Error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable

    error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable.
    I am creating many site collections reading records from sharepoint list using powershell in sharepoint online tenant (office 365).
    Few site collections are created and then getting above error so this error record will be skipped then few succeeding record processed then again getting error.
    pattern is like:
    success
    success
    success
    success
    Error
    success
    success
    success
    success
    success
    success
    error
    success

    Hi,
    As it is an online environment, to troubleshoot this issue in an easier way, I suggest you contact Office 365 Support to see if there is any useful information in
    the log files in the server side:
    https://support.office.com/en-us/article/Contact-Office-365-for-business-support-32a17ca7-6fa0-4870-8a8d-e25ba4ccfd4b?ui=en-US&rs=en-US&ad=US
    Best regards
    Patrick Liang
    TechNet Community Support

  • 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

  • Office 365 Sharepoint Online and Infopath 2013

    I'm looking create an InfoPath 2013 form where the view changes based on the current user.  This is so different departments & managers get access to fields regular submitters don't see.
    This is in SharePoint Online with Office 365.  How can I manage this?  I have tried connecting to SharePoint online via a data connection, but I get errors when it tries to make the data connection.
    Are there any tutorials on how to do this, or at least something put point me in the right direction?

    Hi
    Did you check this
    http://office.microsoft.com/en-in/office365-sharepoint-online-enterprise-help/configure-infopath-forms-services-HA102771487.aspx

  • Access denied office 365 / SharePoint online with Global Admin account

    Hi All,
    I am going crazy since two days solving an issue. The problem is;
    I am making a console APP which is talking to SharePoint Online using global admin account (One which was specified as admin while making a new subscription). What I am trying to achieve is, I want to add a custom action using CSOM to each site collection and
    subsite of office 365. That code works fine except on the root site collection which is pre-created by office 365 while signing up (i.e. https://xyz.sharepoint.com)
    Whatever I do on that site collection, it says gives me below error;
    "SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.3912.1201","ErrorInfo":{
    "ErrorMessage":"Access denied. You do not have permission to perform this action or access this resource.","ErrorValue":null,"TraceCorrelationId":"2a47fd9c-c07b-1000-cfb7-cdffbe3ab83a","ErrorCode":-2147024891,"ErrorTypeName":"System.UnauthorizedAccessException"
    },"TraceCorrelationId":"2a47fd9c-c07b-1000-cfb7-cdffbe3ab83a"
    Now the user is global admin. I also added again that user as site collection admin. 
    The same piece of code works fine on other site collections (search site collection, any newly made site collection...). 
    here is a code;
                using (ClientContext spcollContext = new ClientContext(web.Url))
                    SecureString passWord = new SecureString();
                    foreach (char c in strAdminPassword.ToCharArray()) passWord.AppendChar(c);
                    SharePointOnlineCredentials creds = new SharePointOnlineCredentials(strAdminUser, passWord);
                    spcollContext.Credentials = creds;
                    Web currentweb = spcollContext.Web;
                    spcollContext.Load(currentweb);
                    spcollContext.ExecuteQuery();
               //     authCookie = creds.GetAuthenticationCookie(new Uri(web.Url));
                    var existingActions2 = currentweb.UserCustomActions;
                    spcollContext.Load(existingActions2);
                    spcollContext.ExecuteQuery();
                    var actions2 = existingActions2.ToArray();
                    foreach (var action in actions2)
                        if (action.Description == "CustomScriptCodeForEachsite" &&
                            action.Location == "ScriptLink")
                            action.DeleteObject();
                            spcollContext.ExecuteQuery();
                    var newAction2 = existingActions2.Add();
                    newAction2.Description = "CustomScriptCodeForEachsite";
                    newAction2.Location = "ScriptLink";
                    newAction2.ScriptBlock = scriptBlock;
                    newAction2.Update();
                    spcollContext.Load(currentweb, s => s.UserCustomActions);
                    spcollContext.ExecuteQuery(); // GETTING ERROR ON THIS LINE. 
    Note: Above error is Fiddler traces.
    Nitin Khubani Sharepoint Developer

    Hi Nitin Khubani,
    Thanks for posting in MSDN forum.
    This forum is for developers discussing developing issue about
    apps for Office. Since the issue is more relative to SharePoint developing, I would like to move it to
    SharePoint 2013 - Development and Programming forum.
    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.
    Thanks for your understanding.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Office 365 Sharepoint Online with RMS

    I'm looking to setup a new SharePoint Online set in Office 365 and implement RMS. I need to know if RMS with Office 365 and SharePoint will protect PDF's and other types of files or just Office files like word and excel?
    Vincent Sprague

    I'm looking to setup a new SharePoint Online set in Office 365 and implement RMS. I need to know if RMS with Office 365 and SharePoint will protect PDF's and other types of files or just Office files like word and excel?
    Vincent Sprague
    https://support.office.com/en-au/article/Set-up-Information-Rights-Management-IRM-in-SharePoint-admin-center-239ce6eb-4e81-42db-bf86-a01362fed65c?ui=en-US&rs=en-AU&ad=AU
    SharePoint Online supports encryption of the following file types:
    - PDF
    - The 97-2003 file formats for the following Microsoft Office programs: Word, Excel, and PowerPoint
    - The Office Open XML formats for the following Microsoft Office programs: Word, Excel, and PowerPoint
    - The XML Paper Specification (XPS) format
    -=-=-=-
    http://blogs.technet.com/b/rms/archive/2014/08/26/rmsaugust2014update.aspx
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • 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]

  • Found error while Deploying office 365 through SCCM.

    Hello Experts,
    We are currently working to deploy office 365 through SCCM but on client system it failed to installed.
    found error in AppEnforce.log file.
    Please help to resolved the error.

    ConfigMgr is doing it's job and trying to install the application. However the installation times out after an hour.
    See:
    Waiting for process 5820 to finish.
    That would suggest to me that there is something wrong with your installation parameters. The installation is probably not fully silent and is awaiting user input (that you cannot see).
    Narcoticoo's advice is good. Try to install the app silently manually. Until you can do this successfully ConfigMgr will not be able to deploy it.
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • How to deploy PowerPivot/Power BI in Office 365 SharePoint Online?

    We have several users on Office 365 (E2 Subscription) who have Excel 2013 and PowerPivot on their individual computers who would like to place PowerPivot apps on SharePoint for users without Excel to view.
    How can we do this?

    Your users can do this now if interactivity isn't required. If it is, you'll need to move up to an E3 plan. If your models exceed 10 MB, and you want interactivity, you'll need Power BI licenses for your users.
    John

  • How to use Blob storage to office 365 sharepoint online library documents

    Hello,
    Considering that we cant uploade a file with size more than 250 MB and it is recommended using Remote
    Blob Storage (RBS) if large files are supposed to store in SharePoint.
    My question is, how to use RBS or Azure Blob storage to store files instead of SQL database.
    What is the configuration or code i need to write to accomplished this where i would prefer if it can be done simply using some configuration.
    any sample or tutorial would be great help.
    Thanks,
    Asjad 

    HI,
    What we did, we deploy small Azure PaaS application what used Azure Blob Storage and table and then show it in Office365 SharePoint online trough iframe. This gives you flexibility to customimze the PaaS application and show the content at blog storage.
    We tested this in SharePoint ONline multitenant and Dedicated plus in On Premise SharePoint with the custom code in separate IIS server published trough UAG to Internet. This allows you to save or replace your file server with Azure and small PaaS apps in
    and show the content on SharePoint ONline trough Iframe.
    Br Petri

  • Office 365 SharePoint online: How to create multi level top Navigation

    I having a requirement that we have a site structure which contains departmental sites and each site have multiple subsites.
    eg:
    Site 1: 
        sub site 1
        Sub site 2
    Site 2: 
        sub site 1
           sub site 1 (last node)
           sub site 2 (last node)
        Sub site 2
    Site 3
    and so on.
    I have to show site structure in top navigation, can you guide me how can we achieve this using SharePoint Design Manager or if their is any other way then please tell me.

    In snippet gallery, select top navigation from Ribbon, it will show snippet and customization details.
    In Customization - Top Navigation (ASP.NET) section, expand
    Important node and change value of StaticDisplayLevels
    to 2. After that expand Behavior node and change value of
    MaximumDynamicDisplayLevels to 2.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Copying Document Across Site Collections to Dynamic Locations - Office 365 / SharePoint

    I have users uploading documents into a library in one site collection and adding a reference number to each file (text box - list item). Can I use that reference number to find a corresponding folder on a different site collection and programmatically
    copy the file to that location? The reference number is part of the name of the folder. SharePoint Designer, Visual Studio, Napa - whichever is easiest. Using Office 365 / SharePoint Online.
    Thanks!

    Hi,
    If the reference number plus with the file name is valid and unique, we will be able to find the wanted folder across site collections by querying this file and its parent folder.
    As the reference number + file name is just a string value of a column of a library, we may need to iterate through all the libraries and check whether there is such a file with
    CAML query statements.
    http://msdn.microsoft.com/en-us/library/office/ms467521(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
    As it is an Office 365 site, Client Object Model or REST API would be choices for accessing data of SharePoint Objects.
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/fp142380(v=office.15).aspx
    In SharePoint 2013, App is a more recommended way when developing custom solution.
    Here are some samples about
    creating SharePoint app for your reference:
    http://msdn.microsoft.com/en-us/library/office/jj901637(v=office.15).aspx
    http://www.c-sharpcorner.com/UploadFile/anavijai/how-to-get-all-the-items-from-the-list-in-sharepoint-2013-on/
    Feel free to reply if there are still any questions.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Custom Site MailBox for Office 365 SharePoint 2013 online

    Is it possible to create programmatically create site mailbox for Office 365 SharePoint 2013 online?
    How to customize site mailbox email address like [email protected]

    Hi,
    In SharePoint 2013 Online, if you want to sync document library with local drive, you can use OneDrive to achieve it.
    http://office.microsoft.com/en-001/support/sync-onedrive-for-business-or-sharepoint-site-libraries-to-your-computer-HA102832401.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Best I have been trying for a week to order greeting cards using iPhoto but do I always get the same statement: there has been an error occurred while connecting to Apple's online store try again

    Best I have been trying for a week to order greeting cards using iPhoto but do I always get the same statement:
    there has been an error occurred while connecting to Apple's online store try again

    Best I have been trying for a week to order greeting cards using iPhoto but do I always get the same statement:
    there has been an error occurred while connecting to Apple's online store try again

  • VS2013 changes my script tags when I edit a javascript file on Office 365 Sharepoint Developer

    I posted this issue on the sharepoint online thread, and was asked to move the discussion here:
    https://social.msdn.microsoft.com/Forums/office/en-US/24e7060f-bef8-492c-a7b1-4a0aa9279a53/office-365-sharepoint-developer-changes-my-script-tags-when-i-edit-a-javascript-file?forum=sharepointdevelopment
    On my Office 365 Sharepoint Developer site, I have a custom edit form page (editform2.aspx) created for a list and have added a script reference in the additionalpagehead like this
     <script src="/JavaScripts/angular/angular-formly-master/dist/formly.js" type="text/javascript"></script>
    Whenever I edit the file at /JavaScripts/angular/angular-formly-master/dist/formly.js using VS2013 and save it SharePoint replaces my script tag with this:
     <script src="/JavaScripts/angular/angular-formly-master/dist/formly.js~RF322607.TMP" type="text/javascript"></script>
    I thought maybe it had something to do with versioning on my Javascripts library , but versioning is not even enabled there.
    What's with that? How can I prevent it?

    Hi Russell_G,
    Actually this forum is to discuss the VS IDE, to really repro this issue, I'm afraid that it would require the high SharePoint development knowledge, but based on your previous
    thread, since the SharePoint members could repro this issue.
    You can submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx,Microsoft
    engineers will evaluate them seriously. Thanks for your understanding.
    If you submit it, please share us the link here, so we could get the latest information from the product team members.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Help! my iphoto won't open!

    i haven't been able to open my iphoto for more than a month.  when i click on the icon, it jumps but doesn't open.  i know the photos aren't lost as i could still upload them on facebook.  please help!  (first generation macbook)

  • How to delete the Cost center line item data

    How to delete the cost center line item data of particular cost center and only one cost center is exisiting for that company code. Is there any way to delete the line items in that cost center. Can data archiving & deleting can help us.......... doe

  • Need help on performance tip of USE_APPLICATION_VIEW_CACHE

    Hi Experts, Using JDEVADF_11.1.1.5.0 Can we enable application view caching by setting the value of oracle.adf.view.faces.USE_APPLICATION_VIEW_CACHE in web.xml to true for JDEVADF_11.1.1.5.0? Because I can see a bug which is recommonding not to set t

  • Can not print out good quality pictures in Photoshop CS4...

    Hi, I can not print out good quality photos from my printer. Photos are dark and colors are not good either. I have Windows XP, Photoshop CS4 and printer Epson R800 . I have been trying to find out what are the right settings on the computer, printer

  • My ipod touch doesnt have ios5 anymore?

    so my ipod touch froze & had to restore, now i cant DL apps that i had that required ios5 & 4.3 or higher...my ipod touch wont update higher than 4.2....why is that?