Solved

Strange results of the powershell inventory

Posted on 2013-11-18
2
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What, When and Where - Security Threats from Q1

Join Corey Nachreiner, CTO, and Marc Laliberte, Information Security Threat Analyst, on July 26th as they explore their key findings from the first quarter of 2017.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

630 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