Error

Mar 28, 2011 at 2:48 PM

I ran into an error this morning with the script related to the User Profile Service Application setup.

I am building a test virtual machine.   I have Windows Server 2008 R2 Standard with SQL 2008 R2 Enterprise installed.    This machine is not part of a domain... it will just be a stand alone environment.

The error I receive is:

Start-Process : This command cannot be executed due to the error: The directory
 name is invalid.
At C:\Users\Administrator\Downloads\AutoSPInstaller\SP2010\AutoSPInstaller\Auto
SPInstallerFunctions.ps1:1519 char:16
+         Start-Process <<<<  $PSHOME\powershell.exe -Credential $FarmCredentia
l -ArgumentList "-Command Start-Process $PSHOME\powershell.exe -ArgumentList `"
'$ScriptFile'`" -Verb Runas" -Wait
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOp
   erationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C
   ommands.StartProcessCommand

Any thoughts?   There doesn't seem to be a way to skip past the error because the script loops back if the User Profile Service is not started.

Is there a simple way in the config to block the configuration of the User Profile Service since this is not a domain install?

Mar 28, 2011 at 3:11 PM

Think I answered my own issue...  I think I need to just set the UserProfileSerivceApp Provision attribute to false.   Going to give that a quick try.   I love VM snapshots for easily rolling back and testing scripts.

Apr 6, 2011 at 2:49 AM

Getting the same error. I think $PSHOME is not defined for the SharePoint Farm Service Account but need to test this.

Coordinator
Apr 6, 2011 at 3:42 AM

Interesting... I just tested quickly on a VM, logged in with Farm Account for the first time interactively, $PSHOME resolved to the correct path. Let me know if it doesn't for you, might have to hard-code the path instead? I've never run into this problem on any of my envs though.

Brian

Apr 6, 2011 at 10:19 PM

I get the same error. However PowerShell will return $PsHome as c:\windows\system32\powershell\v1.0

Apr 7, 2011 at 12:33 AM
Edited Apr 7, 2011 at 12:34 AM

Tried to reproduce this on another VM but was unable to, it worked perfectly. My new theory is that (for some reason) the Farm Account was not in the local administrators group by the time this function runs, even though its added earlier in the script.

Separately, still need to figure out how to NOT install some things like UPA or MySites.

Apr 7, 2011 at 2:48 PM
I have double checked that spfarm is a local admin. I have also rebooted the server with no luck.

Any other ideas?

On Apr 6, 2011, at 5:33 PM, wahidsaleemi <notifications@codeplex.com> wrote:

From: wahidsaleemi

Tried to reproduce this on another VM but was unable to, it worked perfectly. My new theory is that (for some reason) the Farm Account was not in the local administrators group by the time this function runs.

Apr 7, 2011 at 8:32 PM

can you try running that line at a PoSH prompt? (obviously with arguments filled in) What do you get?

Apr 8, 2011 at 11:18 AM

You will get this error if you are trying to run AutoSPInstaller from a users folder, such a 'My Documents' or 'Desktop'. I've posted about it

Coordinator
May 8, 2011 at 1:55 AM

Hey @BackRowBloke - great post and thanks for the tip. I was totally unaware of this limitation (always having tested the script from a folder like C:\SP2010\AutoSPInstaller myself), but it totally makes sense for it not to work from a user folder like you mentioned.

Cheers
Brian

Coordinator
May 8, 2011 at 1:59 AM

FYI this is now part of the documentation: http://autospinstaller.codeplex.com/wikipage?title=Don%27t%20run%20AutoSPInstaller%20from%20a%20user%20folder%21&referringTitle=Documentation

Brian