Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Requires -RunAsAdministrator
- $ComputerName = Read-Host -Prompt "Enter the computername"
- $Model = Read-Host -Prompt "Enter the computermodel"
- $query = "Select Model FROM Win32_ComputerSystem"
- Get-WmiObject -Namespace "root\cimv2" -ComputerName $ComputerName -Query $query
- If (-Not $Model -eq ""){
- $query = "Select * FROM Win32_ComputerSystem WHERE Model LIKE '%$Model%'"
- Get-WmiObject -Namespace "root\cimv2" -ComputerName $ComputerName -Query $query
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement