kdeutsch
asked on
powershell infromation for computers
I have been tasked with getting all kinds of information about a computer when its imaged via a powershell script and have found lost sof bits and pieces around the net. I am piecing it together but can't help but ask if there is a better way or more efficeit way of caputring all this.
1. Image Location
2. SerialNumber
3. Cpu Architecture
4. cpu name & caption
5. cpu version
6. cpu manufacturer
7. total physical memory
8. #Processors
9. macaddress
10. wireless mac
11. harddrive
12. IP
13. computer name
14. dtCapture
15. OS
16. OSArchitecture
17. Processor speed
18. # of cores
Here is what I have started.
# get the computer name
$computer = gc env:computername
# get the Sn of the current computer
$colItems = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" `
foreach ($objItem in $colItems) {
write-host "Serial Number: " $objItem.SerialNumber
$Sn = $objItem.SerialNumber
}
if ($Sn -eq $null)
{
write-host "Sn is blank or not avialable"
write-host "Please Provide the computer SN"
$Sn = Read-Host
write-host " The Sn is " $Sn
}
else
{
write-host " The Sn is " $Sn
Write-host " Images at " $Option
}
write-host "computer name: " $computer
get-wmiobject Win32_Processor | select Architecture,Caption, Name,Version,Manufacturer, ProcessorT ype
get-wmiobject Win32_ComputerSystem | select @{name="TotalPhysicalMemor y(MB)";exp ression={( $_.TotalPh ysicalMemo ry/1mb).to string("N0 ")}},Numbe rOfProcess ors
1. Image Location
2. SerialNumber
3. Cpu Architecture
4. cpu name & caption
5. cpu version
6. cpu manufacturer
7. total physical memory
8. #Processors
9. macaddress
10. wireless mac
11. harddrive
12. IP
13. computer name
14. dtCapture
15. OS
16. OSArchitecture
17. Processor speed
18. # of cores
Here is what I have started.
# get the computer name
$computer = gc env:computername
# get the Sn of the current computer
$colItems = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" `
foreach ($objItem in $colItems) {
write-host "Serial Number: " $objItem.SerialNumber
$Sn = $objItem.SerialNumber
}
if ($Sn -eq $null)
{
write-host "Sn is blank or not avialable"
write-host "Please Provide the computer SN"
$Sn = Read-Host
write-host " The Sn is " $Sn
}
else
{
write-host " The Sn is " $Sn
Write-host " Images at " $Option
}
write-host "computer name: " $computer
get-wmiobject Win32_Processor | select Architecture,Caption, Name,Version,Manufacturer,
get-wmiobject Win32_ComputerSystem | select @{name="TotalPhysicalMemor
What are you using to image? How many PC's in the org do you intend to image/manage?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
HI,
I they use ghost to image currently. Right now they use a vb script to get some of the information and pump into a database. I am chagning it to a powershell script for future ease of managing and trying to get more information than the current vb script provides. it only gets about 5 items of my list above. Each time a computer is imaged it just goes and grabs this script and runs it soe its individual based but happenns maybe 5 times a day or sometimes more.
I they use ghost to image currently. Right now they use a vb script to get some of the information and pump into a database. I am chagning it to a powershell script for future ease of managing and trying to get more information than the current vb script provides. it only gets about 5 items of my list above. Each time a computer is imaged it just goes and grabs this script and runs it soe its individual based but happenns maybe 5 times a day or sometimes more.
ASKER
thanks