Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Browsing all 467 articles
Browse latest View live

Problem with escaping periods from powershell piped variable

Hi EveryoneI am writing a very basic scripts which pulls info from one DB and pushes it to another. I wont go into reasons for doing this etc.The pulling is working correctly and I am building an array...

View Article


How to get list of pending HotfixID from a remote server using Powershell

Is there a way to get list of Pending HotfixID yet to be installed from a windows 2012 server remotely using Powershell?

View Article


datetime and string conversion problem

Hi EveryoneIm pulling some data out of one database with a query that looks like:[quote]$localquery = "SELECT...

View Article

Get $ sign with -match

"this transaction will cost $600" -match "\`$ \d{1,3}"I want matches[0] $600what am I missing ?

View Article

Changing entries in a .ini file using powershell

Hello,I am currently working on automating SSRS installs and need a way of changing a few entries in the .ini file. I've done a fair bit of reading, but there seems (as there always is) several ways of...

View Article


Disable NIC on remote server in powershell

Hi I have a requirement to disable NIC using powershell remotely. I'm using below command. It works when i hardcode NIC's Name in the command but it is failing when i pass the NIC's Name in variable....

View Article

List SSL Certificates and List SSL Certificate Bindings

Hello,I have a question about the above Methods. Running $wotevah.ListSSLCertificates() Provides the following details (when run on my local Win7 machine)...__GENUS : 2__CLASS :...

View Article

Why SMO return a lot of emty properties and how to filter only ones...

Example my station has SSMS 2008R2 # SQL server ( myserver\inst1) is SQL 2014 STD code executed from station [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null$srv...

View Article


Powershell error

I have a loop statement in powershell, and it's give me error. I think that "+$Row2+" as 'col 2' is not right.anyone could help? Thanks so much[quote]foreach($Row in $DataSet.Tables[0].Rows){ $Row1...

View Article


Retrieve InstallationID from an XML document. Almost there but...

Hello,I am trying to automate the initialization of the Report Server in SSRS Configuration Manager using Powershell.So far I have worked out that I can use the InitializeReportServer Method which...

View Article

Need to generate 1 script per object (indexes)

Hello - Have been looking all over for a solution that will allow me to script out my Non-Clustered Indexes to a single file for each index. The closest thing I have found was from Vince Panuccio...

View Article

how in powershell (smo and scripter or other object )list tables with...

Hi, we need to output list of tables with dependencies, indexes ,FK, constrains I used TSQL and scripted info using ---run in msdb to test it--run with output to grid to avoid warning about tables with...

View Article

Powershell job issues

So I am trying to schedule a powershell job on SQL Server[code="plain"]set-location "c:\Users\sqlagent\Documents".\Funcion_Get-Connection_New.ps1.\Test-ADGroupExists.ps1.\Get-ImpactProjects.ps1$DstDB =...

View Article


How to add a filter to a variable.

Hello,I hope someone can offer some guidance. I have written a function to set some SSRS settings. It all worked well until I added a couple more SSRS instances. Now, even though I specify the instance...

View Article

Get-ChildItem where is property -LiteralPath?

I needed to move files (using powershell V2) finely I found one liner to do the job,to my understanding Move-Item use -LiteralPath parameter --- (Accept pipeline input? true (ByPropertyName))but how it...

View Article


If SQL DB exists, dont run function. If it doesnt run function.

Hello, I have created the script below, it works well, but I need to put a line in there to check whether the report server database exists or not before running the function. If it does exist, I'd...

View Article

Import-Module SqlPS running too slowly

Hi All,I have the following installed on a machineWindows Server 2008 R2SQL Server 2012 PowerShell 3Microsoft SQL Server 2012 Feature Pack Powershell toolsMy problem is that whenever i run a script...

View Article


Prompt For Choice

Hi,I am very new to writing in powershell, so bear with me.My aim is to get a list of certificates and prompt the user to select which certificate they require. In my head I want the output0 Cert11...

View Article

deleting email from mailbox and saving then to sql server

Hi I am working on script to save emails to database and delete them using example...

View Article

Free eBook today: SQL Server 2012 with PowerShell V3 Cookbook

[url=https://www.packtpub.com/packt/offers/free-learning]https://www.packtpub.com/packt/offers/free-learning[/url]

View Article
Browsing all 467 articles
Browse latest View live