-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path24_5.ps1
More file actions
20 lines (19 loc) · 800 Bytes
/
24_5.ps1
File metadata and controls
20 lines (19 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 $host
$props = @{'ComputerName' = $h
'DomainController' = $h
'Manufacturer' = $cs.manufacturer
'Model' = $cs.model
'TotalPhysicalMemory'=$cs.totalphysicalmemory / 1GB
}
$obj = New-Object -Type PSObject -Prop $props
$obj.psobject.typenames.insert(0,'Toolmaking.DiskInfo')
Write-Output $obj
} #foreach $h
} #foreach $domain
} #function
Export-ModuleMember -function Get-DiskInfo