function Read-InputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText) { Add-Type -AssemblyName Microsoft.VisualBasic return [Microsoft.VisualBasic.Interaction]::InputBox($Message, $WindowTitle, $DefaultText) } $UserEmail = Read-InputBoxDialog -Message "Please enter your corparate email" -WindowTitle "Name request" -DefaultText "@xometry.de" $PathToTempFile = Join-Path $env:TEMP -ChildPath $($UserEmail +".txt") $MailParam = @{ To = "agizzatullin@xometry.de" Subject ="[PC info] $($UserEmail) Collected info" SmtpServer = "smtp.gmail.com" UseSsl = $true Credential = New-Object System.Management.Automation.PSCredential ("llbotroll@gmail.com", $(ConvertTo-SecureString "bisqrxeiaoedrdhe" -AsPlainText -Force)) Cc = "vnikulin@xometry.de" From = "llbotroll@gmail.com" Attachments = $PathToTempFile #Body = "$SendData" #BodyAsHtml = $true } #$SysInfo = $(Get-CimInstance -ClassName Win32_Processor | Select-Object -ExcludeProperty "CIM*"| fl;` # Get-WmiObject win32_baseboard; ` # Get-WmiObject Win32_OperatingSystem;` # Get-WmiObject Win32_Bios; ` # Get-WmiObject Win32_LogicalDisk;` # Get-WmiObject win32_physicalmemory | Select Manufacturer,Banklabel,Configuredclockspeed,Devicelocator,Capacity,Serialnumber; ` # Get-ComputerInfo OSName, OsArchitecture) Set-Content -Path $PathToTempFile -Value $("Email:" + $UserEmail) Write-Host "Getting CPU Info" Add-Content -Path $PathToTempFile -Value "CPU info:" $(Get-CimInstance -ClassName Win32_Processor | Select-Object -ExcludeProperty "CIM*").Name | Out-File $PathToTempFile -Append default Add-Content -Path $PathToTempFile -Value "" Write-Host "Getting Motherboard Info" Add-Content -Path $PathToTempFile -Value "Motherboard info:" $MotherBoard = Get-WmiObject win32_baseboard Add-Content -Path $PathToTempFile -Value $("Manufacturer: " + $MotherBoard.Manufacturer) Add-Content -Path $PathToTempFile -Value $("SerialNumber: " + $MotherBoard.SerialNumber) Add-Content -Path $PathToTempFile -Value $("Product: " + $MotherBoard.Product) Add-Content -Path $PathToTempFile -Value "" Add-Content -Path $PathToTempFile -Value "OperationInfo info:" $OSinfo = Get-ComputerInfo Write-Host "Getting OS Info" Add-Content -Path $PathToTempFile -Value $("OsName: " + $OSinfo.OsName) Add-Content -Path $PathToTempFile -Value $("OsBuildNumber: " + $OSinfo.OsBuildNumber) Add-Content -Path $PathToTempFile -Value $("OsLanguage: " + $OSinfo.OsLanguage) Add-Content -Path $PathToTempFile -Value $("TimeZone: " + $OSinfo.TimeZone) Add-Content -Path $PathToTempFile -Value $("OsTotalVisibleMemorySize: " + $OSinfo.OsTotalVisibleMemorySize) Add-Content -Path $PathToTempFile -Value "" Add-Content -Path $PathToTempFile -Value "Disks info:" $disks = Get-Disk | Select FriendlyName,Size Add-Content -Path $PathToTempFile -Value $disks Write-Host "Getting apps list" $AppsCatalog = Get-WmiObject -Class Win32_Product | Select-Object -Property Name | Sort-Object Name $AppsCatalog64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, Size, InstallDate | Format-Table -AutoSize $AppsCatalog32 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, Size, InstallDate | Format-Table -AutoSize #$SysInfo | Out-File $PathToTempFile $AppsCatalog | Out-File $PathToTempFile -Append default $AppsCatalog64 | Out-File $PathToTempFile -Append default $AppsCatalog32 | Out-File $PathToTempFile -Append default #$SendData = Get-Content $PathToTempFile Send-MailMessage @MailParam Write-Host "All information has been collected" Write-Host "Please Enter to close window" Read-Host