Virtual Tech Conference by South Asia MVPs–August 01, 2013

Virtual Tech Conference (VTC) is a South Asia MVP community initiative to bring you up-to the speed on latest Microsoft technologies. This event is being hosted by South Asia MVP team and they have a very interesting line-up of speakers and topics in this event. This includes two parallel tracks – developer and IT Pro.

In the IT Pro track, I am speaking on ‘SharePoint 2013 App Model – SharePoint Hosted Apps’. My session starts at 6 PM IST.

For IT Pro Registration please check this link : http://aka.ms/Uu9msj

For Developer Registration: http://aka.ms/Ozhcyh

All the session timings are based on the Indian Standard Time

Name

Session Category

Proposed Session Title

Date

Time in IST

Karthikeyan

Developer

Create Cross Platform apps effectively with Portable Class Libraries

1-Aug-13

4:00 PM

Niraj Bhatt

Developer

Introduction to Windows Azure Active Directory

1-Aug-13

5:00 PM

Vishnu Kumar Tiwari

Developer

Integrating Onpremise SQL Server with Salesforce using BizTalk Server 2013

1-Aug-13

6:00 PM

Nauzad Kapadia

Developer

OAuth and the App security model in SharePoint 2013

1-Aug-13

7:00 PM

Ashutosh Singh

Developer

Enriching SharePoint Search using FAST

1-Aug-13

8:00 PM

Dr Nitin Paranjape

Developer

What every developer should know about Office

1-Aug-13

9:00 PM

Shantanu Kaushik

IT Pro

Preparing and Deploying Windows 8

1-Aug-13

4:00 PM

Geetesh Bajaj

IT Pro

Working with Flowcharts in Microsoft Office (Audience Profile: Consumer)

1-Aug-13

5:00 PM

Sundaraarajan Narasiman

IT Pro

SharePoint 2013 App Model – SharePoint Hosted Apps

1-Aug-13

6:00 PM

Ravikanth C

IT Pro

Desired State Configuration in PowerShell 4.0

1-Aug-13

7:00 PM

Ratish Nair

IT Pro

Exchange Server 2013 Load balancing and Outlook Client connectivity

1-Aug-13

8:00 PM

Prabhat Nigam

IT Pro

Exchange 2013 – Database availability Group and Auto Reseed.

1-Aug-13

9:00 PM

 Subscribe to my blog

Create SharePoint sites using Powershell

I was trying to create the SharePoint Site Provisioning using PowerShell. The following PowerShell script will help us to create a SharePoint sites based on Site Address, Site Name and Site Template parameters.

# This is Script to  Create the Sites, based on the Siteadress and Templates, given by the user.
# Use Get-SPWebTemplate cmdlet to get the list of the installed Site templates.


PARAM 
(
[Parameter(Mandatory=$true, Position=0)]
[string] $YourSiteAddress,

[Parameter(Mandatory=$true, Position=1)]
[string] $YourSiteName,


[Parameter(Mandatory=$true, Position=2)]
[string] $YourSiteTemplate
#,

#[Parameter(Mandatory=$true, Position=3)]
#[bool] $OverWrite =$false
)

$OverWrite ='N'
$web = Get-SPWeb $YourSiteAddress -erroraction silentlycontinue
if ($web -ne $null)
{
     Write-Host ("Web site already present with same name : {0}"-f $YourSiteAddress)
     $OverWrite = Read-Host "If want to overwrite the current website Please enter [Y] else enter [N]"
     
    if($OverWrite -eq 'Y')
    {
            Write-Host ("Removing the Site {0}" -f $YourSiteAddress)
            Remove-SPWeb $YourSiteAddress -Confirm:$false -erroraction silentlycontinue
            Write-Host (" {0} - Site Removed" -f $YourSiteAddress)
    }

     $web = Get-SPWeb $YourSiteAddress -erroraction silentlycontinue
}


if($web -eq $null)   
{
    Write-Host ("Creating the Site {0}"-f $YourSiteAddress)
    New-SPWeb     –url $YourSiteAddress     -name $YourSiteName     -template $YourSiteTemplate     –AddToTopNav:$false   
    –UniquePermissions    -UseParentTopNav:$false
 }
else
 {
    Write-Host "use OverWrite =[Y]  to overwrite this Site upon getting the prompt, once you rerun the script"
 }
 Subscribe to my blog

Programmatically update Author and Editor fields in SharePoint

I’m working on a data-migration scenario, where there is a need to update the CreatedBy (Author) and ModifiedBy(Editor) fields in SharePoint.

            using (SPSite oSPSite = new SPSite(http://yoursitecollectionurl))
            {
                using (SPWeb oSPWeb = oSPSite.RootWeb)
                {
                    SPList oSPList = oSPWeb.Lists["testlist"];


                    foreach (SPListItem oSPListItem in oSPList.Items)
                    {
                        SPFieldUserValue oSPFieldUserValue = new SPFieldUserValue(oSPWeb, oSPWeb.AllUsers[@"domainuser"].ID, 
                           oSPWeb.AllUsers[@"domainuser"].LoginName);
                        oSPListItem["Author"]= oSPFieldUserValue;
                        oSPListItem["Editor"]= oSPFieldUserValue;
                        oSPListItem.Update();                      

                                        }
                
                } 
The above code-snippet updates the Author and Editor fields of SharePoint list, based on the specific user (SPFieldUserValue object).

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }