Quick Powershell Scripting

Here I am writing some very usefull and basic Powershell codes-

How to Handle Sexual Harassment at Workplace

*To find whether the connection to any machine is successful..

$strIpAddress = Read-Host “Enter IP Address”
Clear
$QueryString = (‘
Select StatusCode From Win32_PingStatus Where Address = “‘ + $strIpAddress + ‘”‘)
$ResultsSet = Gwmi -Q “$QueryString”
If ($ResultsSet.StatusCode -Eq 0)
{Write-Host -Fore Green “The Router Is On Line”}
Else {Write-Host -Fore Red “The Router Is Off Line”}

You can also have a set of servers in the serverlist.txt file and run the script for all these servers.

Please write me at tuitionaffordable@gmail.com if you need any assistance.

Following blogs will help you prepare for IT Industry Interviews and Walk-Ins.

  1. SQL Server DBA “Interview Questions And Answers”
  2. MS SQL Corruption: “Msg 2627 – Violation of PRIMARY KEY constraint”
  3. SQL Server 2008 R2 – Foreign Key – DELETE CASCADE and DELETE UDPATE
  4. MSSQL Server – DBCC LOGINFO – Status 2. Log File FULL. Verify log_reuse_wait_desc
  5. SSRS Report – Adding Header and Footer

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s