8

I'm trying to run the non-GUI version of configuration wizard using power shell because I would like to set config and admin database names. GUI wizard doesn't give you all possible options for configuration (but even though it doesn't do it either).

I run this command:

New-SPConfigurationDatabase
    -DatabaseName "Sharepoint2010Config"
    -DatabaseServer "developer.mydomain.pri"
    -AdministrationContentDatabaseName "Sharepoint2010Admin"
    -DatabaseCredentials (Get-Credential)
    -Passphrase (ConvertTo-SecureString "%h4r3p0int" -AsPlainText -Force)

Of course all these are in the same line. I've broken them down into separate lines to make it easier to read. When I run this command I get this error:

New-SPConfigurationDatabase : Cannot connect to database master at SQL server a
t developer.mydomain.pri. The database might not exist, or the current user does
not have permission to connect to it.
At line:1 char:28
+ New-SPConfigurationDatabase <<<<  -DatabaseName "Sharepoint2010Config" -Datab
aseServer "developer.mydomain.pri" -AdministrationContentDatabaseName "Sharepoint
2010Admin" -DatabaseCredentials (Get-Credential) -Passphrase (ConvertTo-SecureS
tring "%h4r3p0int" -AsPlainText -Force)
    + CategoryInfo          : InvalidData: (Microsoft.Share...urationDatabase:
   SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], SPExcep
  tion
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPCon
   figurationDatabase

I created two domain accounts and haven't added them to any group:

  • SPF_DATABASE - database account
  • SPF_ADMIN - farm account

I'm running powershell console as domain administrator. I've tried to run SQL Management studio as domain admin and created a dummy database and it worked without a problem.

I'm running:

  • Windows 7 x64 on the machine where Sharepoint Foundation 2010 should be installed and also has preinstalled SQL Server 2008 R2 database
  • Windows Server 2008 R2 Server Core is my domain controller that just serves domain features and nothing else

I've installed Sharepoint according to MS guides http://msdn.microsoft.com/en-us/library/ee554869%28office.14%29.aspx installing all additional patches that are related to my configuration.

Any ideas what should I do to make it work?

Robert Koritnik
  • 912
  • 5
  • 19
  • 34

2 Answers2

0

You appear to be missing the required FarmCredentials parameter to the cmdlet.

If that doesn't help, you may need to run the Powershell console as administrator to get the command to work properly.

http://technet.microsoft.com/en-us/library/ff607838.aspx

MattB
  • 11,124
  • 1
  • 29
  • 36
  • powershell command automatically asks for missing parameters, namely `FarmCredentials` that I enter when it runs. If I'd omit `DatabaseName` I would be asked to enter it as well, so consider `FarmCredentials` not missing. – Robert Koritnik Jun 05 '10 at 08:11
  • @Robert: if you run SQL Server Management Studio as the user specified in `DatabaseCredentials` can you properly access the `master` database? – MattB Jun 05 '10 at 15:57
  • I haven't explicitly accessed master DB iteself, but I guess if I've successfully created a new DB on the server it had to write to master DB tables anyway. I doubt that Sharepoint installation writes directly to the master DB or does it? Why would it? It has to create new credentials, new databases, tables etc... I don't see any particular reason why explicit access to master DB would be needed? – Robert Koritnik Jun 07 '10 at 07:50
  • @Robert: I don't either, and you are correct that adding a DB should access the master table and prove you have permissions. I'm more curious about the "as the user specified in `DatabaseCredentials` portion right now I think. Also - I did a google for part of the error you are getting, and saw a couple of blog posts that say turning off Windows Firewall fixed this problem. Worth a shot I guess. (If it fixes it, you can turn back on Windows Firewall and open UDP 1434 for sqlbrowser.exe) – MattB Jun 08 '10 at 13:26
  • @MattB: I've disabled firewall but no obvious difference. Actually Sharepoint Foundation 2010 is being installed on the same machine where SQL Server 2008 R2 database is. This is driving me crazy. **So many days, no improvement.** This makes me look really stupid! – Robert Koritnik Jun 09 '10 at 16:43
  • @Robert: I know you don't want to do this, but what if you try having it use the default db names and see what happens? – MattB Jun 09 '10 at 18:48
  • @MattB: I've tried running `psconfigui.exe` not changing default DB name. I provided DB account and that's it. Same error. No change. I'm thinking of reinstalling the whole machine... – Robert Koritnik Jun 10 '10 at 05:39
  • @Robert: you might just try a reinstall of SQL Server first, that is what seems to be messed up. – MattB Jun 10 '10 at 15:14
  • @MattB: I reinstalled SQL Server as you suggested. No difference. I reinstalled the whole thing... No difference. I just can't seem to make it work! It looks like it can't authenticate aginst SQL Server with my domain account taht I provide while running config... I've manually added that same user to SQL as sysadmin, but still same thing. I enabled Named pipes. Still no luck... I'm at a dead end. I **really** don't know what else to try. – Robert Koritnik Jun 15 '10 at 12:46
0

Try logging into the SQl server and verify the perms on the DB created. The user accounts you specified must have dbcreator and dbsecurity roles on SQL server to create the config DB.

HTH

user55709
  • 81
  • 7
  • They do. I didn't bother to rung the powershell command anymore. It just didn't work anyway. So I configured with defaults using the GUI config utility. Which did work. – Robert Koritnik Oct 03 '10 at 09:19