Skip to content

Commit 6a3b7d7

Browse files
committed
Updated cmdlet & parameters
1 parent da96ad6 commit 6a3b7d7

File tree

5 files changed

+1287
-0
lines changed

5 files changed

+1287
-0
lines changed
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
---
2+
description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
3+
external help file: SmbClientAccessToServer.cdxml-help.xml
4+
Module Name: SmbShare
5+
ms.date: 02/22/2024
6+
online version: https://learn.microsoft.com/powershell/module/smbshare/block-smbclientaccesstoserver?view=windowsserver2025-ps&wt.mc_id=ps-gethelp
7+
schema: 2.0.0
8+
title: Block-SmbClientAccessToServer
9+
---
10+
11+
# Block-SmbClientAccessToServer
12+
13+
## SYNOPSIS
14+
Blocks SMB client access to a specified server.
15+
16+
## SYNTAX
17+
18+
```
19+
Block-SmbClientAccessToServer [-Name] <String[]> -IdentifierType <IdentifierType>
20+
-Identifier <String> [-Description <String>] [-Force] [-CimSession <CimSession[]>]
21+
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
22+
```
23+
24+
```
25+
Block-SmbClientAccessToServer -InputObject <CimInstance[]> -IdentifierType <IdentifierType>
26+
-Identifier <String> [-Description <String>] [-Force] [-CimSession <CimSession[]>]
27+
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
28+
```
29+
30+
## DESCRIPTION
31+
32+
The `Block-SmbClientAccessToServer` cmdlet is used to prevent SMB clients from accessing a
33+
specified server. When you run this cmdlet, all SMB client connections to the specified server will
34+
be terminated, and no new connections will be allowed until the block is lifted. To unblock access
35+
to the server, use the `Unblock-SmbClientAccessToServer` cmdlet.
36+
37+
## EXAMPLES
38+
39+
### Example 1: Block SMB client access to a server
40+
41+
```powershell
42+
$params = @{
43+
Name = "Server01"
44+
IdentifierType = "ISSUER"
45+
Identifier = "CN=MyCertificateIssuer"
46+
Force = $true
47+
}
48+
Block-SmbClientAccessToServer @params
49+
```
50+
51+
This command blocks SMB client access to a server named "Server01" for the based on the client's
52+
certificate. This command runs without prompting for confirmation as the `-Force` parameter is set
53+
to `$true`.
54+
55+
## PARAMETERS
56+
57+
### -AsJob
58+
59+
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to
60+
complete.
61+
62+
```yaml
63+
Type: SwitchParameter
64+
Parameter Sets: (All)
65+
Aliases:
66+
67+
Required: False
68+
Position: Named
69+
Default value: None
70+
Accept pipeline input: False
71+
Accept wildcard characters: False
72+
```
73+
74+
### -CimSession
75+
76+
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session
77+
object, such as the output of a [New-CimSession](/powershell/module/cimcmdlets/new-cimsession) or
78+
[Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the
79+
current session on the local computer.
80+
81+
```yaml
82+
Type: CimSession[]
83+
Parameter Sets: (All)
84+
Aliases: Session
85+
86+
Required: False
87+
Position: Named
88+
Default value: None
89+
Accept pipeline input: False
90+
Accept wildcard characters: False
91+
```
92+
93+
### -Confirm
94+
95+
Prompts you for confirmation before running the cmdlet.
96+
97+
```yaml
98+
Type: SwitchParameter
99+
Parameter Sets: (All)
100+
Aliases: cf
101+
102+
Required: False
103+
Position: Named
104+
Default value: False
105+
Accept pipeline input: False
106+
Accept wildcard characters: False
107+
```
108+
109+
### -Description
110+
111+
Used to provide a description of the rule being added to the server's firewall when you use the
112+
`Block-SmbClientAccessToServer` cmdlet. This can be useful if you need to keep track of why SMB
113+
client access to a server has been blocked, or if you need to provide additional information about
114+
the block for documentation purposes.
115+
116+
```yaml
117+
Type: String
118+
Parameter Sets: (All)
119+
Aliases:
120+
121+
Required: False
122+
Position: Named
123+
Default value: None
124+
Accept pipeline input: False
125+
Accept wildcard characters: False
126+
```
127+
128+
### -Force
129+
130+
Forces the command to run without asking for user confirmation.
131+
132+
```yaml
133+
Type: SwitchParameter
134+
Parameter Sets: (All)
135+
Aliases:
136+
137+
Required: False
138+
Position: Named
139+
Default value: None
140+
Accept pipeline input: False
141+
Accept wildcard characters: False
142+
```
143+
144+
### -Identifier
145+
146+
Specifies the identity of the client that is being granted access to the SMB server. This parameter
147+
takes a string value that represents the identity of the client. The format of the string value
148+
will depend on the `-IdentifierType` parameter that you're using.
149+
150+
```yaml
151+
Type: String
152+
Parameter Sets: (All)
153+
Aliases:
154+
155+
Required: True
156+
Position: Named
157+
Default value: None
158+
Accept pipeline input: False
159+
Accept wildcard characters: False
160+
```
161+
162+
### -IdentifierType
163+
164+
Specifies the type of identifier that you're using to identify a client. The valid values for the
165+
`-IdentifierType` parameter are:
166+
167+
- SHA256
168+
- ISSUER
169+
170+
If you're using the `SHA256` identifier type, you're specifying a hash value that uniquely
171+
identifies the client. If you're using the `ISSUER` identifier type, you're specifying the issuer
172+
of the client's certificate.
173+
174+
```yaml
175+
Type: IdentifierType
176+
Parameter Sets: (All)
177+
Aliases:
178+
Accepted values: SHA256, ISSUER
179+
180+
Required: True
181+
Position: Named
182+
Default value: None
183+
Accept pipeline input: False
184+
Accept wildcard characters: False
185+
```
186+
187+
### -InputObject
188+
189+
Specifies the input object that's used in a pipeline command.
190+
191+
```yaml
192+
Type: CimInstance[]
193+
Parameter Sets: InputObject
194+
Aliases:
195+
196+
Required: True
197+
Position: Named
198+
Default value: None
199+
Accept pipeline input: True (ByValue)
200+
Accept wildcard characters: False
201+
```
202+
203+
### -Name
204+
205+
Specifies a fully-qualified DNS name or NetBIOS name that must match the certificate's subject name
206+
or an entry in the certificate's subject alternative names.
207+
208+
```yaml
209+
Type: String[]
210+
Parameter Sets: (All)
211+
Aliases:
212+
213+
Required: True
214+
Position: 1
215+
Default value: None
216+
Accept pipeline input: True (ByPropertyName)
217+
Accept wildcard characters: False
218+
```
219+
220+
### -ThrottleLimit
221+
222+
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If
223+
this parameter is omitted or a value of `0` is entered, then Windows PowerShell calculates an
224+
optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the
225+
computer.
226+
227+
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
228+
229+
```yaml
230+
Type: Int32
231+
Parameter Sets: (All)
232+
Aliases:
233+
234+
Required: False
235+
Position: Named
236+
Default value: None
237+
Accept pipeline input: False
238+
Accept wildcard characters: False
239+
```
240+
241+
### -WhatIf
242+
243+
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
244+
245+
```yaml
246+
Type: SwitchParameter
247+
Parameter Sets: (All)
248+
Aliases: wi
249+
250+
Required: False
251+
Position: Named
252+
Default value: False
253+
Accept pipeline input: False
254+
Accept wildcard characters: False
255+
```
256+
257+
### CommonParameters
258+
259+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
260+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
261+
-WarningAction, and -WarningVariable. For more information, see
262+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
263+
264+
## INPUTS
265+
266+
### System.String[]
267+
268+
### Microsoft.Management.Infrastructure.CimInstance[]
269+
270+
## OUTPUTS
271+
272+
### Microsoft.Management.Infrastructure.CimInstance[]
273+
274+
## NOTES
275+
276+
## RELATED LINKS
277+
278+
[Get-SmbClientAccessToServer](./Get-SmbClientAccessToServer.md)
279+
280+
[Grant-SmbClientAccessToServer](./Grant-SmbClientAccessToServer.md)
281+
282+
[Revoke-SmbClientAccessToServer](./Revoke-SmbClientAccessToServer.md)
283+
284+
[Unblock-SmbClientAccessToServer](./Unblock-SmbClientAccessToServer.md)

0 commit comments

Comments
 (0)