Retrieving Data From Hyphenated Server
What better place to solve a nagging Powershell issue than good ol' SQL Server Central :)I'm trying to retrieve disk usage data from servers on my domain. Server list is pulled from a simple text file...
View ArticleHelp making my RestoreDB script better pls?
I'm a total noob with posh :-) I got it powershell running and then hacked together this script.I was following the article about powershell restores...
View ArticleOpen Excel Error Using PowerShell in SQL Server Agent Job
I am trying to run a Powershell script, which opens and modifies an Excel spreadsheet, from a SQL Agent job step, . The script runs fine by itself, and from BIDS. I have tried running as an SSIS pkg...
View ArticleWrite PowerShell Output to SQL Server Table
Heh... First time I've had to admit being a "newbie" in a long time so be gentle with me. I might not even know enough to ask the right questions.I managed to pick up the following PS script from the...
View ArticleCount imported Files
I need following in the script.- Compair the Field [b]"Count_import"[/b] of delivered with "Count_fault" document and send a E-Mail if there is a difference or Count_Fault>0have write a script,...
View ArticleGetting Cluster information from Powershell scripts
HiI am logged in remotely to a workstation and connecting locally to sql server 2008r2 cluster node. Is there a way to run Powershell scripts to get information about the cluster environment?
View ArticleUpdate Table with get-date
Hi,i want to update my table Field Date_Import=get-date -f (without time)TBL_Import [Count_Import] int NULL,[Count_Fault] int NULL,[Date_Import] date NULL$Command = $Connection.CreateCommand()...
View ArticlePowershell script being run as SQL agent job
Hi everyone.I have a powershell script that lists all backup status across various servers.Script runs fine via Powershell gui (Normally) Sometimes I see an issue. Think it is regarding Excel and how...
View ArticleRun SQL Server 2012 package with Project environment
Hi experts,I try to launch SSIS 2012 packages stored into SSISDB with PowerShell. In my SSISDB, I have several Project environements (DEV,PROD,...); I would like to change project environnement from my...
View ArticleIntegrity check output to file using Invoke-Sqlcmd failing
Hi all, I am having fun trying to get a PowerShell called database integrity check to output to a file. This is so I can then search the output for specific lines/words to reduce the ammount to be...
View ArticlePowershell error - Ok in ISE , fails in Agent job
Morning all.I am trying to run script to get Translog details. The script works fine in ISE and produces report as expected. Produces excel report etc.When it runs in an agent job it fails with the...
View ArticlePowershell for network path
I am totally new to powershell(just 2 days) so please bear my ignorance.Here is the code I am trying to execute as a sql agent job that basically deletes files over 2 days old.[code]function...
View ArticleInsert xml data into SQL server via SqlBulkCopy with powershell (casting error)
I tried to strip down this example to make it as terse as possible so it would be easy to read\answer.I'm getting a "cast not valid" error when trying to insert a data table containing xml using...
View ArticleSpecial method for evaluating Database Properties through conditional...
Passing an Instance name for $Instance, this loops through all databases on the instance. Gathers their name and Recovery model. Writes the name and recovery model. However, the conditional statement...
View Articlepowershell script through agent job only performing half the steps it should.
Ok. I'm out of ideas.I have a script that grabs a list of sqlserver instances, then connects to each (foreach), executes a query and loads the results into a table.Every time I execute the script...
View Articleusing Sqlpsx functions on a production sql box
There is a very handy cmdlet called Get-sqlerrorlog that I'd like to use but everyone is very strict about installing anything on a production sql server. I want to use it to save off the sql error...
View ArticlePowershell script to capture SQL service status
Hello everyoneCan anyone offer some advice on how I would capture SQL server services, i.e started etc for each SQL instance in a .txt file containing the servers I want to look at ?One issue I have is...
View ArticlePowershell for SQL Server Instructor-Led Class
I keep getting the message that powershell is very usefull for the DBA. I believe it. But I need a class.At SQL Pass Summit I went to several presentations that tended to be givenby very talented...
View ArticleRetrieve file from web
Hello,I've exhausted myself trying to get this to work with cURL, and am trying to get it to work with PS v3 now. I've stitched together code from a couple places and come up with...
View ArticleSQL inventory powershell script
Hi everyone.Hope someone can offer some advice on my issue. I have been learning Powershell with the aid of the SQL Server 2008 Administration with Windows Powershell book published by Wrox.Book is...
View Article