Tuesday, 12 January 2021

Error occurred in deployment step 'Recycle IIS Application Pool': Invalid namespace SharePoint

Issue:

Recently, we were developing a custom webpart for SharePoint 2019 On-Premise. We got below error while deploying the solution:

Error occurred in deployment step 'Recycle IIS Application Pool': Invalid namespace



Analysis:

We have face this issue in past . We thought we are having issue in .Net framework of the project. We tried with reduce the .Net framework to 4.5. But that didn't solve the issue this time. Then we google the issue and found out there were some configuration changes we need to do in the development environment. 


Solution:

We found out that we need to add "IIS 6 WMI Compatibility" feature. Please follow below steps to add the same:


If you are using windows server, go to server manager.  

  • Click on “Add Roles and Feature”

 


  • It will open “add feature” dialog. Click next till you reach “Server Roles”.


  • In that, expand “Web Server (IIS)”






  • In that expand “Management Tools”

 


  • In that expand “IIS 6 Management Compatibility”

 


  • In that, check “IIS 6 WMI Compatibility”, “IIS 6 Metabase Compatibility” & “IIS 6 Management Console” and click Next.

 


Note - In my case the first two were installed. If it is not installed in your side, it will show as not checked.

  • Click Next in feature selection.

 


  • Click Install in confirmation installation screen.

 


  • It will start installing the feature. Wait for the completion.

 


  • Click close once done.

 


  • Restart the visual studio and try to deploy the project and it will deploy successfully. 

 


If you are using Windows operating system machine, then you can follow below steps to install “IIS 6 WMI Compatibility”:

  • Go to Control panel.

 


  • Click on Program.

 


  • Click on “Turn Windows Feature on or Off” (you will require admin rights for this).
  • It will open feature dialog. 
  • Open Internet Information Services.
  • Open Web Management Tools.
  • Open IIS 6.0 Management Compatibility.
  • Click to select the IIS 6 Metabase and IIS 6 configuration compatibility, IIS 6 WMI Compatibility, and IIS 6 Management Console check boxes.

 


  • Click OK.

You can set up this using powershell as well. 

Follow below steps for the same:

  • Open “Windows PowerShell” in administrator mode.
  • You need to first import server manager module. 
  • Then you can run command to run feature. 

PS C:>Import-Module servermanager

PS C:> Add-WindowsFeature Web-WMI

The output will look like below:



Sunday, 6 December 2020

Change SharePoint Online list or library Internal name

 Change SharePoint Online list or library Internal name 

Issue:

Recently we have provided a build and guideline document to our client and by mistake they have set up a library with wrong internal name. In starting it worked well but as the additional functionality added, it broke. As the users have started working on that, we needed to fix the internal name anyway. 

Our library internal name is “TrainingDocuments” and display name is “Training Documents”. While Client has set up “Training Documents”.



Solution

Initially we thought it might be not possible. But then we found 2 ways to do it:

Approach 1: Using SharePoint Designer 2013

Follow below steps to fix this using SharePoint Designer 2013:

  1. In SharePoint Designer, Open your site.
  2. Navigate to All Files navigation node (not List and Libraries node),
    Note – you will need “Site Collection Administrator” permission in the site collection to see “All Files” option.
  3. Find your list there
  4. Right-click list
  5. Rename.



Approach 2 : Using PNP PowerShell

In case you are not able to connect the site in the SharePoint designer or you do not have installed in your machine, you can do this using PNP PowerShell as well. 


PowerShell to change Library Name:

 #Set Parameters  
 $SiteURL = "Site URL"  
 $ListName = "Library Internal Name"  
 $NewListURL = "New Library Name"  
 #Connect to PNP Online  
 Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)  
  #this will change URL  
 #Get the List  
 $List= Get-PnPList -Identity $ListName -Includes RootFolder  
 #sharepoint online powershell change list url  
 $List.Rootfolder.MoveTo($NewListURL)  
 Invoke-PnPQuery  
 #this will change library title  
 Set-PnPList -Identity $ListName -Title $NewListURL  


