Pnp-powershell: New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for Geos that are not the default one.

Created on 18 May 2020  Â·  16Comments  Â·  Source: pnp/PnP-PowerShell

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-SPOProvisioningTemplate or Get-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is _not_ located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

Missing feature which is the Issue

Expected behavior

New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for geos that are not the default one. A parameter to set PreferredDataLocation is needed, so that TeamSites can be created on other geos

Actual behavior

New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for geos that are not the default one.

Steps to reproduce behavior

Run the below command in Multi - Geo tenant which is not the default one.
$teamSiteUrl = New-PnPSite -Type TeamSite -Title "Site Title" -Alias "Site Url/Group Name"

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable)

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
fixed-next-drop enhancement

All 16 comments

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

Hi,

We have the same issue with the CSOM as well. do we need to raise a new ticket and will be handled within this ticket itself?

Trying to see if I can get my hands on a Multi Geo environment to test this out.

I have created two PRs which should accommodate this (https://github.com/pnp/PnP-Sites-Core/pull/2672) and (https://github.com/pnp/PnP-PowerShell/pull/2708), but as I don't have access to a multi geo enabled tenant, I'm looking for someone who can test this for me. @nithin-kpr, can you do this? I would give you a custom build of PnP PowerShell which you can use to test this out.

@TroyHostetter could you perhaps help out testing this update?

The interesting thing is you cannot hubify from the SPO Admin panel on a geo tenant either.

The interesting thing is you cannot hubify from the SPO Admin panel on a geo tenant either.

The change requested here would be about being able to create a site collection in a geography you specify. I'm looking for someone with access to a multi geo enabled tenant which can test if this update works well for that. Could you help out?

Yes .. I'll give it a test.

Awesome @TroyHostetter! What you would need to do to test this is download this specific build:

SharePointPnPPowerShellOnline.zip

Take these files and copy them over your current PnP PowerShell files. You can find out where they are located by doing a import-module sharepointpnppowershellonline followed by Get-Module | Select Name, Path. Ensure you have no open PowerShell windows which may have loaded the PnP PowerShell module already when you copy over the files or you will get files locked errors. Once copied over, start a new PowerShell window, connect to your tenant and run New-PnPSite -Title "Test" -Description "Test" -Alias "test" -Type TeamSite -PreferredDataLocation "NAM" to try this out. NAM you can substitute with EUR or APC.

Let me know if this works or you run into issues.

After this test, if you want to restore to the normal PnP PowerShell release on your machine, easiest is to just run uninstall-module SharePointPnPPowerShellOnline followed by Install-Module SharePointPnPPowerShellOnline again.

Hello Koen,

I tried to run the New-PnPSite command by adding the parameter 'PreferredDataLocation' and I get the below error:

New-PnPSite : A parameter cannot be found that matches parameter name 'PreferredDataLocation'.
At line:1 char:99

  • ... nithinmodern" -Alias "SPTestnithinmodern" -PreferredDataLocation Aust
  • ~~~~~~

    • CategoryInfo : InvalidArgument: (:) [New-PnPSite], ParameterBindingException

    • FullyQualifiedErrorId : NamedParameterNotFound,SharePointPnP.PowerShell.Commands.NewSite

I am running the below version of PNP, please let me know if something is missing :

Name Version
---- -------
SharePointPnPPowerShellOnline 3.21.2005.2
SharePointPnPPowerShellOnline 3.19.2003.0

Have a Good Day,


Nithin KalariParambath
Senior Consultant |Global Applications
P Please consider the environment and do not print this email unless absolutely necessary.
Capgemini encourages environmental awareness.

From: Koen Zomers notifications@github.com
Sent: Friday, June 5, 2020 7:05 PM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Kalariparambath, Nithin nithin.kalariparambath@capgemini.com; Mention mention@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for Geos that are not the default one. (#2682)

I have created two PRs which should accommodate this (pnp/PnP-Sites-Core#2672https://github.com/pnp/PnP-Sites-Core/pull/2672) and (#2708https://github.com/pnp/PnP-PowerShell/pull/2708), but as I don't have access to a multi geo enabled tenant, I'm looking for someone who can test this for me. @nithin-kprhttps://github.com/nithin-kpr, can you do this? I would give you a custom build of PnP PowerShell which you can use to test this out.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/pnp/PnP-PowerShell/issues/2682#issuecomment-639483576, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APUBUTM6OZWIS53U7ZHI7PDRVDYAPANCNFSM4NEIOG7Q.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

@nithin-kpr, have you followed my steps from this post https://github.com/pnp/PnP-PowerShell/issues/2682#issuecomment-639496737?

@nithin-kpr, Australia would be AUS instead of AUST, see: https://docs.microsoft.com/en-us/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes

Ohh.. sorry… will try the steps you have mentioned and will let you know.
Thank you

Have a Good Day,


Nithin KalariParambath
Senior Consultant |Global Applications
P Please consider the environment and do not print this email unless absolutely necessary.
Capgemini encourages environmental awareness.

From: Koen Zomers notifications@github.com
Sent: Friday, June 5, 2020 7:48 PM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Kalariparambath, Nithin nithin.kalariparambath@capgemini.com; Mention mention@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for Geos that are not the default one. (#2682)

@nithin-kprhttps://github.com/nithin-kpr, have you followed my steps from this post #2682 (comment)https://github.com/pnp/PnP-PowerShell/issues/2682#issuecomment-639496737?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/pnp/PnP-PowerShell/issues/2682#issuecomment-639524908, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APUBUTPZCDI64YZVD5NUO6TRVD5BVANCNFSM4NEIOG7Q.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Hello Koen,

I have tested it for both Aus and Nam regions and it works!!

Thanks a lot for your help!!

Do let us know in which version would this be officially released.

Have a Good Day,


Nithin KalariParambath
Senior Consultant |Global Applications
P Please consider the environment and do not print this email unless absolutely necessary.
Capgemini encourages environmental awareness.

From: Koen Zomers notifications@github.com
Sent: Friday, June 5, 2020 7:49 PM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Kalariparambath, Nithin nithin.kalariparambath@capgemini.com; Mention mention@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] New-PnPSite command does not allow creating TeamSites in MultiGeo tenants, for Geos that are not the default one. (#2682)

@nithin-kprhttps://github.com/nithin-kpr, Australia would be AUS instead of AUST, see: https://docs.microsoft.com/en-us/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/pnp/PnP-PowerShell/issues/2682#issuecomment-639525714, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APUBUTL2FL2RKZNKHSGNYV3RVD5GTANCNFSM4NEIOG7Q.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Nice! Thanks for testing @nithin-kpr. I'll make a slight modification to it so it accepts pre-defined values a.k.a. an enumerator instead of a free text string to indicate to which region you want to deploy the site collection, to make it easier for people to use it and void mistakes and typos.

This update will be included in the next PnP PowerShell release which will be released upcoming Tuesday, June 9th, 2020. Closing this issue trusting it will work. If it doesn't work well in the June 2020 release, feel free to reopen.

Tried this solution too and it worked like a charm. Unfortunatly the current version (Useweblogin > NewPnpSite > App-Only Error #2849) and my latest try (version 3.23.2007.1) do not work. Do you know when this function will appear in a productive version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pmatthews05 picture pmatthews05  Â·  18Comments

jagsridharan picture jagsridharan  Â·  31Comments

janegilring picture janegilring  Â·  23Comments

chriswharton22 picture chriswharton22  Â·  23Comments

DanielSanIT picture DanielSanIT  Â·  59Comments