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

Need help with file not found error message.

Hello,I have googled this to high heaven, but it just leads me to references to the cmdlet. Can anyone point me in the right direction, please? I do not have the folder, but what do I need to...

View Article


Is it possible to get permissions of attached database files via powershell?

I had a problem recently where the permissions on a database file were wrong and I wanted an automated way to check for itput together something really simple but it doesn't work on files currently...

View Article


Need help converting Office_2018-04-02T00-04-02 to 2018-04-02 00:04:02 in...

Hi All,I kinda need help converting the value from Office_2018-04-02T00-04-02 to 2018-04-02 00:04:02.Once i get the help here I'll put your helpful line my foreach loop which will

View Article

Powershell help on Azure SQL database with always encryption

Hi Experts, Need some powershell help. Below code, adds a "Key" to azure key vault. need help in embedding logic , if the key "CMKAuto1" aldready exists then drop and re-create the key.This key is used...

View Article

Export AD into text

How can I export AD accounts along with SID's into a tab delimited text extract.

View Article


The corresponding line is 'new-item -ItemType Directory -Path $path -Force

Hello,i thought i had a simple powershell script, its just suppose to check if folder exists, if it doesnt, create it using the name as a date.however i get the following error:A job step received an...

View Article

Could not load file or assembly Microsoft.SqlServer.Smo, Version=9.0.242.0

Hi allA lot happened on my machine at work last week - I installed Visual Studio 2015 which somehow messed up my SQL 2016 install. So I uninstalled SQL 2016 (and too the opportunity to clear out other...

View Article

Not able to pass password when I deploy SSIS with powershell script

I have an ssis solution that is encrypted with password and when I deploy it directly from visual studio, it runs on the server without any problem.I am trying to deploy it using a powershell query, it...

View Article


replace the result of a list with the result of a select query

Hello everyoneI need to replace a predefined list by the result of a select querymy list is statistically defined [code language="sql"]$path=@("\\Filer1\sql-bck$","\\filer2\sql-bc

View Article


Write 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 Article

Email

I have this piece of code which is currently working but I  an additional column added to the existing table and then emailed.$Header = @"TABLE {border-width: 1px; border-style: solid; border-color: b

View Article

Powershell email throwing error

$File="gci \\abcd\efgh\ijkl | select -last 1"$From = "adcb@gmail.com"$To = "efgh@gmail.com"$Attachment = $File$Subject = "Here's the Email Subject"$Body = "This is what I want to say"$SMTPServer =...

View Article

How Do You Connect to a Central Management Server If Your Server is a Named...

I have the following code that worked on a default instance.  Now I am trying to get it to work on a named instance.  I have tried replacing the \ with %5C.  That didn't work.  Any help would be...

View Article


Task scheduler powershell code not sending email to multiple recipients

.

View Article

restore all databases

Hello everyoneI need to restore almost 100 backup put on a folder through a single scriptfor that I try to script these 3 lines but the powershell it makes me return errors that can correct me 

View Article


Powershell Tranasctions

I have a Powershell script that gets a list of files from a SQL PROC.For each file, it then moves a file, then updates a DB record, then inserts a DB record.How can I encapsulate the whole process (IO...

View Article

Extract data into a HTML table from multiple sql servers using powershell

$Header = @"<style>TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black;...

View Article


do not display empty folders on the report

$Header = @"<style>TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black;...

View Article

Programmatically trigger an event on a WinForms object in Powershell

Hi all,Let's say I've got a label ($ObjLabel) and a checkbox ($ObjCheckBox), that is created not checked, and added to my form.I've got code in the CheckedChanged event that changes the text in the...

View Article

Move files without moving subfolder files

I have been tasked with building a powershell file mover to move files (which could have any name and possibly no extensions) from one share to another. My problem is the source share has a subfolder...

View Article
Browsing all 467 articles
Browse latest View live