Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Tuesday, December 16, 2014

Sharepoint administrator interview questions with answers:MMS

  1. What is the “Managed metadata” column and use of it?
  2. What is the “Enterprise Keyword” column and use of it?
  3. What is the “TaxonomyHiddenList” list and use of it?
  4. Enterprise keyword Vs Managed Metadata?
  5. How to check enterprise keyword option is enabled? Means I cannot go to the each list/library level and confirm enabled/disabled?
  6. How to disable the Enterprise keywords from the list/library?
  7. Is it possible to stop creating new keywords when add new values to the enterprise keyword column in list/library?
  8. Error: Failed to create a term set: A default managed metadata service connection hasn’t been specified.
  9. Error: The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.
  10. Error: Users were unable to view the enterprise keywords in sharepoint list/library?
  11. Error: Users can’t see the values of the Managed Metadata Columns for list items?
  12. Error: The site doesn’t contain a default term keywords term store?
  13. Error: "The default term store for this site cannot be identified."
Am preparing answers for the above questions. Will post you soon.

Thanks,
Sasi kumar Reddy

Tuesday, December 2, 2014

Send Meeting Request in SharePoint

By using the below code, we can send the invite meeting request to any.
//To send Calder Meeting Event request
        private void sendMeetingRequest(DateTime startTime, DateTime endTime, string candidateEmail, string status, string location)
        {
            try
            {
                //create the credentials
                NetworkCredential cred = new NetworkCredential(ConfigurationManager.AppSettings["userName"], ConfigurationManager.AppSettings["password"]);

                //create the smtp client...these settings are for gmail
                SmtpClient sc = new SmtpClient(ConfigurationManager.AppSettings["SMPTPServerName"], (Convert.ToInt32(ConfigurationManager.AppSettings["portNo"])));
                sc.UseDefaultCredentials = false;
                sc.EnableSsl = true;

                //credentials (username, pass of sending account) assigned here
                sc.Credentials = cred;
                MailMessage msg = new MailMessage();
                msg.From = new MailAddress(ConfigurationManager.AppSettings["userName"], "FromMe");
                msg.To.Add(new MailAddress(candidateEmail, "From My  Portal"));
                msg.Subject = "Interview Schedueled";
                msg.Body = "Interview Scheduled. Get ready to face it.";
                //DateTime startTime = DateTime.UtcNow.AddDays(1);
                //DateTime endTime = DateTime.UtcNow.AddHours(25);
                StringBuilder str = new StringBuilder();
                str.AppendLine("BEGIN:VCALENDAR");
                str.AppendLine("PRODID:-//My Group");
                str.AppendLine("VERSION:2.0");
                str.AppendLine("METHOD:REQUEST");
                str.AppendLine("BEGIN:VEVENT");
                str.AppendLine(string.Format("DTSTART:{0:yyyyMMddTHHmmssZ}", startTime));
                str.AppendLine(string.Format("DTSTAMP:{0:yyyyMMddTHHmmssZ}", DateTime.UtcNow));
                str.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmssZ}", endTime));
                string meetingLocation = "LOCATION: " + location;
                str.AppendLine(meetingLocation);
                str.AppendLine(string.Format("UID:{0}", Guid.NewGuid()));
                str.AppendLine(string.Format("DESCRIPTION:{0}", msg.Body));
                str.AppendLine(string.Format("X-ALT-DESC;FMTTYPE=text/html:{0}", msg.Body));
                str.AppendLine(string.Format("SUMMARY:{0}", msg.Subject));
                str.AppendLine(string.Format("ORGANIZER:MAILTO:{0}", msg.From.Address));

                str.AppendLine(string.Format("ATTENDEE;CN=\"{0}\";RSVP=TRUE:mailto:{1}", msg.To[0].DisplayName, msg.To[0].Address));

                str.AppendLine("BEGIN:VALARM");
                str.AppendLine("TRIGGER:-PT15M");
                str.AppendLine("ACTION:DISPLAY");
                str.AppendLine("DESCRIPTION:Reminder");
                str.AppendLine("END:VALARM");
                str.AppendLine("END:VEVENT");
                str.AppendLine("END:VCALENDAR");
                System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
                ct.Parameters.Add("method", "REQUEST");
                AlternateView avCal = AlternateView.CreateAlternateViewFromString(str.ToString(), ct);
                msg.AlternateViews.Add(avCal);
                ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
                sc.Send(msg);
               
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex); 
                if(ex.InnerException!=null)
                    Console.WriteLine("InnerException is: {0}", ex.InnerException);

            }
        }

