ich habe mir in Powershell ein kleines Skript geschrieben, welches mir eine .CSV mit den "Eckdaten" des Rechners ausgibt.
Code: Select all
$computerSystem = get-wmiobject Win32_ComputerSystem
$computerBIOS = get-wmiobject Win32_BIOS
$computerOS = get-wmiobject Win32_OperatingSystem
$computerCPU = get-wmiobject Win32_Processor
$computerHDD = Get-WmiObject Win32_LogicalDisk -Filter drivetype=3
#Build the CSV file
$csvObject = New-Object PSObject -property @{
'PCName' = $computerSystem.Name
'Manufacturer' = $computerSystem.Manufacturer
'Model' = $computerSystem.Model
'SerialNumber' = $computerBIOS.SerialNumber
'RAM' = "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB)
'HDDSize' = "{0:N2}" -f ($computerHDD.Size/1GB)
'HDDFree' = "{0:P2}" -f ($computerHDD.FreeSpace/$computerHDD.Size)
'CPU' = $computerCPU.Name
'OS' = $computerOS.caption
'SP' = $computerOS.ServicePackMajorVersion
'User' = $computerSystem.UserName
'BootTime' = $computerOS.ConvertToDateTime($computerOS.LastBootUpTime)
}
#Export the fields you want from above in the specified order
$csvObject | Export-Csv C:\TEMP\system-info3.csv -NoTypeInformation -Append -Encoding UTF8
#import-Csv C:\TEMP\system-info3.csv | %{$_.Replace('"','')} | Out-File C:\TEMP\system-info3.csv
# Open CSV file for review (leave this line out when deploying)
notepad C:\TEMP\system-info3.csv
Leider bekomme ich nur diese Fehlermeldung:
Import-Bericht für ITSMConfigItem
Datensätze:
1
Erfolgreich:
0
Nicht erfolgreich:
1
Zuletzt verarbeitete Zeile der Import-Datei:
1
und in den SysLog steht:
Wed Jul 22 13:03:34 2015 notice OTRS-CGI-57 Last processed line number of import file: 1
Wed Jul 22 13:03:34 2015 notice OTRS-CGI-57 Import of 1 ITSMConfigItem records: 1 failed, 0 succeeded
Wed Jul 22 13:03:34 2015 error OTRS-CGI-57 Can't import entity 1: Error when adding the new config item version.
Wed Jul 22 13:03:34 2015 error OTRS-CGI-57 Need DeplStateID!
Bitte um Hilfe.
Vielen Dank im Voraus!
Alex