PowerShell to change List Name:

 #Set Parameters  
 $SiteURL = "Site URL"  
 $ListName = "Library Internal Name"  
 $NewListURL = "New Library Name"  
 #Connect to PNP Online  
 Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)  
 Set-PnPList -Identity $ListName -Title $NewListURL  

File server migration to SharePoint online using SPMT PowerShell Part 2

In previous blog we have go through the csv creation part. You can find it on below link:

In this blog, we are going to use that file and SPMT migration PowerShell commands to migrate file server to SharePoint online.

Prerequisite

SharePoint Migration Tool needs to be installed in the machine

Solution

First, we are going to get credentials for

 Import-Module Microsoft.SharePoint.MigrationTool.PowerShell  
 $Global:SPOUrl = "SharePoint site collection url"  
 $Global:UserName = "username"  
 $Global:PassWord = ConvertTo-SecureString -String "Password" -AsPlainText -Force  
 $Global:SPOCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:UserName, $Global:PassWord  

 

After this we will read csv file

 #Load CSV  
 $csvItems = import-csv "C:\Migration\migrationscript.csv" -Header c1,c2,c3,c4,c5,c6  

 

Now we will register migration task. This needs to be done once for all migration task. So we will keep this out of for loop

 Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force -MigrateWithoutRootFolder -PreserveUserPermissionsForFileShare $true  

 

We are passing below two parameters

  1. MigrateWithoutRootFolder – This will not migrate parent folder. Only items withing the given path directory will be migrated. This is not mentioned in the MSDN link, but it is mentioned in the build changes document. This was included in build –  3.4.119.7

  2. PreserveUserPermissionsForFileShare – This parameter is used if you want to migrate file server permission to SharePoint online

 

Now we will loop through csv file and add migration task.

 ForEach ($item in $csvItems)  
 {       
   Write-Host $item.c1  
   Add-SPMTTask -FileShareSource $item.c1 -TargetSiteUrl $item.c4 -TargetList $item.c5 -TargetListRelativePath "/"  
 }  

 

After this we will start migration

 Start-SPMTMigration  

 

The full PowerShell will look like below:

 Import-Module Microsoft.SharePoint.MigrationTool.PowerShell  
 $Global:SPOUrl = "SharePoint site collection url"  
 $Global:UserName = "username"  
 $Global:PassWord = ConvertTo-SecureString -String "Password" -AsPlainText -Force  
 $Global:SPOCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:UserName, $Global:PassWord  
 #Load CSV  
 $csvItems = import-csv "C:\Migration\migrationscript.csv" -Header c1,c2,c3,c4,c5,c6  
 Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force -MigrateWithoutRootFolder -PreserveUserPermissionsForFileShare $true  
 ForEach ($item in $csvItems)  
 {  
   Write-Host $item.c1  
   Add-SPMTTask -FileShareSource $item.c1 -TargetSiteUrl $item.c4 -TargetList $item.c5 -TargetListRelativePath "/"  
 }  
 Start-SPMTMigration  

 

Reference

File server migration to SharePoint online using SPMT PowerShell Part 1

Recently we have a project where we need to migrate file server to SharePoint Online. So, we decided to go with SharePoint Migration Tool (SPMT). But we had 50 plus folders and all were needed to migrate to different sites documents library. As it takes long time to migrate using tool due to creating connection, we decided to use PowerShell version.

 

Issue

We faced below issues in this requirement:

  1. The documentation for this is not that accurate or in single place. We need to search here and there for things.
  2. SPMT tool migrates file server child items directly but when you use PowerShell, it migrates parent folder. Due to curse of first point, it took some time for us to find the hidden solution. Go through this post to see that hidden gem.
  3. The last but no least is permission migration. SPMT has all this functionality but as I said earlier it is not documented well.

So, we will try to explain all our knowledge in detail here.

 

Solution -

 

First, we need to prepare a csv which will be read by PowerShell and It will have connection details of source and migration.