Monday, December 1, 2014

Re-Order the sharepoint site columns in content type using powershell script


$URL = "http://LocalHost/”
$site = New-Object Microsoft.SharePoint.SPSite($URL)
$web = $site.openweb()
$myCustomContentype=$web.ContentTypes["MySiteContentType"]
$newFieldOrder = @("Title","MyCOl1","MyCol3","FileLeafRef","MyCOl5","MyCol2")
$myCustomContentype.FieldLinks.Reorder($newFieldOrder)
$myCustomContentype.Update()
Name:  Only refer the Sharepoint internal names for reorder.  
Example: Internal name for “Title” is “FileLeafRef

Tuesday, November 25, 2014

Create sharepoint site in Office365 using powershell script

Just do copy/paste the below script in you powershell and see the magic..You will be able to new site in your office 365 application.

Am sharing the below script to all of my SharePoint colleges once did the experiments from my side.

*********************************************************************************
$wc = New-Object System.Net.WebClient
$wc.Headers.Add("User-Agent","Mozilla/4.0+")      
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type –Path "C:\Program Files\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll"
$siteUrl = “http://xxx.xxxx.com”
$password = convertto-securestring "*****" -asplaintext -force
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("username", $password)
$ctx.Credentials = $credentials
$webCreationInformation = New-Object Microsoft.SharePoint.Client.WebCreationInformation
$webCreationInformation.Url = "URLName"
$webCreationInformation.Title = "Title"
$webCreationInformation.WebTemplate = "STS#0"
$newWeb = $ctx.Web.Webs.Add($webCreationInformation)
$ctx.Load($newWeb)
$ctx.ExecuteQuery()
**********************************************************************************
Please let me know for any concerns.

-Thanks,
Sasi Kumar Reddy
https://sharepointquicksolutions.blogspot.com

Thursday, November 20, 2014

Setup [Today] as default to the sharepoint date time control through browser


Step1:
Create a new date time field and set the calculated value as “Today”. That’s it.
Create a new item into the list. There you can see set the Today’s date as default to the date time field.

Step2
Creata new item into the list and there you will see the set the Today's date as default to the sharepoint date time field.[PFB the image]

Friday, November 14, 2014

SharePoint choice field using powershell

$docSite = new-object Microsoft.SharePoint.SPSite($siteURL)
$docWeb = $docSite.OpenWeb()
$lncustomListName listName
$CustomfieldName = "MyChoiceColumn"

/* To create choice field */
Add-SPMultiChoiceField -listName $lncustomListName

