get-wmiobject -class -computer . win32_NTlogevent

How to Start Service Using Powershell Commands

This command informs the eventlog for your m\c. This commands output is very large so be carefull while executing this “OR” take only top 10 or 20 lines as follows-

get-wmiobject -class -computer . win32_NTlogevent | select -first 10 | out-file “D:\powershell\class1.txt”

You will get an error as follow:
“Missing an argument for parameter ‘Class’. Specify a parameter of type ‘System.String’ and try again.”. “get-wmiobject -class <<<< -computer . win32_NTlogevent”.

Oops!!!! here you go with your correct command-

get-wmiobject -class win32_NTlogevent -computer .| select -first 10 | out-file “D:\powershell\class1.txt”

INTERVIEW PREPARATION IN 30 MINs – Read Following wires for a quick interview preparation.

  1. SQL Server DBA “Interview Questions And Answers”
  2. SQL Azure Interview Questions and Answers Part – 1
  3. SQL Azure Interview Questions and Answers Part – 2
  4. Powershell Interview Questions and Answers

Regards,
Online PowerShell Classes @ http://tuitionaffordable.webstarts.com

Author: tuitionaffordable

Making tuition affordable for all the students on the planet.

Leave a comment