SharePoint 2016: How to setup Development Environment for CSOM based PowerShell Development

Since the evolution of PowerShell Development framework that can be used in conjunction with CSOM API of SharePoint. This type of development could be relatively more useful in scenarios where we do not have direct access to SharePoint Server and only client machines are accessible.

In this article we will explore the steps that can be helpful in setting up the client machines for PowerShell development.

Following are the steps that we can follow to setup the client machines:

Step 1: Download Windows Management Framework 3.0

  • Visit the following URL

https://www.microsoft.com/en-us/download/details.aspx?id=34595

  • Click on download1
  • Select “Windows6.1-KB2506143-x64.msu” file to download
  • Click Next

2

  • Save the downloaded file to the local folder.

3

Step 2: Install Windows Management Framework 3.0

  • Run the Exe File “Windows6.1-KB2506143-x64.msu”

4

Wait till the installer has been completed

5

Step 3: Copy SharePoint CSOM DLLs

Add all the SharePoint CSOM DLLs from any SharePoint System to the local folder

6

Step 4: Add the DLL references

Add reference to the required SharePoint DLLs to the PowerShell Code

At the bare minimum we need to add the reference of the following two DLLs:

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

7

Step 5: Perform Configuration Test

  • Write PowerShell Code targeting SharePoint On-Premise Site

8

  • Run PowerShell Script

9

And sure enough we will get the output of the PowerShell Commands.

10

The successful execution of the script proves that we have done the configuration correctly.

Hope you find it helpful.

 

Advertisements

SharePoint 2016: Forms Based Authentication – Part 4

In the previous article SharePoint 2016: Forms Based Authentication – Part 3 of this series on implementing FBA with SharePoint we saw the execution of Step 5 for the process.

In this last article of this series we are going to see the execution of Step 6 & 7 and for the sake of quick review I am putting up the process diagram again in here.

Process Diagram

1

Step 6: Add External Users

  • Go to IIS
  • Select the Web Application on the left navigation pane
  • Click on “.Net Users” on the right section

2

Sometimes you might encounter the following error, this happens because the Default Provider is not set at the time you are trying to Add Users

3

In order to set the default provider you need to click on the “Set Default Provider” link under Actions Pane on the right

4

Select the membership provider as we configured in the earlier steps

5

Now you can add the users.

Click on the “Add” Link under the Actions Pane

6

Adding user information as needed

7

Click “Next”

8

Click “Finish”

And we can see the first FBA user in our system

9

Step 7: Test Forms Based Authentication

Browse the Web Application Via browser

We can see the Selection Window for the choosing the preferred Authentication mechanism

10

Let’s choose Windows Authentication first since we did not give explicit permissions to the FBA User yet, that is why system won’t allow the user to login to the SharePoint Site.

11

And being a authenticated Windows User we are good to go and able to see the Web Application Home Page

Then click on “Site Settings”

12

Click on “People and groups”

13

Click on “Add Users” to add new user to the desired security group.

In here I am adding new user to the Members Groups.

14

Type the name of the FBA user that you have added

In here the FBA User name is “FBAUser”

15

Share the site with FBA user

16

We can see the FBA User added to the Group

17

Now when we are going to browse the Web Application and go with Forms Based Authentication

Choosing this setting will present default login page as we selected in the earlier steps while enabling Web Application with FBA.

Enter FBA user name & password

18

And since we granted the permission to this FBA User in the SharePoint Site, SharePoint allows you to login to the site using FBA user credentials.

19

That is all for this series.

Hope you find it helpful.