Solved

Strange results of the powershell inventory

Posted on 2013-11-18
2
264 Views
Last Modified: 2013-11-22
Hi folks,

I have a script (provided) with which I am doing an inventory of computers. in the org units. In one of them after the script I got a strange result. (Table attached). What means the values ¿¿in columns "ip address" and "MAC address". and how to get normal values¿¿. And the second small issue, is what means value ¿in the column "Motherboard":  to be filled by O.E.M  

Help me, please
sys-object.csv
Inventory3.myapp
0
Comment
Question by:nesher13
2 Comments
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 200 total points
ID: 39656533
IPaddress and MacAddress are multivalued properties, you can expand it before you export to csv file..

Change last line to..
$AllComputers | select CompName,{$_.IPaddress},{$_.MacAddress},WindowsVersion,ServicePack,WinInsDate,CurrentUser,ProcType,Motherboard,DiskSize,MemoryCapacity  | Export-Csv c:\Powershell\change5.csv -NoTypeInformation 

Open in new window

0
 
LVL 40

Accepted Solution

by:
footech earned 300 total points
ID: 39656873
You could also join all the elements of the IPAddress and MacAddress so that it is a single string.  For that you could change the lines as shown below.
 $IPAddress = (foreach($Adapter in $Netadapters){$adapter.ipaddress}) -join ";"
 $MacAddress = (foreach($Adapter in $Netadapters){$adapter.MacAddress}) -join ";"

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
A brief introduction to what I consider to be the best editor for PowerShell.
The viewer will learn how to count occurrences of each item in an array.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question