Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. Configuration MyWebsite
  2. {
  3. Import-DscResource -ModuleName xWebAdministration
  4.  
  5. Node Webserver
  6. {
  7. WindowsFeature IIS
  8. {
  9. Ensure="Present"
  10. Name="Web-Server"
  11. }
  12. WindowsFeature Mgmt-Tools
  13. {
  14. Ensure = "Present"
  15. Name = "Web-Mgmt-Tools"
  16. }
  17. WindowsFeature Mgmt-Console
  18. {
  19. Ensure = "Present"
  20. Name = "Web-Mgmt-Console"
  21. }
  22. WindowsFeature Mgmt-Service
  23. {
  24. Ensure = "Present"
  25. Name = "Web-Mgmt-Service"
  26. }
  27.  
  28. $secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
  29. $cred = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
  30.  
  31. xWebAppPool ApplicationPool
  32. {
  33. Name = "my-application-pool"
  34. AutoStart = $true
  35. ManagedPipelineMode = "Integrated"
  36. ManagedRuntimeVersion = "v4.0"
  37. IdentityType = "SpecificUser"
  38. Credential = $cred
  39. Enable32BitAppOnWin64 = $false
  40.  
  41. }
  42. }
  43. }
  44.  
  45. $ConfigurationData = @{
  46. AllNodes = @(
  47. @{
  48. NodeName = "Webserver"
  49. PSDscAllowPlainTextPassword = $true
  50. PSDscAllowDomainUser = $true
  51. }
  52. )
  53. }
  54.  
  55. MyWebsite -ConfigurationData $ConfigurationData
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement