Skip to content


Object reference not set to an instance of an object, when running STSADM commands

This error is quite common when you are trying to run stsadm commands with a user that does not have the required permissions for the database. You should use your server admin account, which you installed SharePoint with in the first place.

You will often see it using stsadm commands that you supply a username and password to.
Example:
stsadm –o setconfigdb -connect –databaseserver SQLServer2008 -databasename Sharepoint_AdminContent -farmuser mydomain\myuser -farmpassword mypassword

Some have even reported that doing this won’t work for them. They must be logged in as the user they are giving the credentials for. To avoid this you can open a command prompt as that user instead of switching to it.

Go to “Run” in Windows and type this for the above:
“Runas /user:mydomain\myuser cmd.exe”
You will be promped for the password of the user, and commands input into the command prompt should run as that user. You should even be able to run the above stsadmin command without providing username and password.

  • Delicious
  • Digg
  • Twitter
  • Facebook
  • LinkedIn
  • TechNet
  • StumbleUpon
  • NewsVine
  • Technorati Favorites
  • Slashdot
  • MSDN
  • Share/Bookmark

Related posts:

  1. Object reference not set to an instance of an object. c:\wss\EventPlanning.wsp: The Solution installation failed.
  2. stsadm is not recognized as an internal or external command, operable program or batch file.
  3. Error when updating Windows SharePoint Services 3.0 with SP2 – An update conflict has occurred, and you must re-try this action. The object SPSearchDatabase…
  4. Access SharePoint API from Console Program – Program Against the WSS Object Model
  5. Run code with elevated privileges in SharePoint

Posted in SharePoint.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.