Showing posts with label Administration. Show all posts
Showing posts with label Administration. Show all posts

Tuesday, April 01, 2014

Working Tips with SPWebConfigModification Class in SharePoint 2013

Hi Folks,

I was working on updating a SharePoint web.config programmatically in SharePoint 2013 Farm Solution. Applying web.config modifications in SharePoint is straight forward task by adding the modifications into a collection of the web application and then submit your changes.

Since this class is poorly documented, I was trying to update a specific web application web.config and not all web.config in this farm. all the code samples in MSDN and other blogs don't provide a necessary understanding how it works so before taking the MSDN code and apply it into your feature or wsp you should know the following essential tips:

1) You can apply your web config modifications either on the web application level or the content service level which affects all web config files in your farm.

2) When your code has the following line of code, this means that the changes will be taken effect into all web applications in the farm:

SPWebApplication webApp = new SPSite('siteUrl').WebApplication;
WebApp.Farm.Services.GetValue<SPWebService>.ApplyWebConfigModifications();

Even though you are using a web application object, but this code will update all web.config files, which you should avoid when you apply solutions unless you are applying Farm updates.


3) If you want to update a specific web application web.config:

SPWebApplication webApp = new SPSite('siteUrl').WebApplication;
WebApp.Update();  // update specific web.config for this web application
webApp.WebService.ApplyWebConfigModifications();


line #3 will only update the web.config for a specific web application and not all unlike
SPWebService.ContentService.ApplyWebConfigModifications();

Hope this helps!

**References:
1) Add or remove entries in web.config programmatically:
http://msdn.microsoft.com/en-us/library/bb861909(v=office.14).aspx



Wednesday, March 12, 2014

Developer Dashboard doesn't show for anonymous users in SharePoint 2013

Hi All,

I was working on a public SharePoint site and i wanted to enabled the developer dashboard utility. I Ran the following powershell command to enable the developer dashboard:

Turn On Developer Dashboard Powershell Command:

$content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)
$appsetting =$content.DeveloperDashboardSettings
$appsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$appsetting.Update() 


**If you want to turn it off, just change the On flag to Off and you are good.

After that, I was able to see the developer dashboard icon in the Central Administration site but not on my public SharePoint site.

So basically, I found that you have to grant permissions for anonymous users to access this utility since it is not accessible for anonymous users even if the utility is enabled.

How to enable Developer Dashboard for anonymous users:

$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dashboardSettings = $contentService.DeveloperDashboardSettings
$dashboardSettings.RequiredPermissions = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask
$dashboardSettings.Update()


By default, the required permissions property for the developer dashboard utility is "AddAndCustomizePages" which is available for authenticated users who have this permission, so you need to changed it to no permissions by setting the value to EmptyMask which means in SharePoint permissions world no permissions are needed.

Note: This is a good technique while you are developing, testing and in the user acceptance test phase of any SharePoint implementation project. when you don't need this utility it is strongly recommended to turn it off on production environment.

Hope this helps!


References:
1) SharePoint base permissions:
http://msdn.microsoft.com/EN-US/library/ms412690






Monday, November 04, 2013

You do not have the necessary permissions to change the domain logon for this user

Hi,

While i was importing a Microsoft Dynamics CRM 2011 solution i was getting this error message:

"You do not have the necessary permissions to change the domain logon for this user"


The Service account that is running the CRM Server App pool is a member of the Administrator group, and a member of deployment administrators group. So what is missing ?

It turned into that the service account does not have the permissions to a certain folder that is being used by MS CRM Server 2011 for imported solutions, here is the folder path:

c:\program files\ Microsoft Dynamics CRM\CustomizationImport

Add the service account to have full access to this folder and then you will be able to import your custom solution in CRM.

Hope this help.

Wednesday, July 17, 2013

What’s new in Records Management and Compliance in SharePoint 2013


Hi Folks,
I’m writing this article about what’s new in Records Management and Compliance in SharePoint 2013. SharePoint 2013 has extended the retention policies to be applied on the site level!.

Having the site retention policies on the site level is a cool feature, especially for most of the small/medium organizations that creates sites for their departments and not site collections.

Another cool feature which is the site policy also applies on SharePoint 2013 Foundation, so you can apply your site retention polices if you have SP 2012 Foundation instance.

