Posts

Sharepoint 2010 Delete Multiple Site Collection and Databases using Powershell

Some times you need to delete multiple site collections or databases so if we delete them manually its a very time taking process so here is a power shell script that will help you definitely. clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell ## Loading variables $WebApplicationURL = " Web Application Url " $tmpRoot = Get-SPWebApplication -Identity $WebApplicationURL $DataBaseInstanceToDelete =" Database1 , Database2 , Database3 , Database4 , Database5 "   ## Please Modify the array to delete Database instances $SiteCollectionsToDelete = " Site Collection Url1, Site Collection Url2, Site Collection Url3, Site Collection Url4, Site Collection Url5 "     ## Please Modify the array to delete Site Collections ## Getting all the databases related to web application $DataBaseInstance = Get-SPContentDatabase -WebApplication $WebApplicationURL ## Enume...

SharePoint 2010 Retract and Remove Projects using Powershell Script

Sometimes you need to retract and remove multiple wsp. If you will do it manually then its a time taking process. So here is a power shell script that will help you surely. clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell function RetractAndRemoveSolution {param ($SolutionPackageName, $DeployedGlobally)   $solution = Get-SPSolution | where-object {$_.Name -eq $SolutionPackageName}     # check to see if solution package has been installed      if ($solution -ne $null)    {          if($solution.Deployed -eq $true)         {          if( $DeployedGlobally -eq $true)      {     Uninstall-SPSolution -Identity $SolutionPackageName -Local -Confirm:$False       ...

.Net Object Comparison Using Generics

Image
Some time we need to compare two objects or properties or entities. For ex. we are going for save data to data base so we need to compare our old data and new data. If any changes are there then we will go for save otherwise we don't need. Here is a simple example of Entity comparison using generics. For demo purpose i am putting only one label on my screen, that will tell us, Input objects are similiar or not. .aspx <asp:Label ID="lblResult" runat="server" Text="Label"></asp:Label> In code behind i have taken an Entity Class and create two objects of the same. On page load, Assigning different values to both. .aspx.cs   // Entity for Details         public class DetailsEntity         {             public string Name { get; set; }             public string Number { get; set; }         }  // Object Compare Generics Class ...

Telerik Rad Grid Sorting Not Working for Numeric String and Date String Columns

As i have posted my last blog post for sorting Telerik Rad Grid Sorting . That was a normal sorting but if you want to sort numeric string column or date string column in that case you would not get desired result. For example: Values are 5, 31, 22, 41, 76, 8, 6 When we click on column header for sorting then sorted values are 22, 31, 41, 5, 6, 76, 8  But expected result is 5, 6, 8, 22, 31, 41, 76 So for take over this problem follow below example : For example we will add a numeric string column and a date string column to my last blog post Telerik Rad Grid Sorting .  .aspx Code : <telerik:GridBoundColumn DataField="Date" HeaderText="Date" DataType="System.DateTime"   SortExpression="Date"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Number" HeaderText="Number" DataType="System.Int32"    SortExpression="Number"></telerik:GridBoundColumn> Also when you...

Telerik Rad Grid Sorting

If you are using Telerik Rad Grid and also need to sort column on column's header click than for your requirement below code will help you surely. .aspx Code : <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" EnableViewState="false" AutoGenerateColumns="False" OnSortCommand="RadGrid1_SortCommand"  OnNeedDataSource="RadGrid1_NeedDataSource">  <SortingSettings EnableSkinSortStyles="true" />   <MasterTableView AllowNaturalSort="false" AllowSorting="True" AutoGenerateColumns="False">     <Columns>        <telerik:GridBoundColumn DataField="Name" HeaderText="Name"  SortExpression="Name">        </telerik:GridBoundColumn>        <telerik:GridBoundColumn DataField="Address" HeaderText="Address"  SortExpression="Address">        </telerik:GridBoundColumn...

Check Box inside Rad Grid 508 Compliance

Many times we used check box inside a grid like : <telerik:GridTemplateColumn UniqueName="ColoumnChk" HeaderText="Check Here">         <ItemTemplate>              <asp:CheckBox ID="chkNew" AutoPostBack="true" runat="server" Text="Abc" />          </ItemTemplate>  </telerik:GridTemplateColumn>  But some time we need to hide check box text like :  <telerik:GridTemplateColumn UniqueName="ColoumnChk" HeaderText="Check Here">         <ItemTemplate>              <asp:CheckBox ID="chkNew" AutoPostBack="true" runat="server" Text="" />          </ItemTemplate>  </telerik:GridTemplateColumn> In this case an accessibility error(508 Compliance) will occur. So for treat this error we have to provide check box text and hide that ...

RadDatePicker Invalid Date Alert Box

There is no validator in .net that validate raddatepicker's invalid date. in this case we should use raddatepicker's client event on error. <telerik:RadDatePicker  runat="server" ID="rdpStartDate">            <DateInput runat="server">                <ClientEvents OnError=" ValidateDate " />            </DateInput>        </telerik:RadDatePicker> JavaScript function  ValidateDate (sender,args) {            var reason = args.get_reason();            if (reason === 1)             {                 alert("Invalid Date");            }     ...