【问题标题】:Partial DSC configuration for SMBSMB 的部分 DSC 配置
【发布时间】:2019-06-04 07:37:57
【问题描述】:

很遗憾,我在 Internet 上找不到任何适用于我的场景的示例。

我有一个带有 SMB 共享的 DSC 服务器。我想部署部分配置,如https://docs.microsoft.com/de-de/powershell/dsc/pull-server/partialconfigs

但只有 HTTP DSC 服务器的示例,而不是 SMB。 SMB DSC 服务器也可以做到这一点吗?如果是这样,我可以举个例子吗?

【问题讨论】:

  • 您能否提供到目前为止您所尝试的详细信息?当我仔细阅读该页面时,我没有看到任何会阻止从基于 SMB 的拉取服务器进行部分配置的内容,因此有关它为什么不适合您的更多详细信息会有所帮助!

标签: powershell dsc


【解决方案1】:

我找到了一个例子:

[DSCLocalConfigurationManager()]
configuration PartialConfig
{
    Node localhost
    {
        Settings
        {
            RefreshMode = 'Pull'
            ConfigurationID = 'a5f86baf-f17f-4778-8944-9cc99ec9f992'
            RebootNodeIfNeeded = $true
        }
           ConfigurationRepositoryShare SMBPull
        {
            SourcePath = '\\Server\Configurations'
            Name = 'SMBPull'
        }
           PartialConfiguration OSConfig
        {
            Description = 'Configuration for the Base OS'
            ConfigurationSource = '[ConfigurationRepositoryShare]SMBPull'
            RefreshMode = 'Pull'
        }
           PartialConfiguration SQLConfig
        {
            Description = 'Configuration for the SQL Server'
            DependsOn = '[PartialConfiguration]OSConfig'
            RefreshMode = 'Push'
        }
    }
}

【讨论】:

    猜你喜欢
    • 2023-03-11
    • 2021-01-20
    • 2020-09-01
    • 2018-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多