question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test-TargetResource SPFarm Resource fails to find local SharePoint Server

See original GitHub issue

Details of the scenario you try and problem that is occurring: I am doing a complete setup of a lab environment for SharePoint, including the setup of Active Directory, SQL and SharePoint on one single vm. The configuration is done using Composite Resources and works fine - until the moment where the farm was already created and you rerun the configuration. As soon as DSC reaches the step

VERBOSE: [SHAREPOINTLAB]:[[SPFarm]CreateSPFarm::[LabSharePoint]SPSetup] Leaving BeginProcessing Method of Get-SPServer.

it fails with the error “The server named ‘SHAREPOINTLAB’ does not exist.” (The local server FQDN is SharePointLab.demo.local). The operational eventlog holds the following entry:

This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on MSFT_SPFarm DSC resource. FullyQualifiedErrorId is Microsoft.SharePoint.PowerShell.SPCmdletGetServer. Error Message is The server named ‘SHAREPOINTLAB’ does not exist…

When I just load the SharePoint PSSnapin myself and run Get-SPServer, I get the following result:

Address                        Role                           Status
-------                        ----                           ------
SharepointLab.demo.local       SingleServerFarm               Online

I am not sure what is wrong here, the only thing I can imagine is that SharepointLab != SharepointLab.demo.local ?

The DSC configuration that is using the resource:

SPFarm CreateSPFarm
{
    Ensure = "Present"
    DatabaseServer = "SharePointLab.demo.local"
    FarmConfigDatabaseName = "SP_Config"
    Passphrase = $FarmPassPhrase
    FarmAccount = $FarmAccount
    PsDscRunAsCredential = $InstallAccount
    AdminContentDatabaseName = "SP_AdminContent"			
    RunCentralAdmin = $true
    DependsOn = "[SPInstall]InstallSharePoint"

}

Version of the Operating System and PowerShell the DSC Target Node is running: OSVersion: Windows Server 2016 Version 1607 (OS Build 14393.2155) PSVersion: 5.1.14393.2155

Version of SharePoint that is used (e.g. SharePoint 2016): SharePoint 2016

Version of the DSC module you’re using: Version: 2.2.0.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ykuijscommented, Jun 6, 2018

PR merged, closing issue

0reactions
ykuijscommented, Jun 4, 2018

Fixed in PR #811

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test-TargetResource SPFarm Resource fails to find local ...
This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on MSFT_SPFarm DSC resource.
Read more >
Get-SPFarm (sharepoint-server)
The Get-SPFarm cmdlet returns the local SharePoint farm. No parameters are used. For permissions and the most current information about Windows PowerShell ...
Read more >
SharePoint Configuration Failure - Microsoft Q&A
Hello there,. This is a common issue when uninstall and reinstall SharePoint on the same machine, some files in the MachineKeys folder give...
Read more >
SharePoint Online doesn't return search results
This article describes how to resolve an issue that SharePoint Online doesn't return search results.
Read more >
Restore-SPFarm (sharepoint-server)
The Restore-SPFarm cmdlet restores one or more items from a backup such as an individual database, Web application, or the entire farm. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found