Comments (10)
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.
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.
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.
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.
Unfortunately, even if I use the FQDN is complains about my session being broken. Also, testing the config using CredSSP works fine
from sharepointdsc.
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.
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.
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.
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.
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)
- SPDistributedCacheClientSetting: Missing SP2019 and SE Values HOT 5
- SPUserProfileServiceApp: PSDSCRunAsCredential does not become a db_owner
- Pass empty string to parameter HOT 1
- [SPSearchIndexPartition] Regression introduced with with the fix for issue #1376
- [SPProductUpdate] Resource does not support SPSE yet
- [SPProductUpdate] Resource pauses the Search Service
- [SPInstallPrereqs] Multiple instances of the VC++ Redist causes issues
- [SPShellAdmins] Get-SPDatabase cmdlet cannot be found
- [SPConfigWizard] Add possibility to temporarily dismount content databases during config wizard
- SPHybridConfig: New resource proposal HOT 1
- SPTrustedRootAuthority - Error while adding Trusted Root Authority via CertificateThumbprint
- SPInstallPrereqs: sqlncli.msi is no longer required after November 2021 CU HOT 2
- SPPublishServiceApplication - Set-TargetResource does not work
- Issue while exporting the site configurations with certificate thumbprint HOT 2
- [Export] Export doesn't work in SPSE
- [SPFarm] Import-Module SharePointServer causes exception in SharePoint Subscription 23H1 HOT 3
- SPCertificateSettings: Unable to set contacts when previously blank
- Intro and SPSite Enhancement
- DSC Resource HOT 1
- Least-privileged security model enabled after Oct 22 CU
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharepointdsc.