dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 224 forks source link

Localhost Access is denied. #1253

Closed DYNSOL closed 5 years ago

DYNSOL commented 5 years ago

Hi,

I'm currently using Azure DSC. I've created a cluster using xFailOverCluster. Both nodes are showing in the cluster failover manager.

Now i'm trying to use SQLServerDSC to install SQL on the first node (https://github.com/PowerShell/SqlServerDsc/blob/dev/Examples/Resources/SqlSetup/4-InstallNamedInstanceInFailoverClusterFirstNode.ps1). However, i'm getting this error: "Connecting to remote server localhost failed with the following error message : Access is denied"

` $SqlServiceCredential = Get-AutomationPSCredential -Name "credentials" $SqlInstallCredential = Get-AutomationPSCredential -Name "credentials" $SqlAgentServiceCredential = $SqlServiceCredential
$SqlAdministratorCredential = $SqlInstallCredential SqlSetup 'InstallNamedInstanceNode1' { Action = 'InstallFailoverCluster' ForceReboot = $false UpdateEnabled = 'False' SourcePath = 'S:\'

        InstanceName               = 'SQL2017Cluster'
        Features                   = 'SQLENGINE,SSMS'

        InstallSharedDir           = 'E:\Program Files\Microsoft SQL Server'
        InstallSharedWOWDir        = 'E:\Program Files (x86)\Microsoft SQL Server'
        InstanceDir                = 'E:\Program Files\Microsoft SQL Server'

        SQLCollation               = 'Latin1_General_CI_AS'
        SQLSvcAccount              = $SqlServiceCredential
        AgtSvcAccount              = $SqlAgentServiceCredential
        SQLSysAdminAccounts        = $SqlAdministratorCredential.UserName            

        # Drive D: must be a shared disk.
        InstallSQLDataDir          = 'E:\MSSQL\Data'
        SQLUserDBDir               = 'E:\MSSQL\Data'
        SQLUserDBLogDir            = 'F:\MSSQL\Log'
        SQLTempDBDir               = 'G:\MSSQL\Temp'
        SQLTempDBLogDir            = 'G:\MSSQL\Temp'
        SQLBackupDir               = 'J:\MSSQL\Backup'           

        FailoverClusterNetworkName = 'Clustername' 
        FailoverClusterIPAddress   = '10.0.0.15'
        FailoverClusterGroupName   = 'Clustername'

        PsDscRunAsCredential       = $SqlInstallCredential

        DependsOn                  = '[WindowsFeature]NetFramework35', '[WindowsFeature]NetFramework45', '[xCluster]CreateCluster'
    }   `

Am i doing something wrong?

Any advice is greatly appreciated.

DYNSOL commented 5 years ago

This is now resolved. There was a group policy setting blocking "PsDscRunAsCredential"

johlju commented 5 years ago

Closing as per previous comment.