您好,登錄后才能下訂單哦!
$Date=(Get-Date).ToString("yyyyMMdd") Write-Output ("計(jì)算機(jī)名稱,MAC地址,使用者,主板型號(hào),中央處理器,物理內(nèi)存(GB),操作系統(tǒng),IP") |` Out-File -FilePath C:\LDM-PC$Date.csv -Encoding UTF8 $LDM_PC=(Get-ADComputer -Filter * | Where-Object {$_.Name -like "lmpc*" -or $_.Name -like "lmlap*" }).Name | Sort-Object ForEach($PC_Info in $LDM_PC){ IF ((Test-Connection -ComputerName $PC_Info -Count 1 -ErrorAction SilentlyContinue ).statuscode -eq 0) { $ComObject=Get-WmiObject -ComputerName $PC_Info -Class Win32_ComputerSystem $Name=$ComObject.Name $UserName=$ComObject.UserName $FullName=(Get-WmiObject Win32_UserAccount| Where-Object {$_.Caption -eq $UserName }).FullName $Memory="{0:N0}" -f ($ComObject.TotalPhysicalMemory/1GB) $NetObject=Get-WmiObject -ComputerName $PC_Info -Class Win32_NetWorkAdapterConfiguration -Filter "IPEnabled='True'" $MACAddress=$NetObject.MACAddress -replace ":","-" $IPAddress=$NetObject.IPAddress -like "*.*.*.*" $ProObject=Get-WmiObject -ComputerName $PC_Info -Class Win32_Processor $CPU=$ProObject.Name $OpeObject=Get-WmiObject -ComputerName $PC_Info -Class Win32_OperatingSystem $OpeName=$OpeObject.Caption $BasObject=Get-WmiObject -ComputerName $PC_Info -Class Win32_BaseBoard $BaseModel=$BasObject.Product $SerialNumber=$BasObject.SerialNumber if ($BaseModel -eq "0T1D10 ") {$BaseModel="Dell Vostro3800(大機(jī)箱)"} #注意此處空格 if ($BaseModel -eq "0RYP79") {$BaseModel="Dell Vostro 3267(小機(jī)箱)"} if ($BaseModel -eq "0JP3NX") {$BaseModel="Dell OptiPlex 3050 Micro(迷你機(jī)箱)"} if ($BaseModel -eq "0GG04X") {$BaseModel="Dell OptiPlex 3050 SFF(大機(jī)箱)"} if ($BaseModel -eq "B250M-D3H-CF") {$BaseModel="技嘉 B250M-D3H-CF"} if ($BaseModel -eq "MS-H110D4L FS M.2") {$BaseModel="銘瑄 MS-H110D4L FS M.2"} if ($BaseModel -eq "B150M-ET SERIES") {$BaseModel="華碩 B150M-ET SERIES"} if ($BaseModel -eq "B85M-F") {$BaseModel="華碩 B85M-F"} if ($BaseModel -eq "B85M-D2V-SI") {$BaseModel="技嘉 B85M-D2V-SI"} if ($BaseModel -eq "H81M-DS2") {$BaseModel="技嘉 H81M-DS2"} if ($BaseModel -eq "C.H81M PRO") {$BaseModel="七彩虹 C.H81M PRO"} if ($BaseModel -eq "C.B75K") {$BaseModel="七彩虹 C.B75K"} if ($BaseModel -eq "MS-H81IL FS") {$BaseModel="銘瑄 MS-H81IL FS"} if ($BaseModel -eq "H81M-VG4 R2.0") {$BaseModel="華擎 H81M-VG4 R2.0"} if ($SerialNumber -eq "/4MP1KL2/CNPE10078C05EZ/") {$FullName="會(huì)議室1"} if ($SerialNumber -eq "/4MK1KL2/CNPE10078B06OX/") {$FullName="會(huì)議室2"} if ($SerialNumber -eq "/4MD3KL2/CNPE1007860LI5/") {$FullName="會(huì)議室3"} Write-Output("`"$Name`",`"$MACAddress`",`"$FullName`",`"$BaseModel`",`"$CPU`",`"$Memory`",`"$OpeName`",`"$IPAddress`"") | Out-File -FilePath C:\LDM-PC$Date.csv -Append -Encoding UTF8 } }
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。