/* Method to create choice field */
function Add-SPMultiChoiceField([string]$listName)
{
  $OpenList = $docWeb.Lists[$listName]
  $multiChoiceCol = "<Field Name='"+ $CustomfieldName +"' Type='MultiChoice' FillInChoice='FALSE' DisplayName='"+ $CustomfieldName +"'><Default>MyChoice1</Default><CHOICES><CHOICE>MyChoice2</CHOICE><CHOICE>ERM</CHOICE><CHOICE>MyChoice3</CHOICE></CHOICES></Field>"
 $OpenList.Fields.AddFieldAsXml($multiChoiceCol,$true,
 [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView) 
}

Friday, November 7, 2014

Creating a Site using Nintex workflow

  1. Create a new list and the fields: Project Name(single line of text) , site name(hyperlink) and Author( people picker)
  2. Create a new nintex workflow
  3. Insert Action and Sites and Workspace and then Create a new Site.
  4. Configure the above action as shown below
  5. If the parent site permissions has to be inherited ,check the Inherit Permissions check box


Saturday, November 1, 2014

How to view the large number of records in a list/library even if exceeds the threshold limit value

There is a work around to view the large number of records in a list/library even if exceeds the SharePoint threshold limit value(5000 records).
 
Let me explain you briefly, I have a custom list/library and it is having one lac records approximately and now  we wants to show the results of one lac records in my list/library. But it is not possible because Sharepoint can not view the large number of records if exceeds the sharepoint threshold limit value(5000 records). 

Solution: create a new view and remove the filters/orderby/sortby/group by and select the show items with out folder option. We can view large number of records by removing all the these.

Benefit: we can search the results.

Please let me know for any issues.

-Thanks,
Sasi kumar Reddy

Thursday, September 25, 2014

create sharepoint boolean field using powershell script

Please visit my below post which helps on how to create sharepoint list using powershell script:
Create sharepoint list using powershell script

Note: By default, below method sets the boolean field as Yes(1). If you want as No(0), provide the 0 value to the "DefaultValue"
****************************************************************************************
$lncustomListName listName
$docSite = new-object Microsoft.SharePoint.SPSite($siteURL)
$docWeb = $docSite.OpenWeb()

/* To create Boolean field */
Add-SPBooleanField -listName $lncustomListName -Name EmailFlag -DisplayName EmailFlag -Required TRUE -DefaultValue 1

/* Method to create boolean field */
function Add-SPBooleanField([string]$listName, [string]$DisplayName, [string]$Name, [string]$Required,[string]$DefaultValue)
{
  $OpenList = $docWeb.Lists[$listName]
  $fldXml = "<Field Type='Boolean' DisplayName='"+$DisplayName +"' Required='"+ $Required +"' Name='"+ $Name +"'>
           <Default>$DefaultValue</Default>
           </Field>"
  $OpenList.Fields.AddFieldAsXml($fldXml,$true,
  [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)
}

*****************************************************************************************
Please let me know if faced any issues.

Sunday, September 21, 2014

Create sharepoint datetime control using powershell script

Visit my previous post for to create a list through powershell script
Create list using powershell script
*********************************************************************************
$lncustomListName listName
$docSite = new-object Microsoft.SharePoint.SPSite($siteURL)
$docWeb = $docSite.OpenWeb()

/* To create DateTime field for allow only one user/group */
Add-SPDateTimeField -listName $lncustomListName -Name DateTimeFieldName  -DisplayName DateTimeFieldName  -DateType DateOnly -Required FALSE

/* Method to create people DateTime field */
function Add-SPDateTimeField([string]$listName, [string]$DisplayName, [string]$Name, [string]$Required, [string]$DateType)
{
   $OpenList = $docWeb.Lists[$listName]
   $fldXml = "<Field Type='DateTime' DisplayName='"+ $DisplayName +"' Format='"+ $DateType +"' Required='"+ $Required +"' Name='"+ $Name +"'/>"
   $OpenList.Fields.AddFieldAsXml($fldXml,$true,
   [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)
}
**********************************************************************************
Please let me know if faced any issues.

Saturday, September 13, 2014

Create sharepoint multi people picker field through powershell script

Visit my previous post for to create a list through powershell script and to create people picker for allow single user/group
Create a new sharepoint list using powershell script
Create a people picker column to allow single user/group

**********************************************************************************
$lncustomListName listName
$docSite = new-object Microsoft.SharePoint.SPSite($siteURL)
$docWeb = $docSite.OpenWeb()

/* To create people picker field for allow mutliple users and groups */

Add-SPUserField -listName $lncustomListName -DisplayName MyList -Name MyList -Required TRUE

function Add-SPMultiUserField([string]$listName, [string]$DisplayName, [string]$Name, [string]$Required)
{
   $OpenList = $docWeb.Lists[$listName]
   $fldXml = "<Field Type='User' DisplayName='"+ $DisplayName +"' Required='"+ $Required +"' Name='"+ $Name +"'/>"
   $OpenList.Fields.AddFieldAsXml($fldXml,$true,
   [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)
   $fieldname=$OpenList.Fields[$DisplayName]
   $fieldname.AllowMultipleValues=$true
   $fieldname.update()  
}
*********************************************************************************

Create sharepoint People Picker field through powershell script

Visit my previous post for to create a list through powershell script
Create list using powershell script

********************************************************************************
$lncustomListName listName
$docSite = new-object Microsoft.SharePoint.SPSite($siteURL)
$docWeb = $docSite.OpenWeb()

/* To create people picker field for allow only one user/group */
Add-SPUserField -listName $lncustomListName -DisplayName MyList -Name MyList -Required TRUE

/* Method to create people picker field
function Add-SPUserField([string]$listName, [string]$DisplayName, [string]$Name, [string]$Required)
{
   $OpenList = $docWeb.Lists[$listName]
   $fldXml = "<Field Type='User' DisplayName='"+ $DisplayName +"' Required='"+ $Required +"' Name='"+ $Name +"'/>"
   $OpenList.Fields.AddFieldAsXml($fldXml,$true,
   [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)   
}
*******************************************************************************
Please let me know if faced any issues.

Wednesday, September 3, 2014

SharePoint administrator interview questions and answers: Recycle Bin 2


<<Previous page>>                                                                                            


How can we restore the deleted sub site from the Recycle Bin in SharePoint 2007?
There is no direct way to restore the deleted sites from the Recycle Bin in SharePoint 2007. But there was a wonderful tool from Codeplex: Site Delete Capture http://governance.codeplex.com/ to back up sites automatically when they gets deleted, So that we can restore a deleted site collection in SharePoint 2007.

From the SharePoint 2010 onwards, we can restore the deleted sub site from the second stage of recycle Bin. If we delete the sub site, SharePoint will keep the deleted site in site collection recycle bin.
Note: You can find the deleted site secondary recycle bin i.e  “Deleted from end user Recycle Bin

Is it possible to recreate the deleted site in sharepoint? [Means i have deleted a  site(http://ab.com) and trying to recreate with the same]?
Sol: In MOSS2007, When you delete a Site from the site settings it is deleted permanently. That meanns we can able to recreate the same once got deleted but from SharePoint 2010 onwards, When you delete a Site from the site settings it is deleted gradually.
Means, if you delete a site, and then create the site with the same name, SharePoint will ask you if you wish to permanently delete the site from the recycle bin so that you can re-create the site


How to restore the deleted site collection in SharePoint?
In prior versions of SharePoint Server 2010, if a site collection (that is, an SPSite object) was accidentally deleted, there was not a direct way of restoring a specific deleted site collection. The only method to restore a deleted site collection was to restore the entire farm from a backup. This was costly and time consuming, and typically was not performed.

When a site collection is accidentally deleted in SharePoint Server 2010 with SP1, the deleted site collection is stored in the SPDeletedSite object, not the SPSite object. Therefore, to restore a deleted site collection, you must use the Restore-SPDeletedSite Windows PowerShell cmdlet or programmatically access the object model.

E.g.:  Get-SPDeletedSite -Identity /sites/sitename | Restore-SPDeletedSite

My SharePoint site has exceeded the mentioned  Quota size limit but users still wants to add new doc to the document library? How can we achieve this?
Shorter way: Delete the unwanted data from the second stage of Recycle Bin.

Longer way: Increase Quota limit to the web application.

Note: Go with the second option only in case of if there is no unwanted data available in Recycle Bin. But keep in mind Release required to change the Quota limit [Why I mentioned “Release” point here we cannot directly change anything until unless get approval from the business users in higher level organizations].

Realtime Scenerio: I created site with 200MB of size and uploaded 200MB size of files to the document library[e.g:  2files and each one is having 100MB of size]. Later on, deleted those documents from the document library. But when I try to upload the 50MB of file again to the document library got the exception and it says: site Quota is FULL.
The reason for the exception is, those deleted 200MB files are still stays in first stage of Recycle Bin. Solution: Delete those from the both first stage/second stage Recycle Bin and then try to upload or increase the site Quota.

Note :2nd stage of Recyle Bin, overwritten the old data when it exceeds.

<<Previous page>>                                                                                            

SharePoint administrator interview questions and answers: Recycle Bin

<<Previous page>>                                                                                            

What is Recycle Bin in sharepoint?
SharePoint has introduced a new feature called Recycle Bin to keep the deleted items, documents. Speciality of this feature is we can easily restore the accidently deleted items and files from the Reycle Bin. 

Recycle Bin Stages:
SharePoint supports two levels of Recycle bin. The initial or First level Recycle bin comes into picture when the user deletes an item from a list. Once the item is deleted again from the First level of Recycle bin it moves to the second stage of Recycle bin.
1st stage, known as the “end user recycle bin”
2nd stage, known as the “deleted from end user recycle bin”.
2nd stage Recycle Bin has a setting of site quotas for space limitations. If it reaches its quota limit, older items will be overwritten. If you are not enabled site quotas then 2nd stage recycle bin will have no space limitations.

Use the 2nd Stage Recycle Bin to define how long deleted items will stay in the site collection's Recycle Bin that only the administrator can use (Default: 50 percent of the disk quota for the web application. For example, if you have allotted 1000 MB of space for the web application, SharePoint will add 50 percent more (i.e., 500 MB) to that quota (a total quota of 1500 MB) to be used for the second-level Recycle Bin. When this limit is exceeded, the oldest items will be removed from the second stage Recycle Bin.
Note: First stage of Recycle Bin available at site level and only one Second Stage Recycle Bin available per Site Collection.

Below IMP points should keep in mind ever:
  1. The Site Recycle Bin feature is newly introduced in Service Pack 1 from SharePoint 2010, if you haven't installed ServicPack 1 for your SharePoint 2010 when you deleted the site collection; you need to restore the content database.
  2. The Recycle Bins can contain multiple copies of a document that each have the same file name and source. These documents cannot be restored over an existing copy of a document.
  3. The Recycle Bins cannot be used to recover previous versions or accidental overwrites of documents.
  4. Turning off the Recycle Bin for a Web application empties all Recycle Bins and permanently deletes all items in them and can only be restore from a backup.
  5.  If you have not enabled site quotas, the 2nd stage recycle bin will have no space limitations.

Who can view the 1st stage recycle Bin?
Minimum Permssions levels: Contribute, Design, or Full Control Permissions and site collection administrator.

What are all the minimal permissions required to restore the deleted items?
The deleted items can only view of their own and site collection administrator.
Recycle bin access permissions: Contribute , Design, and Full Control permissions.

What are all the permissions required to restore the deleted objects from the second stage of Recycle Bin?
Only the Site Administrator can restore objects from the site collection Recycle Bin.
You should have minimum site collection administrator permissions to restore the other’s deleted data from the Recycle Bin. Means the users who have deleted the content will be able to see the content in the recycle bin and next site collection administrators can view other’s data.

How many days the deleted content will be available in Recycle Bin?
The deleted object will stay in the Recycle Bin for 30 days by default.
After 30 days, the object is moved from the site's Recycle Bin to a site collection Recycle Bin.
All together is 30days: If deletes the item from the first stage recycle bin after 10 days. It moves to second stage recyle bin and stays there another remanining 20days. 

Which timer job cleans the recycle bin data if exceeded the time?
The “Recycle Bin” Timer job and it by default scheduled on daily basis in MOSS2007 and from 2010 onwards scheduled on weekly basis.

How to delete an item permanently from the SharePoint list?
Recycle () method: used for to move the items to the Recycle Bin
Delete () methods: used for to delete the items permanently.

<<Previous page>>