Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Zu einer Tabelle eine Spalte hinzufügen und automatisch füllen

$
0
0

Hi,

ich gebe folgende Zeile ein:

get-wmiobject -class "Win32_Product" -namespace "root\CIMV2" -computername "meincomputer" | select-objectComputername, Vendor, Name, Version

dann kommt das:

Computername                          Vendor                                                   Name                                                                     Version
------------                                    ------                                                      ----                                                                        -------
                                                  Microsoft Corporation                             Microsoft Office Access MUI (German) 2010             14.0.6029.1000
                                                  Microsoft Corporation                             Microsoft Office Office 64-bit Components 2010      14.0.6029.1000
                                                  Microsoft Corporation                             Microsoft Office Shared 64-bit MUI (German) 2010  14.0.6029.1000
                                                  Microsoft Corporation                             Microsoft Office Proofing (German) 2010                  14.0.6029.1000
                                                  Microsoft Corporation                             Microsoft Office Shared MUI (German) 2010             14.0.6029.1000
                                                  Microsoft Corporation                             Microsoft Office Proof (Italian) 2010                         14.0.6029.1000

........

Jetzt habe ich in der Ausgabe die Spalte Computername künstlich hinzugefügt.

Ich hätte nun gern in jeder Zeile "meincomputer" in der SpalteComputername stehen.

Warum? Ich möchte alle Domänen PCs auslesen und das Ergebnis in eine Datei schreiben, welche später in eine Datenbank importiert wird.

Ich möchte vermeiden, für jeden PC eine eigene Liste zu erstellen.

Hat jemand ein Idee. wie man das machen könnte?

Vielen Dank!





Viewing all articles
Browse latest Browse all 2314


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