Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Script : AddWindowsFeatures.ps1
- # Author : Wilco van Bragt
- # Creation Date: 7-7-2011
- # Usage : Add Windows Features for Citrix XenApp 6.5
- #**************************************************************************
- # Date Version Scripter Changes
- #------------------------------------------------------------------------
- # 9:42 7-7-2011 0.1 WvB Intial Version
- #
- #
- #***************************************************************************
- Import-Module ServerManager
- if ((Test-Path -path C:\LOG\AddWindowsFeatures.log) -ne $True) {
- New-Item -ItemType file C:\LOG\AddWindowsFeatures.log
- }
- $file = "C:\LOG\AddWindowsFeatures.log"
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "XPS-Viewer"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature XPS-Viewer -restart -logPath $File
- }
- else {
- add-content -path $file "XPS Viewer already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "SNMP-Services"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature SNMP-Services -restart -logPath $File
- }
- else {
- add-content -path $file "SNMP Services already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "AS-Net-FRAMEWORK"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature AS-Net-FRAMEWORK -restart -logPath $File
- }
- else {
- add-content -path $file "Net Framework already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "GPMC"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature GPMC -restart -logPath $File
- }
- else {
- add-content -path $file "Group Policy Management Viewer already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "RSAT-ADDS-Tools"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature RSAT-ADDS-Tools -restart -logPath $File
- }
- else {
- add-content -path $file "AD Users and Computers already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "Desktop-Experience"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature Desktop-Experience -restart -logPath $File
- }
- else {
- add-content -path $file "Desktop Experience already installed"
- }
- $check = Get-WindowsFeature | Where-Object {$_.Name -eq "RDS-RD-SERVER"}
- If ($check.Installed -ne "True") {
- Add-WindowsFeature RDS-RD-SERVER -restart -logPath $File
- }
- else {
- add-content -path $file "Remote Desktop Session Host already installed"
- }
- New-Item -ItemType file C:\LOG\CHECK\AddWindowsFeatures.CHK
- add-content C:\LOG\ChECK\AddWindowsFeatures.CHK "Windows Features Installed"
- restart-computer
- <# This software / sample code is provided to you “AS IS” with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software / sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software / sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software / sample code. In no event should the software / code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE software / SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the software / code belongs to Citrix, any distribution of the code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code. #>
Advertisement
Add Comment
Please, Sign In to add comment