Admin tools on View servers
Install admin tools using PowerShell on Windows 2012 serverpull/45/head
parent
90c0964878
commit
f5858dc583
|
@ -23,6 +23,8 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
|
|||
Start-Process schtasks -ArgumentList ' /Change /TN "\Microsoft\Windows\Server Manager\ServerManager" /DISABLE' -Wait -Verb RunAs
|
||||
Write-BuildLog "Disabling screen saver"
|
||||
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
|
||||
Write-BuildLog "Install admin tools"
|
||||
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
|
||||
}
|
||||
$Files = get-childitem "b:\view$viewinstall"
|
||||
for ($i=0; $i -lt $files.Count; $i++) {
|
||||
|
@ -86,7 +88,7 @@ if (([bool]($emailto -as [Net.Mail.MailAddress])) -and ($SmtpServer -ne "none"))
|
|||
$Summary += "The build log is attached`r`n"
|
||||
$mailmessage.Subject = "$env:computername VM build finished"
|
||||
$mailmessage.Body = $Summary
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt", 'text/plain')
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt")
|
||||
$mailmessage.Attachments.Add($attach)
|
||||
$message.Attachments.Add($attach)
|
||||
$SMTPClient.Send($mailmessage)
|
||||
|
|
|
@ -22,6 +22,8 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
|
|||
Start-Process schtasks -ArgumentList ' /Change /TN "\Microsoft\Windows\Server Manager\ServerManager" /DISABLE' -Wait -Verb RunAs
|
||||
Write-BuildLog "Disabling screen saver"
|
||||
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
|
||||
Write-BuildLog "Install admin tools"
|
||||
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
|
||||
}
|
||||
if (Test-Path "C:\VMware-view*") {
|
||||
$Files = get-childitem "C:\"
|
||||
|
@ -91,7 +93,7 @@ if (([bool]($emailto -as [Net.Mail.MailAddress])) -and ($SmtpServer -ne "none"))
|
|||
$Summary += "The build log is attached`r`n"
|
||||
$mailmessage.Subject = "$env:computername VM build finished"
|
||||
$mailmessage.Body = $Summary
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt", 'text/plain')
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt")
|
||||
$mailmessage.Attachments.Add($attach)
|
||||
$message.Attachments.Add($attach)
|
||||
$SMTPClient.Send($mailmessage)
|
||||
|
|
|
@ -453,7 +453,7 @@ if (Test-Path "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe")
|
|||
exit
|
||||
}
|
||||
}
|
||||
If (((([System.Environment]::OSVersion.Version.Major *10) +[System.Environment]::OSVersion.Version.Minor) -le 62)) {
|
||||
If (((([System.Environment]::OSVersion.Version.Major *10) +[System.Environment]::OSVersion.Version.Minor) -le 61)) {
|
||||
Write-BuildLog "Doing Windows Server 2008 specific build actions"
|
||||
if (Test-Path B:\sqlmsssetup.exe) {
|
||||
Rename-Item B:\sqlmsssetup.exe SQLManagementStudio_x64_ENU.exe
|
||||
|
@ -571,7 +571,7 @@ if (($vmtools) -and (-Not (Test-Path "C:\Program Files\VMware\VMware Tools\VMwar
|
|||
$Summary += "The build log is attached`r`n"
|
||||
$mailmessage.Subject = "$env:computername VM build finished"
|
||||
$mailmessage.Body = $Summary
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt", 'text/plain')
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt")
|
||||
$mailmessage.Attachments.Add($attach)
|
||||
$message.Attachments.Add($attach)
|
||||
$SMTPClient.Send($mailmessage)
|
||||
|
|
|
@ -22,6 +22,8 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
|
|||
Start-Process schtasks -ArgumentList ' /Change /TN "\Microsoft\Windows\Server Manager\ServerManager" /DISABLE' -Wait -Verb RunAs
|
||||
Write-BuildLog "Disabling screen saver"
|
||||
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
|
||||
Write-BuildLog "Install admin tools"
|
||||
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
|
||||
}
|
||||
$Files = get-childitem "b:\view$viewinstall"
|
||||
for ($i=0; $i -lt $files.Count; $i++) {
|
||||
|
@ -81,7 +83,7 @@ if (([bool]($emailto -as [Net.Mail.MailAddress])) -and ($SmtpServer -ne "none"))
|
|||
$Summary += "The build log is attached`r`n"
|
||||
$mailmessage.Subject = "$env:computername VM build finished"
|
||||
$mailmessage.Body = $Summary
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt", 'text/plain')
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt")
|
||||
$mailmessage.Attachments.Add($attach)
|
||||
$message.Attachments.Add($attach)
|
||||
$SMTPClient.Send($mailmessage)
|
||||
|
|
|
@ -639,7 +639,7 @@ if (Test-Path B:\VMTools\setup64.exe) {
|
|||
$Summary += "The build log is attached`r`n"
|
||||
$mailmessage.Subject = "$env:computername VM build finished"
|
||||
$mailmessage.Body = $Summary
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt", 'text/plain')
|
||||
$attach = new-object Net.Mail.Attachment("C:\buildlog.txt")
|
||||
$mailmessage.Attachments.Add($attach)
|
||||
$SMTPClient.Send($mailmessage)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue