About NGenious Solutions

NGenious Solutions is a Microsoft Certified Gold Partner - specializing in Information Worker and ISV/Software Solutions. We are highly focused on Microsoft SharePoint Technologies, .Net Development, Managed Support (SharePoint & Database) and Mobile Application Development.

How to update SharePoint’s Group Owner using PowerShell

 

 #Enter the site URL for which the group owner needs to be updated $webUrl = “http://test.company.com/man” Write-Output “Getting site object” $web = Get-SPWeb $webUrl Write-Output “Success” Write-Output “Getting User Group” $spGroups = $web.groups #Get the owner group $UserGroup = $spGroups | where {$_.Name -eq “User”} Write-Output “Success” foreach($group in $spGroups) { if($group.Name.StartsWith(“User”)) { Write-Output “Updating

Read More

How to Activate MIME Type using Powershell

 

 $mime = “text/html” $webAppUrl = “http://test.company.com” $webApp = Get-SPWebApplication $webAppUrl If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $mime) { Write-Host -ForegroundColor White “Adding MIME Type “$mime #$webApp.AllowedInlineDownloadedMimeTypes.Add($mime) #$webApp.Update() Write-Host -ForegroundColor Green “MIME Type added and saved.” } Else { Write-Host -ForegroundColor Yellow $mime” MIME type is already added.” }

Get document wise versions list using Powershell

 

 function Get-DocumentItemVersionsList([string]$WebURL, [String[]]$listName) { [void][System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) set-variable -option constant -name out -value “C:\Get-ListItemVersionsList_Output.csv” “Item_ID|Item Title|Item URL|Version Count” | Out-File $out -Append write-host “–IN” $web = get-spweb $WebURL write-host “–Web initiated” $list = $web.Lists.TryGetList($listName) write-host “–List initiated” $listItems = $list.Items; write-host “–List Items Count = ” $listItems.Count foreach($item in $listItems) { $itemTitle = $item[“Name”] $itemURL = $item.Url

Read More

Delete all sharepoint list item using powershell

 

 write-host “Type YES to continue” $retvalue = read-host if ($retvalue -ne “YES”) { write-host “exiting” -foregroundcolor green exit } write-host “continue” $web = get-spweb http://sharepointweburl:2015 $list = $web.lists | where {$_.title -eq “List Name”} Write-host “List $($list.title) has $($list.items.count) entries” $items = $list.items foreach ($item in $items) { Write-host ”  Deleted: $($item.id)” -foregroundcolor red $list.getitembyid($Item.id).Delete()

Read More

Add user in list from csv or excel file using PowerShell

 

 $spAssigment = Start-SPAssignment    #Use to dispose SPWeb safely $spWeb = Get-SPWeb “http://weburl” -AssignmentCollection $spAssignment     #Get SPWeb Instance $spList = $spWeb.Lists[“ListName”]    #Get list instance $testcsv = import-csv C:\user.csv Write-Host “Start To Add Item” foreach($test in $testcsv) { $spItem = $spList.AddItem() $spItem[“User”] = $test.UserID # .UserID is column name $spItem.Update() # ====================== $UserID

Read More