Skip to content

Commit d399fe3

Browse files
committed
Init No RSAT
1 parent 5d798f7 commit d399fe3

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function Get-DomainController {
2+
[CmdletBinding()]
3+
param (
4+
5+
)
6+
7+
begin {
8+
$AllDomainControllers = New-Object -TypeName System.Collections.Generic.List[System.DirectoryServices.ActiveDirectory.DomainController]
9+
} # end begin
10+
11+
process {
12+
$Context = [System.DirectoryServices.ActiveDirectory.DirectoryContext]::New([System.DirectoryServices.ActiveDirectory.DirectoryContextType]::Domain)
13+
$Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetDomain($Context)
14+
15+
foreach ($dc in $Domain.DomainControllers) {
16+
$AllDomainControllers.Add($dc)
17+
}
18+
} # end process
19+
20+
end {
21+
$AllDomainControllers
22+
} # end end
23+
} # end function Get-DomainController
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
File renamed without changes.

Active Directory/No-RSAT/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# No RSAT
2+
3+
This is the early beginnings of scripts that I think will become a module called "No RSAT." It will do what it says on the tin: "get information from Active Directory without depending on the ActiveDirectory module."

0 commit comments

Comments
 (0)