AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[dsc](server)

Martin Hope
neo
Asked: 2019-10-09 06:12:28 +0800 CST

使用 Windows DSC 进行 SSL 证书管理

  • 0

我有一个第三方颁发的证书,我需要确保它在给定域中的所有目标上运行。有没有办法确保通过 DSC 安装此证书?

dsc
  • 1 个回答
  • 84 Views
Martin Hope
Eric
Asked: 2017-03-07 07:57:52 +0800 CST

DSC 环境资源在 WMF5.1 之后不再工作 - 未检测到 PATH 值?

  • 4

我有许多使用环境资源设置路径值的部分 DSC 脚本。我有两个执行此操作的脚本,从 WMF5.0 升级到 WMF5.1 后,启动 DscConfigurations 时出现以下错误。

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer MYCOMPUTER with user sid S-1-5-21-1064954374-356710528-937385128-34335.
VERBOSE: [DESTCOMPUTER]:                            [] Starting consistency engine.
The resources ('[Environment]SetInstantClientPath' and '[Environment]SqlCmdPath') have conflicting values of the following properties: 'Value'. Ensure that their values match.  Merging of partial configurations failed. LCM 
failed to start desired state configuration manually.
    + CategoryInfo          : ResourceExists: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 11
    + PSComputerName        : DESTCOMPUTER

一个脚本执行此操作:

Environment SqlCmdPath {
    Name = "Path"
    DependsOn = "[Package]InstallSQLServer2012CmdLineUtils_64bit"
    Ensure = "Present"
    Path = $true
    Value = "$env:ProgramFiles\Microsoft SQL Server\110\Tools\Binn"
}

另一个脚本执行此操作:

Environment SetInstantClientPath {
    Name = "Path"
    DependsOn = "[Archive]InstallInstantClientBasic","[Archive]InstallInstantClientSqlplus"
    Ensure = "Present"
    Path = $true
    Value = "$env:SystemDrive\instantclient_11_2"
}

这曾经从 WMF5.0 愉快地运行

自 WMF5.1 以来有什么变化吗?

powershell dsc
  • 1 个回答
  • 583 Views
Martin Hope
Mark Allison
Asked: 2016-12-07 11:13:06 +0800 CST

如何使用 Powershell DSC 和模块 xHyper-V 创建 Hyper-V VM?

  • 2

我一直在尝试使用模块xHyper-V从我的 Windows 10 工作站在我的 Hyper-V 2016 主机上创建一个虚拟机,但并没有太多乐趣。

我的 Hyper-V 主机名为 Lithium,我的 DSC 脚本如下。

Configuration EndToEndXHyperV_RunningVM
{
    param
    (
        [string[]]$NodeName = 'lithium',

        [Parameter(Mandatory)]
        [string]$VMName,

        [Parameter(Mandatory)] 
        [string]$StartupMemory,

        [Parameter(Mandatory)]
        [string]$MinimumMemory,

        [Parameter(Mandatory)]
        [string]$MaximumMemory,

        [Parameter(Mandatory)]
        [String]$SwitchName,

        [Parameter(Mandatory)]
        [Uint32]$ProcessorCount,

        [ValidateSet('Off','Paused','Running')]
        [String]$State = 'Off',

        [Switch]$WaitForIP
    )

    Import-DscResource –ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -module xHyper-V

    Node $NodeName
    {
        $NewSystemVHDPath = "\\lithium\VHDs-SSD\$($VMName)-System.vhdx"

        # Copy VHD File - hard coded to Windows 2016 Core Eval for now
        File SystemDisk {
            SourcePath = "\\lithium\Templates\Windows 2016 Core Template\System.vhdx"
            DestinationPath = $NewSystemVHDPath      
            Type = "File"
            Ensure = "Present"
        }

        # create the generation 2 testVM out of the vhd.
        xVMHyperV NewVM
        {
            Ensure          = 'Present'
            Name            = $VMName
            VhdPath         = $NewSystemVHDPath
            SwitchName      = $SwitchName
            State           = $State
            Path            = $Path
            Generation      = 2
            StartupMemory   = $StartupMemory
            MinimumMemory   = $MinimumMemory
            MaximumMemory   = $MaximumMemory
            ProcessorCount  = $ProcessorCount
            RestartIfNeeded = $true
            WaitForIP       = $WaitForIP 
            DependsOn       = "[File]SystemDisk"
        }
    }
}

我已授予机器帐户对共享的访问权限,并且文件副本工作正常,但添加虚拟硬盘时出现错误。有任何想法吗?

