The Easiest Way to Save and Share Code Snippets on the web

PowerShellInventory

powershell

posted: Jul, 11th 2012 | jump to bottom

Set-ExecutionPolicy RemoteSigned
 
$hostname = read-host;
 
(Get-WmiObject -class win32_computerSystem -ComputerName $hostname).username
 
Gwmi -Class Win32_Computersystem -Computer $hostname 
 
gwmi WmiMonitorID -Namespace root\wmi -Computer $hostname | ForEach-Object {($_.UserFriendlyName -notmatch 0 `
| foreach {[char]$_}) -join ""; ($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join ""}`
| Out-Host
 
(Get-WmiObject -class win32_videocontroller -ComputerName $hostname).Name
 
Set-ExecutionPolicy RemoteSigned
 
Gwmi -Class win32_SystemEnclosure  -Computer $hostname | select serialnumber
 
Gwmi -Class win32_Printer  -Computer $hostname |select  DeviceID, PortName
 
 
8303 views