Actually useless, but I like to have my keys stored locally so that I don't have to log in all the time. The MSDN does offer the option of exporting the product keys as an XML file, but I don't have Excel everywhere...
The XML file can be converted into a CSV file with the following Powershell script:
$keyfile = "c:\temp\KeysExport.xml" $csvfile = "c:\temp\productkeys.csv" $xmlfile = get-content $keyfile $productkeys =@() $productlist = $xmlfile.YourKey.Product_Key foreach ($product in $productlist) { $productname = $product.Name $productkey = $product.key. "#text" $productkeys += new-object PSObject -property @{Productname="$productname";Productkey="$productkey"} } $productkeys $productkeys | Export-Csv $csvfile -NoTypeInformation -Delimiter ";"
The CSV can also be opened easily with Notepad or similar and the product key can be found quickly.
Hi Frank,
funktioniert einwandfrei.
Vielen Dank!
Gruß
Marius
Hallo Frank,
der Skript hat bisher wunderbar funktioniert und eine nette Übersicht erzeugt.
Leider hat Microsoft nun das MSDN zu My VisualStudio umgezogen und die XML Datei sieht nun ein wenig anders aus.
Sobald man also das Skript über die neue XML laufen lässt, erhält man eine leere csv Datei.
Ist ein Update vorgesehen?
Gruß
Hi Marius,
ich schaue mal ob ich es anpassen kann.
Gruß, Frank
Hi Marius,
um die XML Datei von MyVisualStudio in eine CSV Datei zu exportieren, ist nur eine Anpassung nötig:
Die Zeile mit:
„$productlist = $xmlfile.YourKey.Product_Key“
muss wie folgt geändert werden:
„$productlist = $xmlfile.root.YourKey.Product_Key“
Dann klappt auch wieder der Export.
Gruß,
Frank