important notes for preparing csv:

  1. Do not include a header row in your CSV file.
  2. Remember to account for all six columns in the file, even if you are not needing a value for a given field.
  3. If you use the standard out-of-the-box Document library ("Shared Documents"), you must use the Display name "Documents" as the placeholder value for the Target Document Library in your CSV file. If you enter "Shared Documents" in that column, you will receive an "invalid document library" error.

Note - If the language of the destination SharePoint site is other than English, check the Display name of the "Shared Documents" Document library by browsing to Documents library.

The format of csv is as below:

Source,SourceDocLib,SourceSubFolder,TargetWeb,TargetDocLib,TargetSubFolder


As we are migrating from file server, we will not pass the “SourceDocLib” & “SourceSubFolder” details. So, our csv detail will look like below:

File server path,,, TargetWeb,TargetDocLib,TargetSubFolder

For example,

C:\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/Sample/,DocLibraryName,DocLibraryName_subfolder

 

In case, you don’t want to migrate it to sub folder, the subfolder part will be blank

File server path,,, TargetWeb,TargetDocLib,

For example,

C:\MigrationTests\testfiles,,,https://contoso.sharepoint.com/sites/Sample/,DocLibraryName,

In next blog we will use this csv in the PowerShell.

Reference:
  1. https://docs.microsoft.com/en-us/sharepointmigration/how-to-format-your-csv-file-for-data-content-migration#:~:text=number%20of%20tasks.-,Using%20a%20comma%20separated%20value%20(CSV)%20file%20for%20data%20content,to%20create%20the%20CSV%20file

Saturday, 3 October 2020

Advantage & Limitations of SharePoint Online Modern Communication Site Footer

In our previous posts we have seen how can we enable Footer, How to add, edit remove footer logo and links and set up audience targeting in Footer links. If you have not gone through that you can use below links to checkout it out:

So Let's see what is Advantage & Limitations of the Modern Footer.

Limitations
  • OOTB footer is available for only Modern communication sites. For Modern Team sites, it is not available

    This is the biggest obstacle to use OOTB Footer. You can't have it in Modern Team site template. So if your site structure has even a single modern Team site, you need to build your own custom SPFx Footer.  

  • OOTB Footer will not be visible in mobile resolution
    I believe with digitalization all around the world, people use their tablet and mobile more than their laptop and desktop. And Modern footer is not available in that is second biggest flaw. 

  • OOTB Footer will not be visible in site content, List/ Libraries and in classic settings/Site pages like settings pages
    It is not visible in site content, list and libraries as well in Modern Communication Site. Also as these are modern feature, they will not visible in classic pages like site settings or classic site or publishing pages.

  • You can set Max 8 links/ Label in OOTB Footer except logo and footer display name
    8 Links - is very less limit. For simple layout footer we can see it will feasible but if you have extended footer layout, it looks very limited.

  • External user can not edit the footer even though you have given them full control rights
    I believe this is due to security concerns. 

  • You can not use SharePoint site groups for Audience targeting
    You need to use office 365 security groups or Modern team sites office 365 groups for the audience targeting. In this scenario, if you have just site collection admin rights, you are not able to do anything. In classic SharePoint, SharePoint groups were there. So I hope Microsoft might find a way to bring that back.

Advantage
  • Easy to configure
    The good thing is you don't need to know rocket science to configure this. Just enable a toggle button and add some links and you have a footer ready. 

    You are given a 2 types of layout to choose from. Also you can make changes in each site as per your requirement as all sites have their own footer.

  • End user or client can maintain this by themselves with minimal guidance
    This is toughest job as handover to client. You need to make sure once your work is done, anyone with given guideline can maintain things. And in compare to customized SPFx extension it will be less easy to train uses to use OOTB Footer

  • Does not occupy space on the page
    This is the best thing about that. OOTB footer append at the end of the page. Means you have full body visible. In custom SPFx, the footer will have its own part at the page. So the body content reading is an issue. See below images for example.
OOTB Footer




SPFx Extension


You can go with OOTB as well custom SPFx Footer as per your requirement. If you want to go with OOTB Footer, please convey the limitations to the end client first.

