Showing posts with label Power Shell. Show all posts
Showing posts with label Power Shell. Show all posts

Aug 17, 2013

Migrate SharePoint 2010 to 2013

In this article, we will learn how to migrate SharePoint 2010 to SharePoint 2013. This migration is applicable for OOTB features migration not for Custom Solution migration to SharePoint 2013. Steps:       1. Change the Authentication mode of SharePoint 2010 application...

Jan 7, 2013

Export SharePoint Group to Excel using PowerShell

$siteUrl="SiteURLHere" $groupName="GroupNametoExport" $Output = @("GroupName|Name|Login|Email|Department|Title") $web = Get-SPWeb $siteUrl $site = $web.Site $rootWeb = $site.RootWeb $UserList = $rootWeb.Lists["User Information List"] $web.SiteGroups[$groupName].Users|%{$user = $UserList.GetItemById($_.ID) if($user -ne $null) { $JobTitle = $user["JobTitle"] $Department = $user["Department"] } $Output...

Import Excel to SharePoint List using PowerShell

# Import the .csv file, and specify manually the headers, without column name in the file $contents = Import-CSV ‘C:\Input.csv' -header("Employee ID", "Employee Name") # Web URL $webURL = “SITEURL here” $web = Get-SPWeb -Identity $webURL $listName = "ListNameHere" $list= $web.Lists["$listName"] # Iterate for each list column foreach ($row in $contents ) { $item = $list.Items.Add(); $item["Employee...

Jan 6, 2013

Import Users from Excel to SharePoint using PowerShell

# Import the .csv file, and specify manually the headers, without column name in the file $userList=IMPORT-CSV C:\UserToUpload.csv -header("GroupName","UserName") #Get the site name to the variable $web = Get-SPWeb SiteURLHere foreach ($user in $userList) { $groupName = $web.SiteGroups[$userList.group] $user = $web.Site.RootWeb.EnsureUser($userList.user) $groupName.AddUser($user) } Write-Host...

Add Users to SharePoint Group using PowerShell

#Get the site name to the variable $web = Get-SPWeb SitURLHere #Get the group name to the variable $groupName = $web.SiteGroups["Group Name Here"] #Assign user to variable $user = $web.Site.RootWeb.EnsureUser(“User ID Here”) #Add user to group $groupName.AddUser($user) Write-Host -ForegroundColor green "User Added Successfully";...

Aug 28, 2012

Advantage of PowerShell over STSADM

In SharePoint 2010, new concept called Power Shell is introduced. The main adavantage of using Windows Power Shell over STSADM is follows: Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects. Hence, can interact with .Net objects directly. Here we use commandlets (cmdlet) instead of commands. Commandlet is a instance of .Net objects We...

Dec 23, 2011

stsadm Command for Creating Backup and Restoring a Site in SharePoint

In this article, we will discuss how to take a backup and restore it using the stsadmn command in SharePoint (WSS 3.0, MOSS 2007). In SharePoint 2010, we use Power Shell instead of this command. Before going for that let’s discuss about stsadm What is stsadm command? It is a command line tool for administration of SharePoint sites. Where it is located in the server? Normally, it is present...