Site Level Retention:

You can manage retention policies to SP sites and exchange 2013 team mailboxes that are associated with the sites.

Compliance officers create policies, which define the following:

n  The retention policy for the site and the associated exchange team mailbox, if any is associated.

n  What causes the project to be closed?

n  When a project should expire.

Here are the steps to apply compliance and retention policies:

1)      The site owner creates a SharePoint site.

2)      The site owner creates an exchange server 2013 team mailbox.

3)      The site owner assigns/selects the appropriate retention policy template.

4)      The site owner invites team members to join the site.

5)      All emails and documents among the site team members, the selected policy will be applied.

6)      When the project is completed, the site owner closes the project.

7)      Once the project is closed by the site owner, all project folders in outlook 2013 User Interface will be removed.

8)      When the project expires as per the selected policy, all associated artifacts to this project will be deleted.

 Hope this helps.

Useful Urls:

** Overview of site permissions in SharePoint 2013


 

 

Friday, March 29, 2013

How to enable MS Dynamics CRM 2011 to integrate with Windows Azure

Hi,

I'm writing this article to explain a good architecture design for integrating your Microsoft Dynamics CRM 2011 with windows azure.

Let's  say you have on-premise CRM 2011 instance, and you want to use Windows Azure Blob storage to store Customer's documents on the cloud. How would you do that ?

The example i'm giving is applicable to any other windows azure service such as: SQL Azure, Mobile Notification Service, AppFabric Features..etc.

Since Windows azure is a scalable Cloud platform, you can easily integration your CRM 2011 with the windows azure on the cloud in 4 main steps.

Before going through the details, I'd like to explain the architecture of the proposed solution.

MS CRM 2011 has a backend windows service called "CRM Asynchronous Service" this is the component that will be in charge to communicate with the windows azure through a service bus.

MS CRM 2011 has 2 types of plugins, out-of-the box (OOB) and custom plugins. The OOB plugins runs  with full trust but the custom plugins runs with partial trust, and we will develop a custom plugin to connect to a listener through azure service bus.

The solution has the following components:

1) Configure CRM to be Windows Azure Aware.

2) We need to configure a service bus on Azure with an endpoint to communicate with the CRM server.

3) A listener hosted in Windows Azure to communicate with the asyncrhounous service, specificially listening to CRM assembly "Microsoft.Xrm.Sdk" with RemoteExecuteContext defined. so we need to develop a listener and deploy it on windows azure.

4) A custom CRM Plugin to communicate with the Windows Azure Listener.


How To accomplish, configure and develop this solution:

1) To accomplish step 1 , "Configure CRM for Integration with Windows Azure" :
http://technet.microsoft.com/en-us/library/gg328249.aspx

2) To accomplish step 2, "Configure Windows Azure ACS on Azure" :
http://technet.microsoft.com/en-us/library/jj863635.aspx

3) How to write a windows azure listener:
http://technet.microsoft.com/en-us/library/gg309615.aspx

C# Sample code - Listener:
http://technet.microsoft.com/en-us/library/gg309657.aspx

4) To accomplish step 4, "How to write Azure Aware CRM Plugin":
http://technet.microsoft.com/en-us/library/gg328194.aspx

Note, if you want to develop a custom workflow activity:
http://technet.microsoft.com/en-us/library/gg327854.aspx

Registration step - FINAL:
http://technet.microsoft.com/en-us/library/gg328524.aspx


**Here is some sample code for all what i mentioned above "listeners & plugins":
http://technet.microsoft.com/en-us/library/gg334712.aspx

Note: you should be having CRM SDK and Windows Azure SDK 1.7 or higher to be able to exercise and develop the solution.

Hope this helps.


Reference:
-Azure Extensions for Microsoft Dynamics CRM 2011:
http://technet.microsoft.com/en-us/library/gg309276.aspx



 

Sunday, November 04, 2012

Error When activating Windows 8 Code 0x8007007B

Hi Folks,

If you are facing a problem activating your windows 8 machine this is because there is a bug till this point that won't allow you to activate or even change the product key from the  user interface. The solution for this problem is to change the key using the command line. you will be able to do this in 2 simple commands.

The Error Code when trying to activate your windows 8:




