File tree Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Original file line number Diff line number Diff line change 1
1
function Get-WinADForestGUIDs {
2
+ <#
3
+ . SYNOPSIS
4
+ Short description
5
+
6
+ . DESCRIPTION
7
+ Long description
8
+
9
+ . PARAMETER Domain
10
+ Parameter description
11
+
12
+ . PARAMETER RootDSE
13
+ Parameter description
14
+
15
+ . PARAMETER DisplayNameKey
16
+ Parameter description
17
+
18
+ . EXAMPLE
19
+ Get-WinADForestGUIDs
20
+
21
+ . EXAMPLE
22
+ Get-WinADForestGUIDs -DisplayNameKey
23
+
24
+ . NOTES
25
+ General notes
26
+ #>
2
27
[alias (' Get-WinADDomainGUIDs' )]
3
28
[cmdletbinding ()]
4
29
param (
5
30
[string ] $Domain = $Env: USERDNSDOMAIN ,
6
- [Microsoft.ActiveDirectory.Management.ADEntity ] $RootDSE
31
+ [Microsoft.ActiveDirectory.Management.ADEntity ] $RootDSE ,
32
+ [switch ] $DisplayNameKey
7
33
)
8
34
if ($null -eq $RootDSE ) {
9
35
$RootDSE = Get-ADRootDSE - Server $Domain
@@ -17,7 +43,11 @@ function Get-WinADForestGUIDs {
17
43
$GUID.add([System.GUID]$S.schemaIDGUID, $S.name)
18
44
}
19
45
#>
20
- $GUID [" $ ( ([System.GUID ]$S.schemaIDGUID ).Guid) " ] = $S.name
46
+ if ($DisplayNameKey ) {
47
+ $GUID [" $ ( $S.name ) " ] = $ (([System.GUID ]$S.schemaIDGUID ).Guid)
48
+ } else {
49
+ $GUID [" $ ( ([System.GUID ]$S.schemaIDGUID ).Guid) " ] = $S.name
50
+ }
21
51
}
22
52
23
53
@@ -28,7 +58,11 @@ function Get-WinADForestGUIDs {
28
58
$GUID.add([System.GUID]$S.rightsGUID, $S.name)
29
59
}
30
60
#>
31
- $GUID [" $ ( ([System.GUID ]$S.rightsGUID ).Guid) " ] = $S.name
61
+ if ($DisplayNameKey ) {
62
+ $GUID [" $ ( $S.name ) " ] = $ (([System.GUID ]$S.rightsGUID ).Guid)
63
+ } else {
64
+ $GUID [" $ ( ([System.GUID ]$S.rightsGUID ).Guid) " ] = $S.name
65
+ }
32
66
}
33
67
return $GUID
34
68
}
You can’t perform that action at this time.
0 commit comments