Skip to content

Commit 9acf07b

Browse files
committed
update docs... still needs work
1 parent 3ff1f0f commit 9acf07b

File tree

2 files changed

+147
-27
lines changed

2 files changed

+147
-27
lines changed

docs/en-US/Get-ADEffectiveAccess.md

Lines changed: 141 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,34 @@ schema: 2.0.0
1313

1414
## SYNTAX
1515

16+
### Identity (Default)
17+
18+
```powershell
19+
Get-ADEffectiveAccess
20+
-Identity <String>
21+
[-Audit]
22+
[-IncludeDeletedObjects]
23+
[-Credential <PSCredential>]
24+
[-Server <String>]
25+
[-AuthenticationTypes <AuthenticationTypes>]
26+
[<CommonParameters>]
27+
```
28+
29+
### Filter
30+
1631
```powershell
17-
Get-ADEffectiveAccess [[-LdapFilter] <String>] [-Audit] [-Top <Int32>] [-IncludeDeletedObjects]
18-
[-SearchScope <SearchScope>] [-Credential <PSCredential>] [-Server <String>]
19-
[-ProgressAction <ActionPreference>] [<CommonParameters>]
32+
Get-ADEffectiveAccess
33+
[[-LdapFilter] <String>]
34+
[-Audit]
35+
[-Top <Int32>]
36+
[-IncludeDeletedObjects]
37+
[-SearchScope <SearchScope>]
38+
[-SearchBase <String>]
39+
[-Credential <PSCredential>]
40+
[-Server <String>]
41+
[-PageSize <Int32>]
42+
[-AuthenticationTypes <AuthenticationTypes>]
43+
[<CommonParameters>]
2044
```
2145