PS C:\Repos\Infrastructure\DSC> Start-DscConfiguration -Path .\EndToEndXHyperV_RunningVM -Wait -Verbose -Force 
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namesp
aceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer COWSLIP with user sid S-1-5-21-1075642099-280362434-2919291742-1105.
VERBOSE: [LITHIUM]: LCM:  [ Start  Set      ]
VERBOSE: [LITHIUM]: LCM:  [ Start  Resource ]  [[File]SystemDisk]
VERBOSE: [LITHIUM]: LCM:  [ Start  Test     ]  [[File]SystemDisk]
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] The system cannot find the file specified.
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] The related file/directory is: \\lithium\VHDs-SSD\test-System.vhdx.
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] Building file list from cache.
VERBOSE: [LITHIUM]: LCM:  [ End    Test     ]  [[File]SystemDisk]  in 0.0510 seconds.
VERBOSE: [LITHIUM]: LCM:  [ Start  Set      ]  [[File]SystemDisk]
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] The system cannot find the file specified.
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] The related file/directory is: \\lithium\VHDs-SSD\test-System.vhdx.
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] Building file list from cache.
VERBOSE: [LITHIUM]:                            [[File]SystemDisk] Copying file \\lithium\Templates\Windows 2016 Core Template\System.vhdx to \\lithium\VHDs-SSD\test-Sy
stem.vhdx.
VERBOSE: [LITHIUM]: LCM:  [ End    Set      ]  [[File]SystemDisk]  in 17.2540 seconds.
VERBOSE: [LITHIUM]: LCM:  [ End    Resource ]  [[File]SystemDisk]
VERBOSE: [LITHIUM]: LCM:  [ Start  Resource ]  [[xVMHyperV]NewVM]
VERBOSE: [LITHIUM]: LCM:  [ Start  Test     ]  [[xVMHyperV]NewVM]
VERBOSE: [LITHIUM]: LCM:  [ End    Test     ]  [[xVMHyperV]NewVM]  in 1.0200 seconds.
VERBOSE: [LITHIUM]: LCM:  [ Start  Set      ]  [[xVMHyperV]NewVM]
VERBOSE: [LITHIUM]:                            [[xVMHyperV]NewVM] Checking if VM 'test' exists ...
VERBOSE: [LITHIUM]:                            [[xVMHyperV]NewVM] VM 'test' does not exist.
VERBOSE: [LITHIUM]:                            [[xVMHyperV]NewVM] Creating VM 'test' ...
Failed to add device 'Virtual Hard Disk'.
The Machine Account 'DUCK\LITHIUM$' or the user initiating the VM management operation or both do not have the required access to the file share 
'\\lithium\VHDs-SSD\test-System.vhdx'.  Please ensure that the computer machine account and the user initiating the VM management operation have full access to the 
file share as well as the file system folder backing the file share.  Error: 'General access denied error'
'test' failed to add device 'Virtual Hard Disk'. (Virtual machine ID 4DE01C38-E027-4366-B56A-85B527BB34CB)
'test': The Machine Account 'DUCK\LITHIUM$' or the user initiating the VM management operation or both do not have the required access to the file share 
'\\lithium\VHDs-SSD\test-System.vhdx'.  Please ensure that the computer machine account and the user initiating the VM management operation have full access to the 
file share as well as the file system folder backing the file share.  Error: 'General access denied error' (0x80070005). (Virtual machine ID 
4DE01C38-E027-4366-B56A-85B527BB34CB)
    + CategoryInfo          : PermissionDenied: (:) [], CimException
    + FullyQualifiedErrorId : AccessDenied,Microsoft.HyperV.PowerShell.Commands.NewVM
    + PSComputerName        : lithium
powershell hyper-v dsc
  • 1 个回答
  • 1341 Views
Martin Hope
Black Dynamite
Asked: 2016-10-07 12:48:11 +0800 CST

Powershell DSC - 信息 1625。系统策略禁止此安装

  • 2

我正在使用 Powershell Desired State Configuration 来设置服务器。服务器需要安装 SQL 客户端 msi。作为登录用户,我可以单击 msi,然后毫无问题地安装它。但是,当我尝试通过 PowerShelll 安装它时

C:\Windows\system32\msiexec.exe /i "C:\Users\Djad\Desktop\sqlncli.msi" /quiet /log C:\Users\Djad\Desktop\sqllog.txt

我收到以下错误。

MSI (s) (A4:4C) [22:43:59:356]: Product: Microsoft SQL Server 2012 Native Client  -- Installation failed.
MSI (s) (A4:4C) [22:43:59:372]: Windows Installer installed the product. Product Name: Microsoft SQL Server 2012 Native Client. Product Version: 11.0.2100.60.    Product Language: 1033. Manufacturer: Microsoft Corporation. Installation   success or error status: 1625.

