Repository navigation
Expand file tree
/
Copy pathDisable_CEIP.ps1
More file actions
36 lines (26 loc) · 2.21 KB
/
Copy pathDisable_CEIP.ps1
File metadata and controls
36 lines (26 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#requires -version 2.0
<#
.SYNOPSIS
Disable SQL Server CEIP services
.DESCRIPTION
Author: Eric Cobb
Create date: 2020-02-18
http://www.sqlnuggets.com/blog/disable-telemetry-on-multiple-sql-servers-with-powershell/
.PARAMETER server
Server list where disable SEIP services
#>
$server = 'Server01' ,'Server02','Server03','Server04';
# Stop all CEIP services
invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | ? status -eq "running" | Stop-Service};
# Disable all CEIP services
invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | Set-Service -StartMode Disabled};
# Check service status (should see "stopped" and "disabled"
invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | select -property name,starttype,status};
# Disable "Error Reporting" and "Customer Feedback" Registry Values
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name EnableErrorReporting -Value 0};
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name CustomerFeedback -Value 0};
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name EnableErrorReporting -Value 0};
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name CustomerFeedback -Value 0};
# Check registry values (should see 0 for "EnableErrorReporting" and "CustomerFeedback")
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'};
invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'};