2246
## DESCRIPTION
@@ -27,7 +51,7 @@ Get-ADEffectiveAccess [[-LdapFilter] <String>] [-Audit] [-Top <Int32>] [-Include
2751

2852
### Example 1
2953

30-
```powershell
54+
```
3155
PS C:\> {{ Add example code here }}
3256
```
3357

@@ -37,7 +61,7 @@ PS C:\> {{ Add example code here }}
3761

3862
### -Audit
3963

40-
{{ Fill Audit Description }}
64+
Use this switch to include audit rules for the security descriptor from the system access control list (SACL).
4165

4266
```yaml
4367
Type: SwitchParameter
@@ -46,14 +70,16 @@ Aliases:
4670

4771
Required: False
4872
Position: Named
49-
Default value: None
73+
Default value: False
5074
Accept pipeline input: False
5175
Accept wildcard characters: False
5276
```
5377
5478
### -Credential
5579
56-
{{ Fill Credential Description }}
80+
Specifies a user account that has permission to perform this action. The default is the current user.
81+
82+
Type a user name, such as `User01` or `myDomain\User01`, or enter a [`PSCredential`](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential) object generated by the [`Get-Credential` cmdlet](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential). If you type a user name, you're prompted to enter the password.
5783

5884
```yaml
5985
Type: PSCredential
@@ -69,7 +95,9 @@ Accept wildcard characters: False
6995

7096
### -IncludeDeletedObjects
7197

72-
{{ Fill IncludeDeletedObjects Description }}
98+
Use this switch to include deleted objects in your search. This switch is also required when getting the ACL for a deleted Identity.
99+
100+
For more details, see [`DirectorySearcher.Tombstone` Property](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.directorysearcher.tombstone#system-directoryservices-directorysearcher-tombstone).
73101

74102
```yaml
75103
Type: SwitchParameter
@@ -78,18 +106,20 @@ Aliases:
78106
79107
Required: False
80108
Position: Named
81-
Default value: None
109+
Default value: False
82110
Accept pipeline input: False
83111
Accept wildcard characters: False
84112
```
85113

86114
### -LdapFilter
87115

88-
{{ Fill LdapFilter Description }}
116+
Specifies an LDAP query string that is used to filter Active Directory objects you want to get the ACL from.
117+
118+
For more details, see the [__Remarks__ section from `DirectorySearcher.Filter`](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.directorysearcher.filter#remarks).
89119

90120
```yaml
91121
Type: String
92-
Parameter Sets: (All)
122+
Parameter Sets: Filter
93123
Aliases:
94124
95125
Required: False
@@ -101,24 +131,44 @@ Accept wildcard characters: False
101131

102132
### -SearchScope
103133

104-
{{ Fill SearchScope Description }}
134+
Specifies the scope of an Active Directory search. The acceptable values for this parameter are:
135+
136+
- `Base` or `0` - Searches only the current path or object
137+
- `OneLevel` or `1` - Searches the immediate children of that path or object
138+
- `Subtree` or `2` - Searches the current path or object and all children of that path or object
105139

106140
```yaml
107141
Type: SearchScope
108-
Parameter Sets: (All)
142+
Parameter Sets: Filter
109143
Aliases:
110144
Accepted values: Base, OneLevel, Subtree
111145
112146
Required: False
113147
Position: Named
114-
Default value: None
148+
Default value: Subtree
115149
Accept pipeline input: False
116150
Accept wildcard characters: False
117151
```
118152

119153
### -Server
120154

121-
{{ Fill Server Description }}
155+
Specifies the AD DS instance to connect to by providing one of the following values for a corresponding domain name or directory server.
156+
157+
Domain name values:
158+
159+
- Fully qualified domain name
160+
- NetBIOS name
161+
162+
Directory server values:
163+
164+
- Fully qualified directory server name
165+
- NetBIOS name
166+
- Fully qualified directory server name and port
167+
168+
> [!TIP]
169+
>
170+
> - You can use `GC://` prefix to search in the Global Catalog, e.g.: `-Server GC://myChildDomain`.
171+
> - Including the port to use with your query is valid using the syntax `<HOST>:<PORT>`, e.g.: `-Server myDC01:636`.
122172

123173
```yaml
124174
Type: String
@@ -134,28 +184,93 @@ Accept wildcard characters: False
134184

135185
### -Top
136186

137-
{{ Fill Top Description }}
187+
The maximum number of objects you want to get the ACL from. The default value is `0`, meaning that the maximum number of object you will be getting the ACL from is determined by your LDAP filter or lack of it (all objects).
188+
189+
See also [`DirectorySearcher.SizeLimit` Property](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.directorysearcher.sizelimit#system-directoryservices-directorysearcher-sizelimit).
138190

139191
```yaml
140192
Type: Int32
193+
Parameter Sets: Filter
194+
Aliases:
195+
196+
Required: False
197+
Position: Named
198+
Default value: 0
199+
Accept pipeline input: False
200+
Accept wildcard characters: False
201+
```
202+
203+
### -AuthenticationTypes
204+
205+
Specifies the authentication method to use. The default value is `Secure`.
206+
207+
> [!NOTE]
208+
>
209+
> [`AuthenticationTypes`](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.authenticationtypes) is a Flags Enum, meaning that you can combine values, for example `-AuthenticationTypes 'Secure, FastBind'` is valid.
210+
211+
```yaml
212+
Type: AuthenticationTypes
141213
Parameter Sets: (All)
142214
Aliases:
143215
144216
Required: False
145217
Position: Named
218+
Default value: Secure
219+
Accept pipeline input: False
220+
Accept wildcard characters: False
221+
```
222+
223+
### -Identity
224+
225+
Specifies an Active Directory object by providing one of the following property values. The identifier in parentheses is the LDAP display name for the attribute.
226+
227+
- A DistinguishedName
228+
- A GUID (`objectGuid`)
229+
- A SID (`objectSid`)
230+
- A sAMAccountName
231+
232+
> [!TIP]
233+
>
234+
> This parameter takes pipeline input. You can pipe the output from [ActiveDirectory cmdlets](https://learn.microsoft.com/en-us/powershell/module/activedirectory) to this parameter whenever the output has an `objectGuid` or a `DistinguishedName` property.
235+
236+
```yaml
237+
Type: String
238+
Parameter Sets: Identity
239+
Aliases:
240+
241+
Required: True
242+
Position: Named
146243
Default value: None
244+
Accept pipeline input: True (ByPropertyName, ByValue)
245+
Accept wildcard characters: False
246+
```
247+
248+
### -PageSize
249+
250+
Determines the maximum number of objects the server can return in a paged search. The default is `1000`.
251+
252+
See also [`DirectorySearcher.PageSize` Property](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.directorysearcher.pagesize) for more details.
253+
254+
```yaml
255+
Type: Int32
256+
Parameter Sets: Filter
257+
Aliases:
258+
259+
Required: False
260+
Position: Named
261+
Default value: 1000
147262
Accept pipeline input: False
148263
Accept wildcard characters: False
149264
```
150265

151-
### -ProgressAction
266+
### -SearchBase
152267

153-
{{ Fill ProgressAction Description }}
268+
Specifies the `DistinguishedName` of an Organization Unit or Container as the base for your search.
154269

155270
```yaml
156-
Type: ActionPreference
157-
Parameter Sets: (All)
158-
Aliases: proga
271+
Type: String
272+
Parameter Sets: Filter
273+
Aliases:
159274
160275
Required: False
161276
Position: Named
@@ -166,15 +281,17 @@ Accept wildcard characters: False
166281

167282
### CommonParameters
168283

169-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
284+
This cmdlet supports the common parameters. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
170285

171286
## INPUTS
172287

173-
### None
288+
### System.String
174289

175290
## OUTPUTS
176291

177-
### System.Object
292+
### ADEffectiveAccess.EffectiveAccessRule
293+
294+
### ADEffectiveAccess.EffectiveAuditRule
178295

179296
## NOTES
180297

src/ADEffectiveAccess/DirectoryEntryBuilder.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ internal DirectoryEntry Create(string? server = null, string? searchBase = null)
3939
string? path = (server, searchBase) switch
4040
{
4141
(null, null) => null,
42-
(not null, null) => $"LDAP://{server}",
43-
(null, not null) => $"LDAP://{searchBase}",
44-
_ => $"LDAP://{server}/{searchBase}"
42+
(not null, null) => server,
43+
(null, not null) => searchBase,
44+
_ => $"{server}/{searchBase}"
4545
};
4646

47+
if (path is not null && !path.Contains("://"))
48+
path = $"LDAP://{path}";
49+
4750
return new DirectoryEntry(path, _username, _password, _authenticationTypes);
4851
}
4952

0 commit comments

Comments
 (0)