This is the end of our Footer Series. Let me know if you have any queries, then I will be happy to answer. 

Reference
  • https://docs.microsoft.com/en-us/sharepoint/dev/features/site-footer
  • https://support.microsoft.com/en-us/office/customize-the-navigation-on-your-sharepoint-site-3cd61ae7-a9ed-4e1e-bf6d-4655f0bf25ca?ui=en-us&rs=en-us&ad=us

Different Layout in SharePoint Online Modern Communication Site Footer

 In our previous posts we have seen how can we enable Footer, How to add, edit remove footer logo and links and set up audience targeting in Footer links. If you have not gone through that you can use below links to checkout it out:

So Let's see what are the layout options available in OOTB Footer and how to find this setting:

Follow below steps to check footer layout option:

  • Go to Setting -> Change the look -> Footer.
    (you can find steps in detail in first blog)


There are two types of footer layout available:
  • Simple
    In Simple layout the footer links will place in horizontal. See below screenshot for the reference:


  • Extended
    In Extended layout the footer links will place in in full width row. If the width of the link is extended, it will show in new row. See below screenshot for the reference:

You can use simple or extended layout as per your requirement. In both, you can use 8 links, Footer logo and text as per your requirement.

In next article, we will see the advantage and limitations of OOTB Footer.

Sunday, 13 September 2020

How to set up Audience Targeting in Footer links in Modern Communication Site?

In previous blogs we learn how can we enable footer, set logo and footer text and add & Edit footer links on SharePoint Online Modern Communication site. If you have not gone through that you can use below link to check that post.

In this blog, we are going to see how we can set audience targeting on the links. So, let's start with pre-requisites:

Pre-requisites:

We will need below things to set up audience targeting:
  • The site owner must enable audience targeting for site navigation.
    Only site owners can turn audience targeting on and off. Once turned on, any site editor can target menu links to specific audiences.
  • The Office 365 Admin user must set up Microsoft 365 groups and security groups.
    Currently Azure AD dynamic groups & SharePoint site groups are not currently supported. Though to overcome this, you can set up SharePoint Modern Teams sites with Office 365 groups and use that group in audience targeting.
Enable & Add Groups in Audience Targeting

Follow below steps to enable Audience Targeting:
  • Scroll to the bottom of the page.

  • Click on Edit.
    Note – If you do not see this, then you do not have enough permission.

  • It will open new panel in the left side of the screen.


  • Enable Site navigation audience targeting.
    Note - If you do not see this, then you do not have enough permission.


  • Once you enable this setting, you will see audience targeting text box while add, edit links.


  • When you start typing, it will provide auto suggest groups. For this blog, I am choosing one of my team site group for home link.


  • You can select up to 10 groups. 
  • Click Ok. 


  • Then you can see audience targeting icon beside the link.


  • Click save to save changes.


Note - While editing the navigation, all links and sub links become visible to the editor including those that are targeted. Once saved, the navigation will display to targeted users only. 

You can login with other user and check the link is hidden.




In next blog, we will check the layout options for the footer.

Thursday, 30 July 2020

How to add, edit and Remove Footer links in Modern communication site

In previous blogs we learn how can we enable footer and set logo and footer text on SharePoint Online Modern Communication site. If you have not gone through that you can use below link to check that post.


In this blog, we are going to see what are the options to add links. So let's get started.

Once you enable footer, you can see footer in the bottom of the footer.

Add Footer Links:
To add footer links, follow below steps:
  • Scroll to the bottom of the page.
  • Click on Edit.
    Note – If you do not see this, then you do not have enough permission.
  • It will open new panel in the left side of the screen.

  • If you want to display links to specific group, enable Site navigation audience targeting. We will discuss about this in detail in next blog

  • Click on “+” icon to add new link.
  • When you click “+” icon, it will open dialog besides it. You need to fill below values:
    • Choose whether you want to add link or label
      • If you select link, you can provide “Address”. In this you can specify URL where user will be redirect on click.

      • If you select label, address field is disabled.

    • Provide Display Name. 
    • Click OK.
  • Repeat above steps to add more links/ label. You can total 8 links. After 8 links add button will be disabled.

  • Click “Save” once all changes are done.
  • Refresh page to see result if you don't see changes after save click.

