sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Connect-PnPOnline : A parameter cannot be found that matches parameter name 'Graph

Open PathToSharePoint opened this issue 2 years ago • 8 comments

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.

PathToSharePoint avatar Oct 15 '22 19:10 PathToSharePoint

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Oct 15 '22 19:10 ghost

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

PathToSharePoint avatar Oct 15 '22 19:10 PathToSharePoint

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 avatar Oct 16 '22 01:10 PathToSharePoint

@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)

jimmywim avatar Oct 17 '22 16:10 jimmywim

@PathToSharePoint Also, you'll need to specify which version of the module you are running if you have a missing parameter error.

jimmywim avatar Oct 17 '22 16:10 jimmywim

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.

image

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 avatar Oct 17 '22 17:10 PathToSharePoint

@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.

jimmywim avatar Oct 17 '22 17:10 jimmywim

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

PathToSharePoint avatar Oct 17 '22 17:10 PathToSharePoint