GithubHelp home page GithubHelp logo

Comments (10)

BrianFarnhill avatar BrianFarnhill commented on June 12, 2024

The clear remote sessions object is just used to ensure no existing remote sessions are interfering with the script. The error you are getting is insite of your xSPCreateFarm object, so it is nothing to do with the remote sessions one. Can you post your config file in full for me to look at?

from sharepointdsc.

NikCharlebois avatar NikCharlebois commented on June 12, 2024

Thanks Brian, here it is :
Configuration SharePointServer
{
param (
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()]
[PSCredential] $FarmAccount,

    [Parameter(Mandatory=$true)]
    [String[]] $NodeGUID
)

Import-DscResource -ModuleName xSharePoint
Import-DscResource -ModuleName xWebAdministration
Import-DscResource -ModuleName xCredSSP
Import-DscResource -ModuleName xDisk

node $NodeGUID
{
    xCredSSP CredSSPServer { Ensure = "Present"; Role = "Server" } 
    xCredSSP CredSSPClient { Ensure = "Present"; Role = "Client"; DelegateComputers = "DSCPull" }
    File SPBinaryDownload
    {
        DestinationPath = "C:\SPInstall"
        Ensure          = "Present"
        SourcePath      = "\\DSCPULL\PullServer\SharePoint 2013\SPInstall"
        Type            = "Directory"
        Recurse         = $true
    }
    File UlsViewerDownload
    {
        DestinationPath = "C:\Tools\UlsViewer.exe"
        Ensure          = "Present"
        SourcePath      = "\\DSCPull\PullServer\ULSViewer\ULSViewer.exe"
        Type            = "File"
    }

    #**********************************************************
    # Binary installation
    #
    # This section triggers installation of both SharePoint
    # as well as the prerequisites required
    #********************************************************** 
    xSPClearRemoteSessions ClearRemotePowerShellSessions
    {
        ClearRemoteSessions = $false
    }
    xSPInstallPrereqs InstallPrerequisites
    {
        InstallerPath     = "C:\SPInstall\Prerequisiteinstaller.exe"
        OnlineMode        = $false
        SQLNCli           = "C:\SPInstall\prerequisiteinstallerfiles\sqlncli.msi"
        NETFX             = "C:\SPInstall\prerequisiteinstallerfiles\dotNetFx45_Full_setup.exe"
        IDFX              = "C:\SPInstall\prerequisiteinstallerfiles\Windows6.1-KB974405-x64.msu"
        Sync              = "C:\SPInstall\prerequisiteinstallerfiles\Synchronization.msi"
        AppFabric         = "C:\SPInstall\prerequisiteinstallerfiles\WindowsServerAppFabricSetup_x64.exe"
        IDFX11            = "C:\SPInstall\prerequisiteinstallerfiles\MicrosoftIdentityExtensions-64.msi"
        MSIPCClient       = "C:\SPInstall\prerequisiteinstallerfiles\setup_msipc_x64.msi"
        WCFDataServices   = "C:\SPInstall\prerequisiteinstallerfiles\WcfDataServices.exe"
        KB2671763         = "C:\SPInstall\prerequisiteinstallerfiles\AppFabric1.1-RTM-KB2671763-x64-ENU.exe"
        WCFDataServices56 = "C:\SPInstall\prerequisiteinstallerfiles\WcfDataServices56.exe"
        PowerShell        = "C:\SPInstall\prerequisiteinstallerfiles\Windows6.1-KB2506143-x64.msu"
        DependsOn         = "[xSPClearRemoteSessions]ClearRemotePowerShellSessions"
    }
    xSPInstall InstallBinaries
    {
        BinaryDir  = "C:\SPInstall"
        ProductKey = "xxxxxxxxxxxx"
        DependsOn  = "[xSPInstallPrereqs]InstallPrerequisites"
    }

    #**********************************************************
    # IIS clean up
    #
    # This section removes all default sites and application
    # pools from IIS as they are not required
    #**********************************************************

    xWebAppPool RemoveDotNet2Pool         { Name = ".NET v2.0";            Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" }
    xWebAppPool RemoveDotNet2ClassicPool  { Name = ".NET v2.0 Classic";    Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" }
    xWebAppPool RemoveDotNet45Pool        { Name = ".NET v4.5";            Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites"; }
    xWebAppPool RemoveDotNet45ClassicPool { Name = ".NET v4.5 Classic";    Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites"; }
    xWebAppPool RemoveClassicDotNetPool   { Name = "Classic .NET AppPool"; Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" }
    xWebAppPool RemoveDefaultAppPool      { Name = "DefaultAppPool";       Ensure = "Absent"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" }
    xWebSite    RemoveDefaultWebSite      { Name = "Default Web Site";     Ensure = "Absent"; PhysicalPath = "C:\inetpub\wwwroot"; DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" }


    #**********************************************************
    # Basic farm configuration
    #
    # This section creates the new SharePoint farm object, and
    # provisions generic services and components used by the
    # whole farm
    #**********************************************************

    xSPCreateFarm CreateSPFarm
    {
        DatabaseServer           = "sp2013-dsc.contoso.com"
        FarmConfigDatabaseName   = "SP_Config"
        Passphrase               = "pass@word1"
        FarmAccount              = $FarmAccount
        InstallAccount           = $FarmAccount
        AdminContentDatabaseName = "SP_AdminContent"
        DependsOn                = "[xSPInstall]InstallBinaries"
    }

    xSPStateServiceApp StateServiceApp
    {
        Name           = "State Service Application"
        DatabaseName   = "SP_State"
        InstallAccount = $FarmAccount
        DependsOn      = "[xSPCreateFarm]CreateSPFarm"
    }

    xSPWebApplication HostNameSiteCollectionWebApp
    {
        Name                   = "SharePoint Sites"
        ApplicationPool        = "SharePoint Sites"
        ApplicationPoolAccount = $FarmAccount.UserName
        AllowAnonymous         = $false
        AuthenticationMethod   = "NTLM"
        DatabaseName           = "SP_Content_01"
        DatabaseServer         = "sp2013-dsc.contoso.com"
        Url                    = "http://localhost"
        Port                   = 80
        InstallAccount         = $FarmAccount
    }

    xSPServiceAppPool MainServiceAppPool
    {
        Name           = "SharePoint Service Applications"
        ServiceAccount = $FarmAccount.UserName
        InstallAccount = $FarmAccount
        DependsOn      = "[xSPCreateFarm]CreateSPFarm"
    }

    LocalConfigurationManager
    {
        RebootNodeIfNeeded = $true
    }
}

}
$Computers = @("SP2013-DSC")

write-host "Generating GUIDs and creating MOF files..."
foreach ($Node in $Computers)
{
$NewGUID = [guid]::NewGuid()
$NewLine = "{0},{1}" -f $Node,$NewGUID

$ConfigData = @{
AllNodes = @(
    @{
        NodeName                    = "$NewGUID"
        PSDscAllowPlainTextPassword = $true
    }
    )
}

SharePointServer -ConfigurationData $ConfigData -OutputPath ".\TestConfig" -NodeGUID $NewGUID
$NewLine | add-content -path "$env:SystemDrive\Program Files\WindowsPowershell\DscService\Configuration\dscnodes.csv"

}
write-host "Creating checksums..."
New-DSCCheckSum -ConfigurationPath .\TestConfig -OutPath .\TestConfig -Verbose -Force

write-host "Copying configurations to pull service configuration store..."
$SourceFiles = (Get-Location -PSProvider FileSystem).Path + "\TestConfig*.mof*"
$TargetFiles = "$env:SystemDrive\Program Files\WindowsPowershell\DscService\Configuration"
Move-Item $SourceFiles $TargetFiles -Force
Remove-Item ((Get-Location -PSProvider FileSystem).Path + "\TestConfig")

from sharepointdsc.

NikCharlebois avatar NikCharlebois commented on June 12, 2024

I should have mentioned that I am using a DSC Pull Server to do the installation. Also, what is the rational fro having all set-target methods use Invoke-Command starting in xSPCreateFarm? Why not make the calls local? Because of the impersonnification?

from sharepointdsc.

BrianFarnhill avatar BrianFarnhill commented on June 12, 2024

Yea its because we need to run the calls as a specific domain account that will have access to the databases. In regards to your setup, I think the issue is with your CredSSP configuration. You need to use FQDNs there and each machine needs to have itself listed as a delegate (as that is what we do, we open a 'remote' session to the local host as another user). So where you specify

DelegateComputers = "DSCPull"

try changing that to something like

DelegateComputers = "SharePoint.mydomain.local"

The reason our examples use a wildcard (such as *.mydomain.local) is so the SharePoint machines can all see each other, but if you want to lock it down specifying the current FQDN of the machine you are on will do. You can test the configuration by doing something like this:

Enter-PSSession -ComputerName $env:COMPUTERNAME -Credential (Get-Credential) -Authentication CredSSP

This is how we create the sessions, if that works and you get a valid session (using the credentials you have on InstallAccount) then the xSharePoint resources should all behave the same way.

from sharepointdsc.

NikCharlebois avatar NikCharlebois commented on June 12, 2024

Unfortunately, even if I use the FQDN is complains about my session being broken. Also, testing the config using CredSSP works fine

from sharepointdsc.

NikCharlebois avatar NikCharlebois commented on June 12, 2024

So to add to the confusion, the Error is thrown on the first "Invoke-Command" Line of the xSPCreateFarm resource:

Invoke-Command -Session $session -ArgumentList $PSBoundParameters -ScriptBlock {
$params = $args[0]
New-SPConfigurationDatabase -DatabaseName $params.FarmConfigDatabaseName -DatabaseServer $params.DatabaseServer
-Passphrase (ConvertTo-SecureString $params.Passphrase -AsPlainText -force) -FarmCredentials $params.FarmAccount
-SkipRegisterAsDistributedCacheHost:$true `
-AdministrationContentDatabaseName $params.AdminContentDatabaseName
}

But, both the config and the admin database are partially created on the SQL....

from sharepointdsc.

BrianFarnhill avatar BrianFarnhill commented on June 12, 2024

OK I now have an environment that is replicating your issue. Leave it with me to troubleshoot on my end as well. I'll let you know how it goes

from sharepointdsc.

BrianFarnhill avatar BrianFarnhill commented on June 12, 2024

Nik are you able to let me know a couple of things here?

  • Are you running this with PowerShell 4 or 5?
  • Are you running this one Azure virtual machines (specifically with the DSC VM extension)?

from sharepointdsc.

NikCharlebois avatar NikCharlebois commented on June 12, 2024

Hi Brian,

Thanks for following up. I am using PowerShell 5, April 2015 preview. My VMs are on premises, no DSC VM extension. Thanks

from sharepointdsc.

BrianFarnhill avatar BrianFarnhill commented on June 12, 2024

This has been fixed by #60 and been pushed to the dev branch. I have a couple of other changes and fixes I want to roll in before I push it to the master branch and form a release though, so use the dev branch for the time being to resolve this issue.

from sharepointdsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.