Forum Replies Created

Viewing 15 posts - 241 through 255 (of 348 total)

  • RE: Autoalert if SQLAgent stops

    I used file instead of command.

    Command line parameters:-file C:\PS\email.ps1

    It did not send out an email alert upon stopping the SQLAgent.

  • RE: Autoalert if SQLAgent stops

    #variables

    $emailFrom = "asdfAlerts@fghj.org"

    $emailTo = "abcdef@fghj.org"

    $subject = "Powershell Function calling an SMTP server"

    $body = "Send an email through SMTP in Powershell"

    $smtpServer = "smtp.fghj.org"

    #create a function

    Function sendEmail([string]$emailFrom, [string]$emailTo, [string]$subject,[string]$body,[string]$smtpServer)

    {

    $smtp = new-object Net.Mail.SmtpClient($smtpServer)

    $smtp.Send($emailFrom,$emailTo,$subject,$body)

    }

    sendEmail...

  • RE: Autoalert if SQLAgent stops

    powershell.exe -noprofile -command Send-MailMessage –From asfdsa@gdfgs.org –To abcd@abcd.org –Subject "Test Email" –Body "Powershell Email Testing" –SmtpServer smtp.abcd.org

    The above code runs as part of SQL job but does not generate any...

  • RE: Autoalert if SQLAgent stops

    It does not run from SQLAgent.

    Message

    Executed as user: The error information returned by PowerShell is: 'The term 'Send-MailMessage' is not recognized as the name of a cmdlet, function, script file,...

  • RE: Autoalert if SQLAgent stops

    Send-MailMessage –From abcdef@abcd.org –To edft@gsdg.org –Subject “Test Email” –Body “Powershell Email Testing” –SmtpServer smtp.abcd.org

    When I run the above command from the powershell window it sends out an email,but I when...

  • RE: Autoalert if SQLAgent stops

    I do not get any email alert

  • RE: Servers in a domain

    Then is there a foolproof waay of finding all the windows servers/or sql instances within in a domain using powershell/or any process.

    I tried the above process but my list did...

  • RE: SQL Code across platforms

    Yes, that column name has changed in 2012 and it is shown in kbs and bytes across these different versions.Hence this issue.

    How do I get this working ?

    I can't use...

  • RE: Output formatting and for loop issue

    Only the Servername is changing but it is returning the same data for all the servers:

    $Results = Foreach ($Server in (get-content "C:\serverlist\Server.txt"))

    {Get-WmiObject Win32_LogicalDisk | Select @{Name="Server";Expression={$Server}},DeviceID,VolumeName,Drive,Size,FreeSpace | Format-Table ...

  • RE: SQL Code in SSIS package

    I am trying to collect drives space details (total and available) from across a list of 150 servers using t-sql and SSIS with t-sql as part of the SSIS package.

  • RE: sql and stored procedure

    Noted and thank you again !

  • RE: sql and stored procedure

    Thanks...That is one of the solutions but was curious to know if I could do using only t-sql.

    Anyways thank you for the response.

  • RE: sql and stored procedure

    Thank you

  • RE: sql and stored procedure

    Apologies to disappoint people on board for their 'humour'. But that is not the case.

    I need to extract the result from the stored procedure from a bunch of servers along...

  • RE: Foreachloop continue inspite of server connectivity issues in SSIS package.

    I have already built the package.It works fine as long as the servers exists.

    Lets say a server is not reachable for any reason.My foreachloop should skip that server and go...

Viewing 15 posts - 241 through 255 (of 348 total)