-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomputersconfig.ps1
81 lines (43 loc) · 2.79 KB
/
computersconfig.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# http://technet.microsoft.com/library/ee156542.aspx
$a = Get-Content $args[0]#.Length
foreach ($i in $a)
{
$hostn = Get-WmiObject win32_computersystem -computername $i
Write-Host "HOST:" $hostn.name
$hn = $hostn.name
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Force -InputObject $("HOST: " + $hostn.name)
$os = get-wmiobject win32_operatingsystem -computername $i
$win = $os.caption -replace "Microsoft "
Write-Host "OS:" $win
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("OS: " + $win)
$mb = get-wmiobject win32_baseboard -computername $i
$installdate = ([WMI]'').ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate)
Write-Host "Install Date:" $installdate
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("Install Date: " + $installdate)
Write-Host "MB:" $mb.product
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("MB: " + $mb.product)
$processor = get-wmiobject win32_processor -computername $i
# if ($processor.name -like "Intel(R) Core(TM) ") {$processor.name -replace "Intel(R) Core(TM) "}
Write-Host "CPU:" $processor.name
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("CPU: " + $processor.name)
$vga = get-wmiobject Win32_VideoController -computername $i
Write-Host "VGA:" $vga.name
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("VGA: " + $vga.name)
$sb = get-wmiobject Win32_SoundDevice -computername $i
Write-Host "SB:" $sb.name
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("SB: " + $sb.name)
$dd = get-wmiobject Win32_DiskDrive -computername $i
$hdd = $dd.model -replace "ATA Device"
Write-Host "HDD:" $hdd
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("HDD: " + $dd.model)
$mem = Get-WmiObject win32_computersystem -computername $i | ForEach-Object {[math]::round($_.TotalPhysicalMemory / 1GB)}
Write-Host "RAM:" $mem
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("RAM: " + $mem)
$networkadapter = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -computername $i -Filter IPEnabled=TRUE | select Description
$nic = $networkadapter -replace "@{Description="
$net = $nic -replace "}"
Write-Host "NIC:" $net
Out-File -FilePath "\\storage\temp_all\inventory\$hn.txt" -Encoding unicode -Append -Force -InputObject $("NIC: " + $net)
Write-Host +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
}
ri $args[0]#.Length