SQL Powershell Script to check Server Uptime Remotely

  • Comments posted to this topic are about the item SQL Powershell Script to check Server Uptime Remotely

  • Raushan,

    I get the following message when I try saving this:

    Cannot save 'C:\ServerUpTime.ps1.sql. The folder is marked as "Read Only'.

    Can you assit with this error.

    Thanks

  • Hi,

    It seems you don't have full rights on c drive to create file. you can use any other drives.

    suppose if you have d: drive..

    1- first create a folder of name 'PSScript' under D: drive.

    2- save the script in above folder like "D:\PSScritp\GetServerUpTime.ps1"

    make sure file extension should be .ps1. it's not a SQL script so extension should not be .sql.

    3- go to run--> sqlps

    4- on command prompt... run the below command.. specify server name in below command.

    D:\PSScritp\GetServerUpTime.ps1 ServerName

    -Raushan

  • Good Day Raushan,

    Thank you for your help.

    got it working!

    Have a great day!

  • Hi,

    I need a Unix shell script that checks sql server(SQL Server Management Studio 2008) connection (whether it is connecting or not). My requirement is the script must check the sql connection,if failed sleep for 5 minutes and again checks,if fails again sleep for 5 minutes and recheck for connection.This time if it fails or success, I need to get a mail regarding connection status. I will trigger this script using Informatica workflows. Is this possible?

  • Thanks for this Raushan.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply