Skip to content

Commit 102f28a

Browse files
authored
Update README.md
1 parent 569f956 commit 102f28a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

CIM/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if ($this.Files -gt 8) {$this.Files = 8};
3939
Return $this.Files
4040
```
4141

42-
## (Wmi)
42+
## HideInstance (Wmi)
4343

4444
```powershell
4545
Find-Module SQLServer -RequiredVersion "21.0.17279" | Install-Module -AllowClobber -Force
@@ -56,9 +56,21 @@ $WmiObject = @{
5656
$HideInstance = Get-WmiObject @WmiObject
5757
```
5858

59-
## (Cim)
59+
## HideInstance (Cim)
6060

6161
```powershell
62+
Find-Module SQLServer -RequiredVersion "21.0.17279" | Install-Module -AllowClobber -Force
63+
Import-Module SQLServer
64+
$SQLServer = [Microsoft.SqlServer.Management.Smo.Server]::New("localhost")
65+
66+
## apply surface area configuration control 2.12
67+
$WmiObject = @{
68+
ComputerName = $SQLServer.NetName
69+
Namespace = "root\Microsoft\SqlServer\ComputerManagement$($SQLServer.VersionMajor)"
70+
Class = "ServerSettingsGeneralFlag"
71+
Filter = "FlagName = 'HideInstance'"
72+
}
73+
$HideInstance = Get-CimInstance @WmiObject
6274
```
6375

6476
## GetServiceStartName (Wmi)

0 commit comments

Comments
 (0)