Solved

Strange results of the powershell inventory

Posted on 2013-11-18
2
254 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 39

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now