OfficeDev / microsoft-teams-emergency-operations-center

The Microsoft Teams Emergency Operations Center (TEOC) solution template leverages the power of the Microsoft 365 platform to centralize incident response, information sharing and field communications using powerful services like Microsoft Lists, SharePoint and more.
MIT License
95 stars 40 forks source link

Registering Entra ID to support PowerShell Script for TEOC #251

Closed 3666228 closed 1 month ago

3666228 commented 2 months ago

I am stuck at the point of setting up my Entra ID - Step 13. Request API permissions and selecting 'SharePoint'. The option is not available to me. Hoping once this is complete my script will run without error due to the 9/9/24 update.

v-ajaysahu commented 2 months ago

@3666228 , Thank you for bringing this issue to our attention. Could you let us know if you were successful in registering the Entra App ID as outlined in the wiki? Additionally, it would be helpful if you could specify the exact step where you encountered difficulties, especially since the wiki does not list a Step 13.

3666228 commented 1 month ago

Here is the wiki link I was directed to from PowerShell when I get the 'After September 9th Error'. This is where I am referencing the step 13 aspect. https://pnp.github.io/powershell/articles/registerapplication.html

v-ajaysahu commented 1 month ago

@3666228 , Currently, you're using a manual method. Could you switch to the automatic process? It automatically generates an Entra ID and assigns the appropriate permissions.

https://pnp.github.io/powershell/articles/registerapplication.html#automatically-create-an-app-registration-for-interactive-login

3666228 commented 1 month ago

Now, I am getting the following error.

1

3666228 commented 1 month ago

Mind you I changed the psi script to the following.

param([string]$AdminEmail, [string]$TenantName)

$FilePath = Read-Host "Enter site template XML schema file path"; $FilePath = $FilePath.Trim();

Write-Host $FilePath

$TenantName = Read-Host "Enter tenant name: (contoso)"; $TenantName = $TenantName.Trim();

$AdminEmail = Read-Host "Enter tenant admin email"; $AdminEmail = $AdminEmail.Trim();

$SiteName = Read-Host "Enter site name. Allowed characters for site name are underscore, dashes, single quotes, and periods (_,-,',.), and can't start or end with a period."; $SiteName = $SiteName.Trim();

$SiteURL = $SiteName -replace " ", ""

$TenantURL = "https://$TenantName.sharepoint.us" $EOCSiteURL = "/sites/$SiteURL"

Connect-PnPOnline -Url $TenantURL -Interactive -ClientID cc806dec-028f-4a10-a12d-5ae6b186c893

try { Write-Host "Checking if site already exists at $EOCSiteURL" $site = Get-PnPTenantSite -Url $TenantURL$EOCSiteURL -ErrorAction SilentlyContinue

if ($null -ne $site) {
    Write-Host "Site already exists, exiting the PowerShell script"
    return;
}
else {
    Write-Host "Site doesn't exist, creating new site at $EOCSiteURL"
}

try {
    if (($TenantURL + $EOCSiteURL).Length -lt 128) {
        New-PnPSite -Type TeamSiteWithoutMicrosoft365Group -Title $SiteName -Url $TenantURL$EOCSiteURL -Owner $AdminEmail -ErrorAction Stop -WarningAction SilentlyContinue
    }
    else {
        Write-Host "Site creation failed. Site URL cannot have more than 128 characters." -ErrorAction Stop
        return
    }
}
catch {
    Write-Host "`nError Message: " $_.Exception.Message
    Write-Host "Site creation failed. Site name cannot contain symbols other than underscore, dashes, single quotes, and periods (_,-,',.), and can't start or end with a period."
    return;

}

Connect-PnPOnline -Url $TenantURL$EOCSiteURL -Interactive 
Write-Host "Creating lists in $SiteName site"

Invoke-PnPSiteTemplate -Path $FilePath -ErrorAction Stop -WarningAction SilentlyContinue

Write-Host "App Provision complete."

} catch { Write-Host "nError Message: " $_.Exception.Message Write-Host "nApp Provisioning failed." }

v-ajaysahu commented 1 month ago

@3666228 , We've updated our PowerShell script, and you can access it via the following link: https://github.com/OfficeDev/microsoft-teams-emergency-operations-center/tree/main/Deployment/provisioning. Regarding the issues you're encountering, they are associated with PnP. You have the option to consult our wiki for deployment guidance or contact the PnP team for further assistance.

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.