1) Open Command Prompt as Administrator
From the Metro Desktop, Hover the top right corner to get the menu; then search for "Command Prompt" and then hit enter. you will get the command prompt tile. then right click on this tile and click on Run As Administrator.

Below Figure shows the appearance before you click on Run as Administrator.


 


2) Type in this command to uninstall the product key

slmgr /upk


Once you enter this command you will get this popup window.




3) Install your product key

slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX



Once you install the new key you will get this message



Once you installed the new key, you will notice that if you go back by typing Activate Windows in the search menu from Metro Desktop you will be noticing that the windows is activated.

Congrats and have fun with Windows 8!

Hope this helps.

Regards,
Mostafa E.

Thursday, November 10, 2011

SharePoint Restore Error: Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5050' or later

Hi Folks,

I was deploying a new release for a SharePoint project that i'm working on with my team, when i was try to backup and restore a site collection from my development to staging environment, I got this error:


SharePoint Restore Error: Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5050' or later.


To fix this problem, follow these steps:

1) Make sure that both environments have the same updates and CUs. To do so, Open Central Administration and click on Upgrade and Migration link and click on "Check product and patch installation  status".
You will have list of updates and CUs that have been installed on your environment, make sure those updates are identical. Any missing updates, download and install it on the new environment if you haven't document this as a part of your release process that you have in place.

2) Then click on "Review database status" under upgrade and migration section and make sure you don't have "need upgrade" to any of your content databases.The status should be "No action required". If you have any upgrade required and specially if you have SP1 installed, this means you didn't run the SPConfig command post to your SP1 installation. To do so, follow these steps:

a) Launch an elevated (Run as Administrator) SharePoint 2010 Management shell :
(get-spserver $env:computername).NeedsUpgrade
If the result of this command is True, then you need to complete step (b) below. If the result is False then no further action (b) is needed.
b) In order to update the SharePoint databases, you must manually run the PSconfig utility. To run the utility:

  - Open an Administrative command prompt. 
  - Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN 
  - Run:
    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Wait till the configuration wizard finishes all updates and then you will be able to backup and restore your site collection with no issues...


Hope this helps.

Wednesday, November 02, 2011

User Profile Synchronization in SharePoint 2010 Facts

Hi Folks,

I'd like to share with you some important facts about User Profile synchronization in SharePoint 2010. SharePoint 2010 has User Profile Service application which provides a two-way synchronization for users/groups from your directory services or any external system in sync with SharePoint 2010 users and groups profiles.

Terms used in this post:
* UP: User Profile.
* UPSSA: User Profile Synchronization Service Application.
* UPSS: User Profile Synchronization Service.

Here are some facts you should be aware when you start planning for user profiles in SharePoint:
1) SharePoint 2010 has User Profile Service Application which manage the synchronization process between SP and AD or any external system that contains users & groups.

2) SP 2010 provisions a version of Microsoft Forefront Identity Manager to participate in synchronization.

3) UPSSA can only have one user profile synchronization service.

4) A UPSS is associated with connections and mappings.

5) We divide connections in UPSS into two types: connections to directory services, and connections to business systems.

6) When you setup a connection in UPSS to connect to directory services, You specify which containers to be included in the synchronization. You can specify filters to exclude service or disabled accounts.

7) Mapping is a step to map SharePoint user profile fields to directory services/external system user profile master data fields.

8) Upon each synchronization, SharePoint deletes SP users who have been deleted from Directory services.

9) Upon each synchronization, SharePoint add and updates SP user profile's fields as configured in the UPSS.

10) IMPORTANT: If you have multiple directory services, each directory services MUST provide unique users. You can't synchronize a single user with multiple directory services.

11) IMPORTANT: You can populate properties from any existing business system. You can't create new user profiles from an external system, and you can't write data back to a business system.

12) To synchronize properties from external system, First you should create an external content type to bring data from the business system into SP 2010. Then you will be able to synchronize these users into SP.

13) You should have a key field to be used for mapping between SP user profiles and your external system. You can use employee's work email as the identifier of your external content type. In this case, SP will synchronize information which matches employee's email to be captured in your synchronization records.

14) You can build a custom solution using SP object model to create user profiles in SharePoint.

Hope this helps.


References:
1) Profile Synchronization overview in SP 2010:
http://technet.microsoft.com/en-us/library/gg188041.aspx
2) BCS Overview in SP 2010:
http://technet.microsoft.com/en-us/library/ee661740.aspx



