-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path24_1.ps1
More file actions
18 lines (17 loc) · 706 Bytes
/
24_1.ps1
File metadata and controls
18 lines (17 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function Get-DiskInfo {
foreach ($domain in (Get-ADForest).domains) {
$hosts = Get-ADDomainController -filter * -server $domain |
Sort-Object -Prop hostname
ForEach ($h in $hosts) {
$cs = Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName $h
$props = @{'ComputerName' = $h
'DomainController' = $h
'Manufacturer' = $cs.manufacturer
'Model' = $cs.model
'TotalPhysicalMemory(GB)'=$cs.totalphysicalmemory / 1GB
}
New-Object -Type PSObject -Prop $props
} #foreach $h
} #foreach $domain
} #function
Export-ModuleMember -function Get-DiskInfo