Edit Footer Links:
    To edit footer text, follow below steps:
    • Scroll to the bottom of the page. 
    • Click on Edit.
      Note – If you do not see this, then you do not have enough permission.

    • It will open new panel in the left side of the screen.
    • Click on “…” beside link / label. 
    • It provides multiple options like
      • Edit - It will provide option to edit
      • Move Up - It will move current link to one step up.
      • Move Down - It will move current link to one step down. 
      • Remove - It will remove the link

    • Click on Edit.
    • It will open edit link dialog. This will be same as we explain in add link.
    • Make changes and click OK.
    • Click Save.
    • Refresh page to see result if you don't see changes after save click

    Remove Footer Links:
    To remove footer text, follow below steps:
    • Scroll to the bottom of the page. 
    • Click on Edit.
      Note – If you do not see this, then you do not have enough permission.

    • It will open new panel in the left side of the screen.
    • Click on “…” beside link / label. It will provide multiple option. 
    • Click on remove.

    • Click Save.
    • Refresh page to see result if you don't see changes after save click.


    In next blog we will check out the audience targeting settings for the Footer links. 

    Monday, 27 July 2020

    How to set footer logo and footer text in Modern communication site

    In last blog we learn how can we enable footer on SharePoint Online Modern Communication site. If you have not gone through that you can use below link to check that post.

    In this blog, we are going to see what are the options to set logo and text. So let's get started.

    Follow below steps to set footer logo:

    • Go to Setting -> Change the look -> Footer.
      (you can find steps in detail in first blog)
    • There you can see upload logo option. Click upload. Select the file from your local system. 

    • Click save

    • It will be displayed to footer.

    To add footer text, follow below steps:
    • Go to Settings -> Change the look -> Footer
    • Add text in display name.

    • Click Save.
    • It will show in the left bottom corner.

    In next blog we will see how we can set footer links. What are layout option to show the links and what are the limitation of the Modern footer.

    Saturday, 25 July 2020

    How to enable Footer in a SharePoint Modern Communication Site

    SharePoint Online introduce Modern Sites and with it introduce OOTB Footer. Generally we are not used to it but one of our customer wanted to learn more about it and asked us to prepare document on it.

    We thought as it has been some time, we will get detailed blog on it easily. But it seems it is been described only in Microsoft Document. And I have put reference of it in the end of this post. It is good but it seems very less described and not updated with new updates. So I am trying to explain it in as detail as I can in this footer series. So lets get started.

    First of all we need to make sure the Footer is enabled in the Modern Communication SharePoint site.

    Notes -
    • Footer is not available in Modern Team site as of now.  
    • Footer will be enabled by default for all new communication sites after the feature is rolled out. If you can see the footer on your modern communication site, skip this steps
    Follow below steps to enable the Footer:
    • Click on “Settings”.
    • Click on “Change the look” option.
      Note – If you are not seeing this option then you do not have enough permission on this site.



    • Click on Footer

    • Make sure footer is enabled. If not enable it.

    • Once you enable, it will show different option. We will look in to them in next post. Click Save.

    • Once your enable it , it will display in the bottom of the page.


    You can enable this using PowerShell as well. For this you will need PNP Powershell installed in your system. In case you don't have PNP PowerShell Set up, check this blog.

    Below is PNP PowerShell command to enable footer:

    Connect-PnPOnline -Url "<SiteURL>" –Credentials (Get-Credential) 
    Set-PnPFooter -Enabled:$false

    Lets configure the footer in the next blog.

    Reference:
    https://docs.microsoft.com/en-us/sharepoint/dev/features/site-footer

    The "Mark as Decorative" Feature in SharePoint: A Small Toggle With a Big Accessibility Impact

    If you've spent any time building pages in SharePoint Online, you've probably noticed a new checkbox tucked inside the Accessibility...