question

PrateekSrivastava-2439 avatar image
0 Votes"
PrateekSrivastava-2439 asked DenisBoico-3815 published

How to check if the new SharePoint Online site created using PnP powershell is ready

I created a new SP Online site using PnP cmdlet.
New-PnPTenantSite

Is there a way to track if the new site is ready or getting provisioned?

office-sharepoint-online
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PrateekSrivastava-2439
I'm checking how the things are going on about this issue. Whether the answer helps you?

You can accept the answer if it helps.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




0 Votes 0 ·

Try to use -wait
like New-PnPTenantSite -Title Contoso -Url "https://tenant.sharepoint.com/sites/contoso" -Owner user@example.org - Wait -TimeZone 4 -Template STS#

0 Votes 0 ·

1 Answer

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT edited

@PrateekSrivastava-2439

  1. You could visit the site collection directly using the URL to check whether the site collection is exist.

  2. You could use PowerShell to check whether the site collection is exist.

    $AdminCenterURL = "https://tenant -admin.sharepoint.com"
    $SiteURL = "site collection URL "

    $Cred = Get-Credential

    Try
    {
    #Connect to Tenant Admin
    Connect-PnPOnline -URL $AdminCenterURL -Credential $Cred

       #Check if site exists
         $Site = Get-PnPTenantSite | Where {$_.Url -eq $SiteURL}
         If ($Site -eq $null)
         {
             Write-host "Site Collection $($SiteURL) doesn't exists!" -foregroundcolor Yellow
         }
         Else
         {
             Write-host "Site $($SiteURL) exists already!" -foregroundcolor Green
         }
     }
     catch {
         write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
     }
    
  3. Go to SharePoint admin center -> Sites -> Active sites -> Search the site collection name to check whether the site collection is exist.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The problem is Get-PnPTenantSite always returns true if you call this immediately after New-PnPTenantSite.

But by that time the site doesn't show up under Active Sites.

And so if you try to connect the newly created site ,it throws an error as the site is still in the process of being created

0 Votes 0 ·
EmilyDu-MSFT avatar image EmilyDu-MSFT PrateekSrivastava-2439 ·

@PrateekSrivastava-2439

This shows that the site has not been created.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




0 Votes 0 ·