Info 1625. This installation is forbidden by system policy. Contact your system administrator.
C:\Users\Djad\Desktop\sqlncli.msi

我不确定为什么策略会阻止 powershell 运行,但仍然允许我单击它来运行它。有谁知道挂断可能是什么?任何帮助是极大的赞赏。

sql powershell dsc
  • 1 个回答
  • 686 Views
Martin Hope
Black Dynamite
Asked: 2016-10-05 07:15:34 +0800 CST

Powershell DSC:无法获取 http 流

  • 4

我有一个用于配置 Web 服务器的 Powershell DSC。我的服务器将需要 URL Rewrite 模块,所以我从 Github gist 中获得了该代码:

https://gist.github.com/sheastrickland/646c42789ce2df35d5c8

我的问题是当 DSC 遇到我的块时:

    Package UrlRewrite
    {
        #Install URL Rewrite module for IIS
        DependsOn = "[cNtfsPermissionEntry]AppPoolPermissionsSet"
        Ensure = "Present"
        Name = "IIS URL Rewrite Module 2"
        Path = "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
        Arguments = "/quiet"
        ProductId = "EB675D0A-2C95-405B-BEE8-B42A65D23E11"
    }

它会引发以下错误:

PowerShell DSC resource MSFT_PackageResource  failed to execute Set-  
TargetResource functionality with error message: Could not get the http    
stream for file http://download.microsoft.com/download/6/7/D/67D80164-7DD0-
48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi 

起初我以为我的服务器可能有错误的代理设置,所以我检查了是否可以使用以下语句下载文件:

wget http://download.microsoft.com/download/6/7/D/
67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi 
-OutFile "C:\Users\Dald\Desktop\Mizzy.msi"

瞧,该文件出现在桌面上,按预期显示为 6,12 MB。

所以我很茫然,为什么我的 DSC 无法获取 http 流?我以管理员身份运行它,所以所有功能都应该可用,但也许我忘了设置一些东西。

任何帮助是极大的赞赏。

windows powershell dsc
  • 1 个回答
  • 422 Views
Martin Hope
kettch
Asked: 2016-07-09 09:44:08 +0800 CST

如何在 xWebApplication DSC 资源中使用 AuthenticationInfo

  • 4

我的 DSC 配置中有以下内容:

        xWebApplication StaffDirectoryApp {
            Website = "MySite"
            Name = "MyApp"
            WebAppPool = "MyPool"
            PhysicalPath = $Destination
            Ensure = "Present"
            PreloadEnabled = $true
        }

这似乎工作正常,但我也想使用 AuthenticationInfo 属性(尽管文档似乎说它应该是 AuthenticationInformation,但不是)。

我能找到的唯一示例是在 GitHub 上的一个单元测试中,它们的用法是这样的:

AuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation `
                        -ClientOnly `
                        -Property @{ Anonymous = $false; Basic = $false; Digest = $false; Windows = $true }

但是,这会产生以下结果:

Convert property 'AuthenticationInfo' value from type 'STRING' to type 'INSTANCE' failed

我应该如何设置这个属性?

powershell dsc
  • 1 个回答
  • 606 Views
Martin Hope
Juris Krumins
Asked: 2015-10-14 01:05:20 +0800 CST

从作为 ServerManager.DeploymentProvider.dll 一部分的 WMI 提供程序“deploymentprovider”观察到高 CPU 使用率

  • 2

我正在使用 powerShell Desired State Configuration 在服务器机器上测试/设置 Windows 功能。我拥有的是 78 个 WindowsFeature 资源,如果需要,可以检查和安装。我观察到的是在 LCM(本地配置管理器)执行和检查配置时 CPU 使用率很高。我进行了一些调查,发现 WMI 提供程序“deploymentprovider”是负责 WindowsFeature 资源的 ServerManager.DeploymentProvider.dll 的一部分。所以问题是,有没有人经历过这个问题并以某种方式解决了它?

提前致谢。

dsc
  • 2 个回答
  • 280 Views
Martin Hope
Brettski
Asked: 2014-04-16 10:05:44 +0800 CST

当服务器与 DSC 配置不同步时,有没有办法产生差异?

  • 2

以下命令可用于确定系统上是否存在配置偏差:

Test-DscConfiguration –CimSession $session

该命令仅返回 true 或 false。有没有办法检索这些差异的列表?

dsc
  • 1 个回答
  • 197 Views
Martin Hope
Brettski
Asked: 2014-04-16 10:01:10 +0800 CST

可以从当前系统构建创建 PowerShell DSC 配置文件吗?

  • 9

有没有办法从当前系统构建 PowerShell 所需状态配置 (DSC) 配置文件?反对从头开始构建整个文件?

dsc
  • 4 个回答
  • 3335 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve