Parsing log file from an appliance
I have exported the logs from an SMTP appliance to csv. Unfortunately, the format does not follow the standard criteria of a csv file. As a result, opening in Excel is useless. Using import-csv is...
View ArticlePath with variable
HelloCan someone please help me?#Example 1C:\Temp\MyFile.txt#Example 2$MyPath = "C:\Temp"$MyPath+'\MyFile.txt'While example 1 opens MyFile.txt, example 2 with variable just echos...
View ArticlePowershell scripting objects execution error
Hi,I am trying database objects without data. When i run this code, i get the following error... Please guide me in solving this..Error:Exception calling "TransferData" with "0" argument(s): "ERROR :...
View ArticleExecuting SQl Scripts Using Powershell
Hi,I would like to know about executing(.sql files) contains scripts for creating tables, views etc., in a database using powershell. Can anyone give me a example.
View ArticlePowershell to access the screen Job Activity Monitor
Hello All !I have literally just joined this forum to post the follow query....Having spent a long time Googling I've drawn a blank so hopefully somebody here can help me...I wish to use Powershell to...
View ArticleHow to iterate through a get-sqldata resultset
how do i iterate through a resultset obtained from using the SQLPSX get-sqldata? I want to output the resultset to an excel file. i'm ok with creating the excel file.thanks
View ArticlePowershell og mysql
Is it possible to query one record (a number) from a column in mysql database and put that into a textfile by using Powershell.I use "select [column1] from [table1] where [column2]='$computername'but I...
View ArticleScheduling a powershell script as a sql agent job
I have a script that when I run straight from powershell or as a windows scheduled task worksfine. The script does a bcp of my logs into a csv file, then zips it, then deletes the zip. When I run the...
View ArticlePowershell, SQL just stopped working on PS version change.
on SQL server 2008 and powershell the following was working fine for me.$con = "server=$hostname;database=Log;Integrated Security=sspi" $cmd = "SELECT top 1 replace(convert(varchar, LogDate , 110),...
View ArticleTrapping error message after running an *.exe in Powershell
HiI am struggling with a exe job failing when using powershell. I want to trap these errors in a variable specially the last error statement "Error | _checkForPriorErrorState | PROCESSING CANCELLED -...
View ArticleAssist needed to execute DB Query on remote machine
On my PC AND on the remote server is powershellOn my PC is MYSQLIB, ORACLEClient, and SQL Server all with in the PowerShell modules dir'On the remote server is SQL Developer. I used to do the remote...
View ArticleUsing PowerShell to run an SSRS report and passing more than one value to a...
I have scripted a PowerShell script to run an SSRS report that has been deployed to the ReportServer. One of the parameters for that report will allow multiple values, i.e., StartYear = "2011,2012"....
View ArticleVerify SQL Server services
I am looking for powershell script to verify SQL Server services from centralised location.I want to create SQL Agent job schedule to run on weekly basis to verify the SQL Instance once after...
View ArticleInstalling SQL Server 2008 on Failover Cluster ...... remotely :)
Without getting too technical (just yet) let me try and explain what I am doing. I am just about done with a script that installs a 2 node cluster on Server 2008, creates resources and then installs...
View Articlehow comes row data becomes System.Data.DataRow in stead of value.
Hi all, i already googled this and tried allot but no succes yet. Perhaps i can find help here ? Here it goes:i dont have to much expirience on powershell, i'm a DBA and i feel that powershel can help...
View ArticleCreate Table to oracle
Hi sir,I want to create table to oracle database with powershell v 1.0 script.if i can execute select on database but i can't to create table.$DB_Login = ""$DB_Pass = ""$DATABASE =...
View ArticleExport to excel from SQL Server (Remote) with formating
Hi Experts,I am a novice to poweshell. I would like to know how to export the content of a table present in a remote SQL Server table to an excel.I would like to format first column of the table to...
View ArticleSQLServer Agent jobs - Delete and Create using Powershell script
Hi,I want to migrate all the SQLServer agent jobs from one server to another. Scripting delete jobs using SSMS consists of job_id. I need to go with job name as the destination server has already some...
View ArticleReading & processing SQL Tables
Hi,I am a newbie to PowerShell. I would like to read & process data from SQL Tables.I have written code which through which I am able to fetch the data from source using a query text 'SELECT acc_no...
View ArticleHow to get the "Analysis Server Properties"
Hi All i have to collect the SSAS properties ("Analysis Server Properties") into a SQL table , i can not find any DMV to get the "Analysis Server Properties" but i am assuming it can be done with...
View Article