This project has moved. For the latest updates, please go here.

Exception being thrown with SetSynchronizationMachine

Aug 1, 2013 at 4:00 AM
Hi all

Getting the below error when UPS is getting configured, trying to install SP2013 with AutoSPInstaller (first time I've ever used it, lots of hiccups along the way but am almost there).
  • Waiting for User Profile Synchronization Service...Exception calling "SetSynchronizationMachine" with "4" argument(s)
    : "
    Parameter name: strSyncMachineAddress"
    At C:\SP\AutoSPInstaller\AutoSPInstallerFunctions.ps1:2627 char:21
  • $profileServiceApp.SetSynchronizationMachine($env:COMPUTERNA ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentException

  • Script halted!
  • Error Provisioning the User Profile Service Application
Not much there to figure out why it's dying. Any ideas?

Aug 1, 2013 at 11:57 AM
Hi Brett,

Open AutoSPInstallerFunctions.ps1 and edit the PS. Write out the parameters used by the $profileServiceApp.SetSynchronizationMachine() method before they are called. It looks like the variable/paramter is not correct and re-run autospinstaller; this should show you what the problem is.

Aug 1, 2013 at 12:38 PM
Thanks - have had it write out the 4 params and here they are (with appropriate blocking out):
  • Waiting for User Profile Synchronization Service..
    p2: b1b8e492-415a-41ac-b43f-b66437f211bc
    p3: MYDOMAIN\SPFarmAdmin-Test
    p4: myplaintextpw
They all look file to me?

Aug 1, 2013 at 12:39 PM
I've also tried starting the User Profile Synchronization Service by hand in Central Admin, entering the farm username and password in when prompted, and it's been stuck on "starting..." for about 6 hours now...

Aug 2, 2013 at 1:06 AM
Edited Aug 2, 2013 at 4:27 AM
Take a look here -

The UPS Sync Service is probably the most painful to get running. Everything needs to be exact (related to the Farm account) otherwise it won't start.

Also, don't try to start the FIM Services within Services.msc, it has to be done by Central Administration.

Also, take a look here -

If it is stuck in starting, you can stop it again with Powershell

$ups = Get-SPServiceInstance | where {$_.typename -eq "user profile synchronization service"}
Then type $ups to get the GUID

To stop it: Stop-SPServiceInstance | where {$_.typename -eq "user profile synchronization service"}
Aug 2, 2013 at 4:35 AM
Thanks! I found another page quite helpful:

I turned off profile sync configuration in the AutoSPInstaller XML file and let it finish running, then followed the above to get UPS working. Found that the Farm Admin service account wasn't a local admin which caused even my manual attempts to fail (albeit with very nondescript errors which took hours to diagnose). Now that I finally have SharePoint installed on this box, I'm not game to revert to my pre-AutoSPInstaller snapshot to try again but it's likely that it may have completed successfully if the account was an admin. Maybe another check worth adding in to the script?

Aug 5, 2013 at 12:56 AM
The SharePoint Farm account does get added (and removed) to the Local Administrators group. Ensure you have the following in your XML file.

<Account AddToLocalAdminsDuringSetup="true" LeaveInLocalAdmins="false">