目前我们正尝试使用PowerShell DSC(WMF5.0)和xWebAdminstration(v1.15)模块来设置应用程序池。 到目前为止,我们已经设法使用https://msdn.microsoft.com/en-us/powershell/dsc/pullserver中的指令成功地使客户机节点和服务器一起工作。 使用下面的脚本客户端节点安装IIS成功,但应用程序池没有被创build,这是问题所在。
Configuration MyWebsite { Import-DscResource -ModuleName xWebAdministration Node Webserver { WindowsFeature IIS { Ensure="Present" Name="Web-Server" } WindowsFeature Mgmt-Tools { Ensure = "Present" Name = "Web-Mgmt-Tools" } WindowsFeature Mgmt-Console { Ensure = "Present" Name = "Web-Mgmt-Console" } WindowsFeature Mgmt-Service { Ensure = "Present" Name = "Web-Mgmt-Service" } $secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ("username", $secpasswd) xWebAppPool ApplicationPool { Name = "my-application-pool" AutoStart = $true ManagedPipelineMode = "Integrated" ManagedRuntimeVersion = "v4.0" IdentityType = "SpecificUser" Credential = $cred Enable32BitAppOnWin64 = $false } } } $ConfigurationData = @{ AllNodes = @( @{ NodeName = "Webserver" PSDscAllowPlainTextPassword = $true PSDscAllowDomainUser = $true } ) } MyWebsite -ConfigurationData $ConfigurationData
应用程序池的创build取决于一个名为xWebAdministration的模块。 我们期望这个模块在MOF文件的执行过程中会被客户端节点下载 – 这是正确的吗? 此外,这个模块的.zip文件可以在modules目录下的pull服务器上使用校验和文件。
拉服务器的事件日志不显示任何错误。 客户端节点事件日志也没有错误条目。 客户端成功发送报告给拉服务器。
你可能有什么build议,我们可能会失踪?
您还需要一些机制来推动DSC模块,下面的文章可能会帮助你。
vcloud-lab.com/entries/desired-state-configuration/powershell-finding-powershell-dsc-module-and-downloading-it-2