If you are using Mac OS X with MAMP (Mac Apache MySQL PHP) installed in your OS and you are still scratching your head asking why “localhost” or MAMP starting page “localhost/mamp” is taking ages to load. Yes, you are having the same problem that i had previously.
First of all, please make sure your “locahost” is not incorrectly mapped in your hosts file.
- Kindly open Terminal (or you can hit Command + Shift + U then double click on Terminal)
- enter command “sudo nano /private/etc/hosts” and enter your admin password.
- Ensure the following entries in your file. No duplicate of 127.0.0.1
- Control + O, Control + M and Control + X to save and exit the file
If your hosts file is correct. Please check your Activity Monitor for any suspicious running backend process. (You can find the Activity Monitor in Utilities Command + Shift + U)
In my case, there is this “mdworker” process which was taking high %CPU!
After googling of this mdworker (here), this is actually a ‘metadata server worker’ used as search engine for Spotlight. In the referenced article, it is shared that this process will search into your external hard drive and apparently I just had my 1TB external hard drive plugged into my MBA! And it is also running Time Machine Backup job.
For those who don’t really need their external hard drive to be indexed in Spotlight, you can actually exclude this mdworker from crawling your external hard drive
- Simply go to System > Spotlight
- Under Privacy tab, click Add button to include all your external hard drive partition into the “Prevent” list.
And if you do not wish to exclude your external hard drive from indexing. All you can do is to wait until the indexing is completed.
It is always handy to have an automated script to perform task for you. Manual click vis SSMS could be tedious and prone to error.
I came out with a simple SQL which allow me to set recovery mode of all database in one instance to Simple or Full.
DECLARE @name varchar(255),@sql varchar (500)
DECLARE databases CURSOR FOR
SELECT name FROM sys.databases where name not in (‘master’,’tempdb’,’model’,’msdb’)
— Perform the first fetch.
FETCH NEXT FROM databases
— Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
— This is executed as long as the previous fetch succeeds.
SET @sql =
ALTER DATABASE [‘+ @name + ‘] SET RECOVERY SIMPLE;’
+ ‘DBCC SHRINKFILE([‘+@name+’_log], 1)’
FETCH NEXT FROM databases
Note that if you are doing Log Shipping, you need to use FULL recovery mode or Bulk-logged
The following steps show you how to grant a domain user or local user with Local Administrator rights.
- Logon to the machine/server that you want to grant Local Administrator right to.
- Open “Run” from the Start Menu. Or alternatively hit [Windows + R] key
- enter “dsa.msc” (if you are in a Domain Controller machine) or “lusrmgr.msc” (for any other machine)
- Navigate to your domain (if DC) and then to “Built in”
- Double click on the Administrator group.
- Go to “Members” tab and click “Add” button
- Assign the account that you want to grant access with.
- Click Ok to complete
Surprisingly, if you are new to SharePoint, you may be confused by the fancy terminology such as, SharePoint Setup Account, SharePoint Database Access Account, SharePoint Central App Pool account bla bla..
In usual case (if you did follow Technet properly), your SharePoint Farm Account would be the same as y our SharePoint Database Access Account.
So how do you know which account you have setup as SharePoint Farm Account (though it may sound silly to ask your self this question)? or maybe to check on other’s existing SharePoint farm? You can try the following
- Go to your SharePoint Central Administration (CA) page. (or you may fire up a CMD run with Administrator and execute the following)
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\BIN\psconfigui.exe" -cmd showcentraladmin
- Go to “Security” > “Configure Service Accounts”. (or you may directly hit the relative path from your CA ‘/_admin/FarmCredentialManagement.aspx’)
- In the Drop Down list, select Farm Account
- Your SharePoint Farm Account will be shown. In my case, it is “SP2013\spfarm”
- Go to “Services”. (or fire up Run – [Windows + R] key and enter “services.msc”)
- Look up to “SharePoint Timer Services” and check the value in “Log on as” column.
- The account running SharePoint Timer Services is always the SharePoint Farm Account.
(if only you have access to the Active Directory)
- Go to “Active Directory Users and Computers”. (or you may fire up Run – [Windows + R] key and enter “dsa.msc”)
- Navigate to Your Domain > Users
- Double click on “WSS_ADMIN_WPG” group.
- Click on “Members” tab
- If you setup the Farm base on Technet guide, you shall see 2 accounts added into this group. One of them is SharePoint Setup Account and another one should be the SharePoint Farm Account.
At times, you will require to read your data in XML format using Powershell Script. Possible reason to do that is such that you can amend the XML file without editing your original Powershell Script. That’s provided that the standardized Powershell Script can fulfill your requirements.
To cater for More flexibility, you can actually insert Powershell Script within your XML. Here is how you can perform that.
Note that this required a minor change in your Powershell Script. (Not to worry, you only need to edit this once and for all).
$xml = (Get-Content .\yourxml.xml)
$expression = $xml.Scripts.script
#Optionally you can put a foreach loop to run each of your script
Below is the simple xml of mine
<script> Write-Host "Halo"; Write-Host "Testing";
The output looks like this
If yours is Intranet SharePoint Application, this is a very common issue “SLOW stsadm command”!!! Yes, you may not need to bother about this if you are not using it frequently. BUT, if you have thousand lines of stsadm command you need to execute (such as migrating users from SharePoint 2007 to SharePoint 2010, installing/uninstalling solution packages), this could be an ass painful process.
Despite trying the following article http://dirkvandenberghe.com/2009/01/08/speed-up-sharepoint-spin-up-and-stsadm-execution-time-by-jeroen-ritmeijer.html, the slowness still persist
One thing that i notice from my previous project experience is that this issue will only happen when there is no internet connection in your Share Point server. You can try to enable internet access though. However, most of the cases, you wont get the privilege to do so as this could be a security breach or the policy merely doesn’t allow you.
Nevertheless, the following modification could actually solve the slowness prooblem.
Navigate to .NET Framework folder C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG and look for machine.config file. (Note that the Location may be different if your server is running on 32 bit)
Look for the following section. (You might want to do a backup before making any changes)
Save the file and try STSADM now!