wmic -U DOMAIN/user --password='password' //IP_HOST "select Caption,CSDVersion,CSName from Win32_OperatingSystem" | grep Windows
Get windows version with servicepack and hostname
Sample Output
wmic -U DOMAIN/user --password='password'  //IP_HOST "select Caption,CSDVersion,CSName  from Win32_OperatingSystem" | grep Windows

2010-09-20 14:23:37

What Others Think

fantastic, thanks PS: TapeDrive Select * from Win32_TapeDrive UserAccount Select * from Win32_UserAccount ComputerSystem Select * from Win32_ComputerSystem NTEvent Select * from Win32_NTLogEvent MEMCACHE Select * from WIN32_CACHEMEMORY PageFileSet Select * from Win32_PageFileSetting Voltage Select * from Win32_VoltageProbe Alias Select * from Msft_CliAlias NetClient Select * from WIN32_NetworkClient SysAccount Select * from Win32_SystemAccount NetLogin Select * from Win32_NetworkLoginProfile DiskQuota Select * from Win32_DiskQuota DESKTOP Select * from WIN32_DESKTOP SystemEnclosure Select * from Win32_SystemEnclosure BootConfig Select * from Win32_BootConfiguration WMISet Select * from Win32_WMISetting RecoverOS Select * from Win32_OSRecoveryConfiguration NetProtocol Select * from Win32_NetworkProtocol SystemSlot Select * from Win32_SystemSlot SoftwareFeature Select * from Win32_SoftwareFeature NetUse Select * from Win32_NetworkConnection SCSICONTROLLER Select * from Win32_SCSIController Startup Select * from Win32_StartupCommand LogicalDisk Select * from Win32_LogicalDisk SoundDev Select * from WIN32_SoundDevice SoftwareElement Select * from Win32_SoftwareElement MemPhysical Select * from Win32_PhysicalMemoryArray PageFile Select * from Win32_PageFileUsage Process Select * from Win32_Process PortConnector Select * from Win32_PortConnector Job Select * from Win32_ScheduledJob DCOMAPP Select * from WIN32_DCOMApplication Service Select * from Win32_Service BaseBoard Select * from Win32_BaseBoard LOGON Select * from Win32_LogonSession SysDriver Select * from Win32_SystemDriver Temperature Select * from Win32_TemperatureProbe DeviceMemoryAddress Select * from Win32_DeviceMemoryAddress NTEventLog Select * from Win32_NTEventlogFile BIOS Select * from Win32_BIOS DMAChannel Select * from Win32_DMAChannel LoadOrder Select * from Win32_LoadOrderGroup TimeZone Select * from Win32_TimeZone CPU Select * from WIN32_PROCESSOR Port Select * from Win32_PortResource Share Select * from Win32_Share Partition Select * from Win32_DiskPartition FSDir Select * from Win32_Directory NTDOMAIN Select * from Win32_NTDomain Environment Select * from Win32_Environment VolumeQuotaSetting Select * from Win32_VolumeQuotaSetting QuotaSetting Select * from Win32_QuotaSetting IDECONTROLLER Select * from Win32_IDEController DiskDrive Select * from Win32_DiskDrive DataFile Select * from CIM_DataFile CDROM Select * from Win32_CDROMDrive QFE Select * from Win32_QuickFixEngineering OnBoardDevice Select * from Win32_OnBoardDevice PrintJob Select * from Win32_PrintJob UPS Select * from Win32_UninterruptiblePowerSupply CSProduct Select * from Win32_ComputerSystemProduct Server Select * from Win32_PerfRawData_PerfNet_Server Printer Select * from Win32_Printer IRQ Select * from Win32_IRQResource Product Select * from Win32_Product PrinterConfig Select * from Win32_PrinterConfiguration Group Select * from Win32_Group DesktopMonitor Select * from WIN32_DESKTOPMONITOR OS Select * from Win32_OperatingSystem Registry Select * from Win32_Registry NICConfig Select * from Win32_NetworkAdapterConfiguration MemLogical Select * from Win32_LogicalMemoryConfiguration NIC Select * from Win32_NetworkAdapter
oernii3 · 408 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Similar Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: