Forum Replies Created

Viewing 15 posts - 1 through 15 (of 21 total)

  • Reply To: Data Saturdays and SQLSaturday

    I have an opinion and obviously I have a biased view as Gianluca and I were the ones who put Data Saturdays together. We turned it around quickly as there...

  • RE: To find the when SQL server was rebooted couple of times earlier?

    Of course if I read the question carefully and see SQL and not Server then what you can do is

    $Instance = 'DAVE'
    $Server = ''
    if($Instance -eq 'MSSQLSERVER'...

  • RE: To find the when SQL server was rebooted couple of times earlier?

    You can use PowerShell for the machine

    Get-EventLog -LogName system | where {$_.eventid -eq 6006}

    will show the Event Log Service was stopped

    Get-EventLog -LogName system |...

  • RE: Powershell for CMS

    Hi,

    assuming you have the latest SSMS installed https://sqlps.io/dl then you will have the SQLServer module. (if you don't you probably have the SQLPS module which will work...

  • RE: Powershell help

    Awesome, have you considered joining the SQL Community Collaborative on Github?

    https://github.com/sqlcollaborative

    or in the dbatools dbareports channel in the SQL Community Slack

    That's what we do 🙂

  • RE: Powershell help

    Hi,

    This is how I would achieve this in straight SMO

    Rob

    # Load the assembly

    [void][reflection.assembly]::LoadWithPartialName( "Microsoft.SqlServer.Smo" );

    foreach($Server in $Servers)

    {

    ## Create a Server SMO Object

    ...

  • RE: DBCC,Backup, Verify and create Agent Job to restore

    Blog posts describing the process can be found here

    http://sqldbawithabeard.com/2014/02/25/rationalisation-of-database-with-powershell-and-t-sql-part-one/[/url]

    http://sqldbawithabeard.com/2014/03/03/rationalisation-of-database-with-powershell-and-t-sql-part-two-2/[/url]

  • RE: What is your default database set to?

    We follow the same as several comments, we set the sysadmins to master and everyone else to tempdb on all servers in all environments from Dev to Live.

    We reasoned...

  • RE: Looking for powershell script

    Hi

    You are probably best of using the Out-Datatable and Write-DataTable functions to do this.

    Google will give you plenty of examples

  • RE: Looking for powershell script

    It's probably best for a new question, So create a new thread

    If

    $Server = CLusterNode

    that will show you if SQL is running on that node but there will be...

  • RE: Looking for powershell script

    $SQL = Get-Service -ComputerName $server -name *sql* if i run this not returning anything, can you suggest me what i would need to change.

    That is setting the services whose name...

  • RE: Looking for powershell script

    HI

    As you don't explain the errors or the code you are running you are getting I can't really be of much use.............

    You need to find the name of the service...

  • RE: Tool for SQL Inventory

    It's called POwerDoc it's very good

    http://sqlpowerdoc.codeplex.com/[/url]

  • RE: restore database bakup

    Take a look at the posts here if you want an excellent series on using Powershell to backup and restore

  • RE: Looking for powershell script

    Ah now I understand

    This should do the trick

    $SSRS = Get-Service -ComputerName $server -name *report*

    $SSIS = Get-Service -ComputerName $server -name *Integra*

    If ($SSRS -eq $null)

    {

    Write-Host SSRS Not Installed on $server

    }

    else

    {

    $SSRS

    }

    If ($SSIS -eq...

Viewing 15 posts - 1 through 15 (of 21 total)