Active Directory Setup For SharePoint Development Environment

To configure Active Directory Domain Service on Windows Server follow below steps:

Navigate to Server Manager

Click On Add roles and features.

It will start Add Roles and Features Wizard.

Click on Next

Select Installation Type as shown in Image

Click on Next

Select Option as shown in Image

Click on Next

Select Active Directory Domain Service

When you click on it, it will prompt you to add features for Active Directory Domain Service

Click on Add Features

Now Active Directory Domain Service is checked or selected.

Click on Next

On Features Tab Click on Next

On AD DS tab click on Next

On Confirm Installation selection section click on Install.

Next step will show us Installation Progress

Once the installation succeeds click on Close

After Successful installation, you can see in Dashboard Notification Message to promote this server for a domain controller.

Click on it.

It will Start “Active Directory Domain Service Configuration Wizard”

Click on Add New Forest. Enter Root Domain name

Clock on Next

Enter Password and Confirm Password

Click on Next

It will show DNS Options

Click on Next

Additional Options will check Domain Name

Click on Next

Select Path

Click on Next

Review Option.Review Entered information

Click on Next

Check Prerequisites.Click On Install.It will start installation process.

Once installation is complete restart server.

 

 

Advertisement

SharePoint Document archive using SharePoint Designer Workflow

Scenario: We have document library “Orders”. When customer’s order is created, Order Detail (document) is going to uploaded in “Orders” Document library. Company user can receive or download the order and can prepare product according to order derail. Once the order is completed designated representative will change the order status from “In Progress” to “Complete”. When list item is changed Workflow runs and it will move the Order Document to “Order Completed” Document Library.

To implement above scenario, follow below steps:

Create Document Library named “Orders”

Add New Column in Orders document library named “Order Status”.

Order Status column in Choice Type with option “New, In Progress and Completed”

Create another document library named “Completed Orders”

Select Create a workflow in SharePoint Designer in “Orders” document library.

Enter name of workflow

In workflow add stage which copy current item in Completed Orders Document Library and then delete current item.

Set Workflow Start up Option

Publish Workflow

Once we publish workflow in Orders document library “Archive Completed Orders” column will be available

Upload document in Orders Document Library. By default, Order Status is New. Update the column value and set Completed as shown in Image.

Once we change Order Status Completed Workflow will move document to Completed Order Document Library.

 

 

SharePoint & PowerShell

Windows PowerShell is a shell developed by Microsoft for purposes of task automation and configuration management. This powerful shell is based on the .NET framework and it includes a command-line shell and a scripting language. In fact, it’s the native Windows management shell, not a technology that’s unique to SharePoint.

In PowerShell you cannot perform any SharePoint task because that snap-ins is not loaded.

We can perform each and every operation (which is provided by SharePoint Management Shell) in Windows Management Shell by adding snap-in of Microsoft.SharePoint.PowerShell.

Of course we can use all commands in SharePoint Management Shell

To load the SharePoint snap-ins in Windows Management Shell, you must run the following command:


Add-PSSnapin Microsoft.SharePoint.PowerShell

Once SharePoint snap-ins are added into PowerShell, we can use PowerShell as SharePoint Management Shell. We are able to execute each and every command which we can execute in SharePoint Management Shell.

Execute SharePoint Command in PowerShell after adding SharePoint snap-in.

As shown in image ,command Get-SPWebApplication Returns all Web applications that match the given criteria.

We can also remove snap-in from PowerShell by following command.


REMOVE-PSSNAPIN "Microsoft.SharePoint.Powershell"

It will remove SharePoint snap-in and we are not able to access any SharePoint Command

Get-SPSite

Get-SPSite "http://spserver:2222/*"

Get-SPSite: Returns all site collections that match the specified criteria.

Get-SPWeb:

Get-SPWeb -site "http://spserver:2222/"

Get-SPWeb: Returns all subsites that match the given criteria.

Get-SPSite with Select Parameter

Return selected column name

Get-SPSite "http://spserver:2222/*" |Get-SPWeb | Select Title 

If we remove, select it will return with Site URL

Get-SPSite "http://spserver:2222/*" |Get-SPWeb | Select

Get-SPUser

Get-SPUser: Returns the user account or accounts that match a given search criteria.

Get-SPUser -Web "http://spserver:2222/"

Get-SPFeature

Get-SPFeature: Returns the SharePoint Features based on a given criteria.

Here Get-SPFeature returns Features whose scope is Site

Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"}

Create Web Application

New-SPWebApplication: Creates a new Web application within the local farm.

$name = "Publishing Web Powershell"
$port = 3355
$url = "http://SPServer"
$appPoolName = "Publishing Site Pool Name"
$ContentDatabase = "PublishingSiteDB"
$appPoolAccount =Get-SPManagedAccount "NRWebs\spadmin"
$ap = New-SPAuthenticationProvider
New-SPWebApplication -Name $name -Port $port -DatabaseName $ContentDatabase -URL $url -ApplicationPool $appPoolName -ApplicationPoolAccount $appPoolAccount -AuthenticationProvider $ap 


After successfully execution of command we can see newly created web application in SharePoint Central Administration.

It will also creates Application Pool in IIS.

Now Next let’s create Site Collection in Web Application.

New-SPSite : Creates a new site collection at the specified URL.

##
#Create Site Collection
##
$title = "SharePoint Publishing Site"
$url ="http://SPServer:3355"
$owner = "NRWebs\spadmin"
$template = "BLANKINTERNET#0"
New-SPSite -URL $url -Name $title -OwnerAlias $owner -Template $template


Once Site Collection is created we are able to review it in Central Administration in Application Management -> Site Collections -> View All Site Collection

Now we are able to browse Site.

In above command we have used Publishing Site Template to create Site Collection you can create your desired site by using its Template ID
You can get other template Id using following command.
Get-SPWebTemplate :
Displays all globally installed site templates that match the given identity

Get-SPWebTemplate


Create SubSite
New-SPWeb: Creates a new site in an existing site collection.

##
#Create Sub Site
##
$template = GET-SPWebTemplate "BLOG#0"
New-SPWeb http://SPServer:3355/MyBlog -Template $template


Once Subsite is created we can browser it using its url.