PnP
12 TopicsConnect-MicrosoftTeams Errors
I have a powershell script that automatically creates a group when someone creates a SharePoint list item. Now, I want to set it up to create a Team instead. I'm running the following code trying to connect to Microsoft Teams with the new MicrosoftTeams powershell module. $username = 'myuser@mydomain.com'; $pwdContents = ***** $securePassword = convertto-securestring($pwdContents) -key (1..16); $credential = New-Object System.Management.Automation.PSCredential($username, $securePassword) Connect-MicrosoftTeams -AccountId $username -Credential $credential; I'm getting this error Connect-MicrosoftTeams : One or more errors occurred.: AADSTS75005: The request is not a valid SAML 2.0 protocol message. Trace ID: 82a820ba-19de-4cf2-87f4-61c21d8d3100 Correlation ID: 07667e10-a183-4dc3-8b21-8cf79b172f3e Timestamp: 2018-02-06 20:33:18Z At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], AadAuthenticationFailedException + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams Connect-MicrosoftTeams : One or more errors occurred. At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], AggregateException + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams Connect-MicrosoftTeams : AADSTS75005: The request is not a valid SAML 2.0 protocol message. Trace ID: 82a820ba-19de-4cf2-87f4-61c21d8d3100 Correlation ID: 07667e10-a183-4dc3-8b21-8cf79b172f3e Timestamp: 2018-02-06 20:33:18Z At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], AdalServiceException + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams Connect-MicrosoftTeams : Response status code does not indicate success: 400 (BadRequest). At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], HttpRequestException + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams Connect-MicrosoftTeams : {"error":"invalid_request","error_description":"AADSTS75005: The request is not a valid SAML 2.0 protocol message.\r\nTrace ID: 82a820ba-19de-4cf2-87f4-61c21d8d3100\r\nCorrelation ID: 07667e10-a183-4dc3-8b21-8cf79b172f3e\r\nTimestamp: 2018-02-06 20:33:18Z","error_codes":[75005],"timestamp":"2018-02-06 20:33:18Z","trace_id":"82a820ba-19de-4cf2-87f4-61c21d8d3100","correlation_id":"07667e10-a183-4dc3-8b21-8cf79b172f3e"} At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], Exception + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams Connect-MicrosoftTeams : One or more errors occurred.: AADSTS75005: The request is not a valid SAML 2.0 protocol message. Trace ID: 82a820ba-19de-4cf2-87f4-61c21d8d3100 Correlation ID: 07667e10-a183-4dc3-8b21-8cf79b172f3e Timestamp: 2018-02-06 20:33:18Z At line:1 char:5 + Connect-MicrosoftTeams -Credential $credential; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-MicrosoftTeams], AadAuthenticationFailedException + FullyQualifiedErrorId : Microsoft.Open.Teams.CommonLibrary.AadAuthenticationFailedException,Microsoft.Open.Teams .CommonLibrary.ConnectMicrosoftTeams I've also tried using an access token, which appears to get me connected but none of the subsequent commands work. $appid = "xxxxxxx"; $client_secret = "xxxxxx"; $tenant_id = "xxxxxx"; $resource = "https://graph.microsoft.com"; $username = 'myusername@mydomain.com' $conn = connect-pnpmicrosoftgraph -AppId $appid -AppSecret $client_secret -AADDomain "huroncg.onmicrosoft.com" -Verbose; $access_token = Get-PnPAccessToken; Connect-MicrosoftTeams -AccountId $username -AadAccessToken $access_token; When I do this, the connection appears to work, but when I run something like get-team, I get the dreaded 'Object not set to an instance of an object error' PS > get-team get-team : Object reference not set to an instance of an object. At line:1 char:1 + get-team + ~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Team], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.TeamsCmdlets.PowerShell.Custom.GetTeam What am I doing wrong?16KViews0likes6CommentsPnP provisioning engine CSOM with Multi Factor Authentication tenant
I am trying to use PnP Provisioning engine to create site based on a template. The tenant that I am connecting to to create the site is using Multi Factor Authentication. I don't see a obvious way to authenticate and proceed with creation of sites based on tempalte. Could you please help me here with either sample or an approach to tackle this issue. I am using .NET C# in CSOM in a Console app. Thanks, Vijay1.6KViews0likes1Commentinclude site assets library files and display templates when exporting team sites pnp
I am trying to include the files in SiteAssets folder which contains some HTML and CSS (custom) that is used in the solution. I am not able to include and does not show in the XML template file. ptci.PersistBrandingFiles = true; ptci.IncludeSiteCollectionTermGroup = true; ptci.IncludeSearchConfiguration = true; I don't see an option that i can set include contents. we would this so we can easily port the base templates custom look that we have in site assets. Thanks, Vijay2KViews0likes1CommentSet-SPOProvisioningTemplateMetadata strips out the Providers tag from the provisioning template
Hi there, I've discovered that when I execute Set-SPOProvisioningTemplateMetadata to set the Template DisplayName property, it strips the Providers section from the template. The template validates against the schema matching it's version. I'm attaching what the XML template looks like before and after executing the commandlet. Please help. Thank you, Jan1.4KViews0likes2CommentsRunning SPFX WorkBench in SharePoint Online
Hi there, I am experiencing an issue when running the SPFX Workbench in my SharePoint Online Development Site Collection. Everything opens fine, but when I add the "Hello World" Web Part it just sits there "Loading Hello World" and does not actually insert the part (see image). Anyone experienced anything similar?2KViews0likes1CommentIssue provisioning a Page using PartnerPack and Extensibility Provider
Hi there, I've been successful in provisioning a Page using an extensibility handler when executing through a console application. I'm using the https://github.com/SharePoint/PnP/https://github.com/SharePoint/PnP/tree/master/Samples/Provisioning.Extensibility sample code and it's working as expected. I then take the Provider section of the provisioning template and stick it into a .PnP template file and use the ParnerPack to provision a sub-site using the template. I can step through the extensibility handler code as it's called, and it seems to do exactly the same as when called from the console app... no exceptions are raised... and yet - the page is never created! What could be the cause of this failure? The only difference (obvious to me) is the credentials with which the process is executed..the PartnerPack is running with App-only permissions, using a certificate to authenticate. The console app was running with my credentials (site collection owner). Any help/ideas would be much appreciated! Jan1KViews0likes0Commentsconnect-pnpmicrosoftgraph Has Been Deprecated
I have a script that creates an Office 365 group and the associated SharePoint site using PnP PowerShell. I recently updated the SharePointPnPPowerShell assemblies to version 2.20.1711.0. Now I'm getting a warning that connect-pnpmicrosoftgraph has been deprecated and will be removed in April 2018. I have found that connect-pnponline is it's replacement but I'm having trouble connecting. For connect-pnpmicrosoftgraph, I'm using $conn = connect-pnpmicrosoftgraph -AppId $appid -AppSecret $client_secret -AADDomain "mydomain.onmicrosoft.com" -Verbose; When I look at the details of Connect-PnPOnline with Microsoft Graph using Azure Active Directory, I see the same parameters, but running this throws an error connect-pnponline : Value cannot be null. Parameter name: uriString At line:1 char:9 + $conn = connect-pnponline -AppId $appid -AppSecret $client_secret -AA ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], ArgumentNullException + FullyQualifiedErrorId : System.ArgumentNullException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline Upon further investigation, it appears that AADDomain is incorrect and that I should be using url. But I'm at a loss as to what I'm supposed to use here. I've tried mydomain.onmicrosoft.com, but get an error Connect-PnPOnline : Invalid URI: The format of the URI could not be determined. At line:1 char:1 + Connect-PnPOnline -url "mydomain.onmicrosoft.com" -AppId "xxxxxxx-xxx ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], UriFormatException + FullyQualifiedErrorId : System.UriFormatException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline So I tried https://mydomain.onmicrosoft.com, but get this error Connect-PnPOnline : Token request failed. At line:1 char:1 + Connect-PnPOnline -url "https://mydomain.onmicrosoft.com" -AppId "xxxx ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], RequestFailedException + FullyQualifiedErrorId : Microsoft.IdentityModel.SecurityTokenService.RequestFailedException,SharePointPnP.PowerShell.Commands.Base.Conne ctOnline Same when I use https://graph.microsoft.com, and https://mydomain-admin.sharepoint.com Using https://mydomain.sharepoint.com gives me a 403 forbidden error. What is the correct replacement URL for connect-pnpmicrosoftgraph?Solved7.9KViews1like10CommentsCan we create mulitple sites using pnp template
Hello Everyone, I am able to find below script which will create bunch of site collections from CSV , however I am not able to acheive on how to apply PNP template for all these sites. We want to have same webparts, lists and libraries across all the site using pre-created .xml template using PNP. try { Set-ExecutionPolicy Bypass -Scope Process #Prompt for Tenant url $TenantUrl = Read-Host -Prompt 'Enter your SharePoint online tenant url' Connect-pnpOnline -url $TenantUrl $siteCollectionList = Import-Csv -Path "C:\temp\SiteCollections.csv" #Loop through csv and provision site collection from each csv entry foreach ($siteCollection in $siteCollectionList) { $SharePointUrl = $siteCollection.Url $SiteOwner = $siteCollection.Owner $Title = $siteCollection.Title $Template = $siteCollection.SiteTemplate $TimeZone = $siteCollection.TimeZone #Create site collection based on values above New-PnPTenantSite -Owner $SiteOwner -Title $Title -Url $SharePointUrl -Template $Template -TimeZone $TimeZone } } catch { Write-Host $error[0].Message } I would like to apply PNPprovosioning template for these sites. Apply-PnPProvisioningTemplate -Path C:\kumar\PowerShell\template.xml -clearnavigation How can I incorporate this to above script and loop it for all the sites?701Views0likes0Comments