问题描述
我已将Windows Server 2012 R2虚拟机配置为拉服务器,将Windows 10虚拟机配置为拉客户端。也是域控制器的服务器已成功设置为拉式服务器,并且与客户端处于同一网络的计算机最初没有问题地连接到服务器。
对于拉取服务器,我具有以下配置:
param(
[Parameter(Mandatory=$false)]
[string] $NodeName = 'localhost',[Parameter(Mandatory)]
[String] $Key
)
Configuration PullServerConfiguration
{
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node $NodeName
{
LocalConfigurationManager
{
ConfigurationMode = 'ApplyAndAutoCorrect'
RefreshMode = 'Push'
RebootNodeifNeeded = $true
}
WindowsFeature DSCServiceFeature
{
Ensure = 'Present';
Name = 'DSC-Service'
}
xDscWebService PullServer
{
Ensure = 'Present';
EndpointName = 'PullServer';
Port = 80;
PhysicalPath = "$env:SystemDrive\inetpub\PullServer";
CertificateThumbPrint = 'AllowUnencryptedTraffic';
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules";
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration";
State = 'Started'
DependsOn = '[WindowsFeature]DSCServiceFeature'
UseSecurityBestPractices = $false
disableSecurityBestPractices = 'SecureTLSProtocols'
}
File RegistrationKeyFile
{
Ensure = 'Present'
Type = 'File'
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
Contents = $Node.RegistrationKey
}
}
}
PullServerConfiguration
$ConfigParameters = @{
AllNodes = @(
@{
NodeName = 'localhost'
Port = 80
RegistrationKey = $Key
RebootNodeifNeeded = $true
}
)
}
该客户端的配置:
param
(
[Parameter(Mandatory)]
[string] $ConfigurationServerUrl,[Parameter(Mandatory)]
[string] $ConfigurationServerKey
)
[DSCLocalConfigurationManager()]
configuration PullClientConfiguration
{
Node $NodeName
{
Settings
{
AllowModuleOverwrite = $True;
ConfigurationMode = 'ApplyAndAutoCorrect';
ConfigurationModeFrequencyMins = 60;
RefreshMode = 'Pull';
RefreshFrequencyMins = 30 ;
RebootNodeIfNeeded = $true;
}
#specifies an HTTP pull server for configurations
ConfigurationRepositoryWeb DSCConfigurationServer
{
ServerURL = $Node.configserver;
RegistrationKey = $Node.configserverKey;
AllowUnsecureConnection = $true;
ConfigurationNames = @("DemoConfig","ChocoConfig")
}
#specifies an HTTP pull server for sending reports
reportserverWeb DSCreportserver
{
ServerURL = $Node.configserver;
RegistrationKey = $Node.configserverKey;
AllowUnsecureConnection = $true;
}
PartialConfiguration DemoConfig
{
Description = "DemoConfig"
ConfigurationSource = @("[ConfigurationRepositoryWeb]DSCConfigurationServer")
}
PartialConfiguration ChocoConfig
{
Description = "ChocoConfig"
ConfigurationSource = @("[ConfigurationRepositoryWeb]DSCConfigurationServer")
DependsOn = "[PartialConfiguration]DemoConfig"
}
}
}
$configParams = @{
AllNodes = @(
@{
NodeName = 'localhost'
configserver = $ConfigurationServerUrl
configserverKey = $ConfigurationServerKey
}
)
}
PullClientConfiguration -ConfigurationData $configParams
这是server' Local Configuration Manager的图片,与client' Local Configuration Manager相似。
该配置已应用于客户端,但我不再能够从服务器执行拉取。这是一个很难解释的问题,因为有关Web上类似主题的信息量非常有限。此外,这不是WMF 5.0 / WMF 5.1兼容性问题,因为我在域控制器上安装了版本5.1.14409,在客户端上安装了版本5.1.19041。最后,我还相应地配置了IIS 8.5。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)