sp-dev-docs
sp-dev-docs copied to clipboard
Connect-PnPOnline : A parameter cannot be found that matches parameter name 'Graph
I am trying to follow the instructions to provision a Teams team, and running into several issues. One of them is with the Graph parameter:
Connect-PnPOnline : A parameter cannot be found that matches parameter name 'Graph'.
At line:1 char:19
+ Connect-PnPOnline -Graph -LaunchBrowser
The Teams template doesn't work either. I suspect that the instructions on the page are outdated but I don't know how to fix that.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 3bc20d32-118d-065f-999a-e472744711cf
- Version Independent ID: 140b729e-bc65-3036-f356-a2c8bbb69a1f
- Content: PnP Provisioning Tenant Templates
- Content Source: docs/solution-guidance/pnp-provisioning-tenant-templates.md
- Product: sharepoint
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Not sure if it is related, but issues with Teams provisioning have been reported in other places (and closed without being resolved). An example: https://github.com/pnp/powershell/issues/502
One more comment, the page references Apply-PnPTenantTemplate
, that's what tells me the content might be outdated. Anyway, using Invoke-PnPTenantTemplate
instead still doesn't work. I get the following errors:
- if I use the sample team code as is
Invoke-PnPTenantTemplate : 'pnp' is an undeclared prefix. Line 1, position 3.
At line:1 char:1
+ Invoke-PnPTenantTemplate -Path "C:\Users\chris\Teams PnP Provisioning ...
- if I include pnp:Provisioning
Invoke-PnPTenantTemplate : There is an error in XML document (0, 0).
At line:1 char:1
+ Invoke-PnPTenantTemplate -Path "C:\Users\chris\Teams PnP Provisioning ...
@PathToSharePoint Can you share your template? You normally need to have the xml namespace declaration set on the topmost element of every XML file in your template (if you have split your template out using xsi:include)
@PathToSharePoint Also, you'll need to specify which version of the module you are running if you have a missing parameter error.
Thanks for the replies @jimmywim !
I installed PnP PowerShell 1.11 on the machine. I am also seeing something called PnpDevice and I don't know where it comes from.
And here is my test xml (usernames redacted)
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema"
Author="John White"
Generator="Human being"
Version="1.0"
Description="A sample Provisioning document"
DisplayName="Sample Provisioning"
ImagePreviewUrl="https://sharepointpnp.com/ImagePreview.png"><pnp:Teams>
<pnp:Team DisplayName="My Test Team" Description="My Test Team Description" Visibility="Private" Photo="TeamData/TEAM_ef3020c6-1953-4367-b7c5-a6da8e24d049/photo_ef3020c6-1953-4367-b7c5-a6da8e24d049_432X432.jpg" Specialization="None">
<pnp:FunSettings />
<pnp:GuestSettings AllowCreateUpdateChannels="false" />
<pnp:MembersSettings />
<pnp:MessagingSettings />
<pnp:Security>
<pnp:Owners>
<pnp:User UserPrincipalName="****@*****.onmicrosoft.com" />
</pnp:Owners>
<pnp:Members>
<pnp:User UserPrincipalName="****@*****.onmicrosoft.com" />
</pnp:Members>
</pnp:Security>
</pnp:Team>
</pnp:Teams>
</pnp:Provisioning>
@PathToSharePoint I think you may need to wrap your pnp:Teams
element in a pnp:Tenant
element.
EDIT: Disregard, it's a "top" level element.
For reference, what the schema says:
<pnp:Provisioning
xmlns:pnp="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema"
Version="xsd:decimal"
Author="xsd:string"
Generator="xsd:string"
ImagePreviewUrl="xsd:string"
DisplayName="xsd:string"
Description="xsd:string">
<pnp:Preferences />
<pnp:Localizations />
<pnp:Tenant />
<pnp:Templates />
<pnp:Sequence />
<pnp:Teams />
<pnp:AzureActiveDirectory />
<pnp:Drive />
<pnp:ProvisioningWebhooks />
</pnp:Provisioning>
Source: https://github.com/pnp/PnP-Provisioning-Schema/blob/master/ProvisioningSchema-2022-09.md