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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s