Thursday, September 30, 2010

Why do we need managed accounts in SharePoint 2010 ?

Hi All,

SharePoint 2010 shipped with a new feature called "Managed Accounts". Managed accounts is a feature that allow sharepoint farm admins and system engineers to manage service accounts/Services created for the sharepoint 2010.

For Example: you might need a service account for your application pool or different accounts for the Sandbox solutions in SharePoint. So, You have to keep those service accounts with their password in a secured file in your system. If the password for one of those accounts has been changed, the result of this your service account will stop functioning.

The solution for this comes with SharePoint 2010 that you can register your service accounts as a Managed Accounts, and you don't need then to remember the password once you register them in your farm. and also the sharepoint 2010 will take care of the password expiry policy that you have in your organization by creating a new strong password and notify you as well. At the same time you can change the managed accounts that manage the service applications/services from the central administration.

How can i register a service account in my far ? here are the steps:
1) Open Central administration.
2) Select security.
3) Select Managed accounts.
4) Type your domain username and password you would like to register.
username: DOMAINNAME\USERNAME
password: ACCOUNTPASSWORD

5) Optional, configure SharePoint to notify you if you have password expiry policy by creating new password.

Tip: This is a good practice to enable SharePoint to generate the password for you and send a notification to you. Even if you are working in an organziation with high password requirement's policy in there, you can let SharePoint change it for you automatically to keep your environment secure and you can change it after that as well.

Once you register your managed accounts in your farm, you can then change those managed accounts to different service applications in SharePoint.

How can i change the service accounts for SharePoint services?
1) Open Central Administration.
2) Select Security.
3) Select Manage Service Accounts.
4) Select the service application and the required managed account.

Tip: Once you select the service application, you will be able to assign to any managed account in your farm.

Summary: It's recomended to create your managed accounts and use it across your farm without the need to remember the password for your accounts.

Hope this helps.


Regards,
Mostafa Arafa
twitter.com/mostafaelzoghbi

Thursday, September 16, 2010

SharePoint Governance Tip: Manage Self Site Creation Service and un used sites in your farm

Hi All,

I was implementing Site Creation governance practices, and i came out with the idea of this post, and I'd like to share 2 governance tips:

1) Self Site Creation Service: It is a SharePoint 2010 service that allow users to create sub sites within their site collections.

To configure Self Site Creation (SSC)Service:
Note: By Default is service is off on your web application.
1. Open SharePoint Central administration.
2. Click on Application Management Tab.
3. Under Site Collection, Click on Configure Self-Site Creation service.
4. Select your web application and select "On" from the choice option.
5. Check "Require secondary contact" to force the user to add another user to be a site administrator other than himself.

Note: When any admin clicks on OK button, A new item will be added to the announcement list of the top level site.

As a user, try to go to the top level site and click on lists and select Announcements. and you will find a new entry has been added, Try to open it, The item will have this url for users:
http://PORTALURL/_layouts/scsignup.aspx

This is the page that any site user can create a new site within the site collection.

** You can manage the SSC service using the stsadm tool:
Enable SSC serivce:
stsadm.exe -o enablessc -url -requiresecondarycontact
Disable SSC service:
stsadm -o disablessc -url


2) As a SharePoint Farm Admin if you enable this service, the next question will be:
How can i remove or take an action for un used sites? This answer is: by configure "Confirm site use and deletion":
1) Open Central Administration.
2) Select your Web Application.
3) Check the box to send email notifications after specific # of Days let's say : 60 Days
4) Specify the duration that you need backend timer serivce to check for the existing created sites: Preferred to be Daily and you can select any time as per your policy.
5) You can check to delete all site content if the site use wasn't confirmed by the site admin after specific # of notifications. (Option)

After you configure Site use confirmation and deletion you will be able to manage and monitor your site collection activities and # of sites and keep your farm operates with good performance by managing # of sites hosted on your farm.

If you are looking for a template document for site creation and maintanance sheet, check this link: http://go.microsoft.com/fwlink/?LinkId=193521

Hope this helps...

Reference:
- stsadm to manage ssc service:
http://technet.microsoft.com/en-us/library/cc261685.aspx

Regards,
Mostafa Arafa
twitter.com/mostafaelzoghbi