Tuesday, August 11, 2009

SharePoint Exam Questions

Question: 1
You are creating a Microsoft Windows SharePoint Services application. You create a Windows SharePoint Services feature named MyFeature. You implement the feature within a Microsoft .NET namespace named MyFeature. You create a class named SiteMonitor that inherits from the SPWebEventReceiver class. The SiteMonitor class overrides two methods, named SiteDeleting and WebDeleting. Both methods cancel the deletion process.
You need to prevent all users, including site administrators, from deleting the MySite Web site. Which method should you use?
A. Public Sub AddReceiver(ByVal myWeb As SPWeb) myWeb.EventReceivers.Add(SPEventReceiverType.WebDeleting, _ "MyFeature", "MyFeature.SiteMonitor") End Sub
B. Public Sub AddReceiver(ByVal myWeb As SPWeb) For Each user As SPUser In myWeb.AllUsers user.IsSiteAdmin = False Next End Sub
C. Public Sub AddReceiver(ByVal myWeb As SPWeb) For Each user As SPUser In myWeb.SiteUsers user.IsSiteAdmin = False Next End Sub
D. Public Sub AddReceiver(ByVal myWeb As SPWeb , _ ByVal properties As SPFeatureReceiverProperties) Dim receiverAssembly As SPFeatureProperty = CType(properties._ Feature.Properties("ReceiverAssembly"), SPFeatureProperty) Dim receiverClass As SPFeaturePr operty = CType(properties._ Feature.Properties("ReceiverClass"), SPFeatureProperty)
receiverAssembly.Value = "MyFeature" receiverClass.Value = "SiteMonitor" End Sub
Answer: A
Question: 2
You create a custom administration page for a Microsoft Windows SharePoint Servicesapplication. The page is throwing a security exception. You verify that you have administrator rights on the Microsoft Windows SharePoint Services server. You need to ensure that the page can be used to perform administrative functions. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Grant administrative rights to the impersonation account.
B. Register a hidden field by using the RegisterHiddenField method.
C. Impersonate an administrative account before calling the object model.
D. Use the RequestFromAdminPort method to specify the context of the request through the administrative port of the application.
Answer: B, D
Question: 3
You have a Microsoft Windows SharePoint Services development server. You create a Web Part for a Windows SharePoint Services site. The Web Part must call a Web service.You deploy the Web Part on the development server. When you test the Web Part, the Web Part throws an exception. You need to prevent the occurrence of the exception when you test the Web Part. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Update the Web.config file to use the new policy.
B. Impersonate a local administrator account in the Web Part.
C. Create a customized policy file in which WebPermission is enabled for the Web Part.
D. Create a customized policy file in which SecurityPermission is enabled for the Web Part.
Answer: A, C
Question: 4
You create the following two document libraries for the human resources department of your company:
Vacation requests for full-time employees Vacation requests for part-time employees You need to enable a single workflow to serve both document libraries.
What should you do?
A. Use Microsoft Visual Studio 2005 to create the workflow. Install the assembly in the global assembly cache (GAC). Attach the workflow to both document libraries.
B. Use Microsoft Visual Studio 2005 to create the workflow. Create a feature to deliver the workflow. Install and activate the feature. Attach the workflow to both document libraries.
C. Use Microsoft Office SharePoint Designer to create the workflow. During creation, assign the workflow to one of the document libraries. Attach the workflow to the other document library.
D. Use Microsoft Office SharePoint Designer to create the workflow. Attach the workflow to one of the document libraries. Create a list template that is based on the document library, and then create a new document library that is based on the list template.
Answer: B
Question: 5
You create a Web Part. The Web Part requires configuration information from the user. You plan to provide a custom interface for a custom field. You need to derive a class to implement the custom interface.
Which class should you use?

A. Microsoft.SharePoint.WebPartPages.WebPart
B. Microsoft.SharePoint.WebPartPages.ToolPart
C. Microsoft.SharePoint.Administration.SPWebConfigModification
D. System.Web.UI.WebControls.WebParts.WebPart
Answer: B
Question: 6
You create a custom task list in a Microsoft Windows SharePoint Services site. You need to prevent users from changing the custom task list. You also need to ensure that an error message is displayed when a user tries to change the list. Which code segment should you use?
A. Public Overloads Overrides Sub ItemUpdating(ByVal properties _ As SPItemEventProperties) properties.Cancel = True properties.ErrorMessage = "Updating is not supported." End Sub
B. Public Overloads Overrides Sub ItemUpdated(ByVal properties _ As SPItemEventProperties) properties.Cancel = True properties.ErrorMessage = "Updating is not supported." End Sub
C. Public Overloads Overrides Sub ItemUncheckingOut(ByVal _properties As SPItemEventProperties) properties.Cancel = True properties.ErrorMessage = "Updating is not supported." End Sub
D. Public Overloads Overrides Sub ItemUncheckedOut(ByVal _properties As SPItemEventProperties) properties.Cancel = True properties.ErrorMessage = "Updating is not supported." End Sub
Answer: A
Question: 7
You create a Web Part that performs privileged operations. The Web Part requires permissions that the user might not have. You need to ensure that users with insufficient permissions can also run the Web Part to perform privileged operations.
Which method should you use?

A. SPSecurity.AuthenticationMode
B. SPSecurity.RunWithElevatedPrivileges
C. SPSecurity.CatchAccessDeniedException
D. SPSecurity.SetApplicationC r endentialKey
Answer: B
Question: 8
You are writing a program that will periodically display activity on a Microsoft Windows SharePoint Services site.
Which code segment should you use?
A. For Each job As SPJobDefinition In _ SPFarm.Local.TimerService.JobDefinitions Console.WriteLine("Job {0} will run at {1}", job.DisplayName, _ job.Schedule.NextExecution(DateTime.Now)) Next
B. For Each job As SPJobDefinition In _ SPFarm.Local.TimerService.JobDefinitions Console.WriteLine("Job {0} will run at {1}", job.DisplayName, _ job.Schedule.NextExecution(DateTime.MinValue)) Next
C. For Each job As SPRunningJob In _ SPFarm.Local.TimerService.JobDefinitions Console.WriteLine("Job {0} will run at {1}", _ j ob.JobDefinitionTitle, _ job.JobDefinition.Schedule.NextExecution(DateTime.Now)) Next
D. For Each job As SPJobDefinition In _ SPFarm.Local.TimerService.JobDefinitions Console.WriteLine("Job {0} will run at {1}", _ job.JobDefinitionTitle, _ job.JobDefinition.Schedule.NextExecution(DateTime.MinValue)) Next
Answer: A

No comments: