{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/229","repository_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell","labels_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/229/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/229/events","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/229","id":132349426,"number":229,"title":"Get-SPOWebPartXml fails on-premise","user":{"login":"CedricOettel","id":17041610,"avatar_url":"https://avatars.githubusercontent.com/u/17041610?v=3","gravatar_id":"","url":"https://api.github.com/users/CedricOettel","html_url":"https://github.com/CedricOettel","followers_url":"https://api.github.com/users/CedricOettel/followers","following_url":"https://api.github.com/users/CedricOettel/following{/other_user}","gists_url":"https://api.github.com/users/CedricOettel/gists{/gist_id}","starred_url":"https://api.github.com/users/CedricOettel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CedricOettel/subscriptions","organizations_url":"https://api.github.com/users/CedricOettel/orgs","repos_url":"https://api.github.com/users/CedricOettel/repos","events_url":"https://api.github.com/users/CedricOettel/events{/privacy}","received_events_url":"https://api.github.com/users/CedricOettel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-02-09T07:20:11Z","updated_at":"2016-09-06T20:34:00Z","closed_at":"2016-09-06T20:34:00Z","body":"Hello, \r\n\r\nthe current discussion can be found here https://www.yammer.com/itpronetwork/#/Threads/show?threadId=651850039\r\n\r\nLatest Version from 08.02.2016 was used.\r\n\r\nGet-SPOWebPartXml throws an 401 Unauthorized exception for on-premise Environment. \r\nI looked at Get-SPOContext and found out, that Credentials property was empty! The cmdlet uses ClientContext.Credentials for the HTTPRequest.\r\n\r\n For connecting in general i ran the following command:\r\n `Connect-SPOnline -Url \"<path>\" -CurrentCredentials `\r\n\r\n After Setting the Network credentials, it starts to work:\r\n` (Get-SPOContext).Credentials = [System.Net.CredentialCache]::CurrentNetworkCredentials;`\r\n` Get-SPOWebPartXml -ServerRelativePageUrl \"/...\" -Identity <Guid>`"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/comments/245081698","html_url":"https://github.com/OfficeDev/PnP-PowerShell/issues/229#issuecomment-245081698","issue_url":"https://api.github.com/repos/OfficeDev/PnP-PowerShell/issues/229","id":245081698,"user":{"login":"erwinvanhunen","id":7666381,"avatar_url":"https://avatars.githubusercontent.com/u/7666381?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinvanhunen","html_url":"https://github.com/erwinvanhunen","followers_url":"https://api.github.com/users/erwinvanhunen/followers","following_url":"https://api.github.com/users/erwinvanhunen/following{/other_user}","gists_url":"https://api.github.com/users/erwinvanhunen/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinvanhunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinvanhunen/subscriptions","organizations_url":"https://api.github.com/users/erwinvanhunen/orgs","repos_url":"https://api.github.com/users/erwinvanhunen/repos","events_url":"https://api.github.com/users/erwinvanhunen/events{/privacy}","received_events_url":"https://api.github.com/users/erwinvanhunen/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T20:34:00Z","updated_at":"2016-09-06T20:34:00Z","body":"Hi Cedric,\r\n\r\nSorry for the delay in replying. This is due to the way we retrieve the XML for a webpart (we call a page through a web request which requires us to set credentials). We're working on a different solution (= it requires a addition to the CSOM SDK) for this, which will not require you to set the credentials as you're currently doing. I will close this issue right now as you seem to have solved it for you. The moment the CSOM SDK has been updated we will switch to a different way to retrieve the webpart XML and issue will solve itself. For now I will close this issue."}}
{"actor":{"display_login":"erwinvanhunen"}}