Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

[Powershell] Put mac addressses, username, computername in csv

$
0
0

Hi everybody,

I suck in scripting, and I need to make powershell script for windows 7 computers that write macaddresses, local computername to a csv file

I wrote a litle script but it dont write the file.

Can you help me?

Here is my script:


Powershell
$macAddresses=Get-WmiObjectwin32_networkadapterconfiguration$tab=$macAddresses.macaddress$netbiosName=$(Get-WmiObjectWin32_Computersystem).name$currentUser=$(Get-WmiObjectWin32_Computersystem).usernameforeach($mcin$tab){write-output$mcwrite-output$tabwrite-output$netbiosNamewrite-output$currentUser}|Export-Csvc:\temp\result.txt-NoTypeInformation-EncodingUTF8

Here is return:

Thank you for your help


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>