powershell's questions - English 1answer

248 powershell questions.

I want to monitor the SSRS service. If the service is stopped i want to generate a mail from within SSMS and then restart the service. The problem i am experiencing is getting the PowerShell results ...

I have a tabular model/database in an Azure Analysis Server instance. Model/database has roles and users/groups were added on each role. I can see the list by right click on the role and then go to ...

Can anyone share your inputs on below and how to fix the issue and possible causes of failure? I am trying to restore a DB using PS script and at one step it is failing during the role change test ...

I have a PowerShell job step I'm trying to execute and it's failing with a syntax error I believe is because I'm trying to escape double-quotes in my code. Can anyone take a look and help me with ...

We have a database for each customer, over 700 databases. All the schemas are supposed to be exact same. We have Source Control database, and want to schema compare to the 700. Sometimes schema in ...

I am generating Database Generate scripts with Powershell. What is the option in Powershell to remove Script dates comment lines? Automated Script-generation with Powershell and SMO Object: Table ...

We have a SSIS package that tidies up a few files and folders, and want to automate it to run every night via the SQL Server Agent. When running the package via Visual Studio (2015 and 2017) the ...

I have a powershell script I'm executing as part of a SQL job and it is failing to write to the table. Running as CmdExec, here is my script. powershell.exe "Get-SQLServerUpdates -Version 'SQL ...

Overview: Trying to get all servers with SQL Server or Oracle installed. Troubleshooting: get-service -computername "" works fine when run by itself. But when used in script block of Foreach ...

I'm trying to use ODP.NET in PowerShell to access an Oracle DB. I want to use my existing Oracle Wallet for the connection credentials but I find no hints about how to specify the connect string with ...

Please help me to correct the below code . I am trying to exclude the filename which already received email but -and $i.file -ne $SentUsers not excluding the already sent filenames . Please help me . ...

PS C:\Windows\system32> get-cluster Name ---- sql2012poc_cl1 PS C:\Windows\system32> get-clustergroup Name OwnerNode State ----...

I need to create Windows PowerShell Scripts that will check and list down all SQL Jobs scheduled on a given database server. Is it possible to find out the list using PowerShell Scripts? If yes, how ...

I am trying to create a folder based on the servername\instance to backup up to, i want the folder to create as servername_instance. Could you please point out where i am going wrong as it creates as ...

We have a simple T-SQL script file (.sql), which we execute through Powershell. Everything works fine, except the script portion, where we are using some special characters as string (example: 'ô' ). ...

when I run the following query from Glenn Berry -- Hardware information from SQL Server 2016 (Query 18) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, hyperthread_ratio ...

I have written a powershell script that uses Start-AzureSqlDatabaseExport & Get-AzureStorageBlob to export my Azure DB to a bacpac and download it locally, the next step is to restore the bacpac ...

Trying to delete an existing table using powershell $srv = new-Object Microsoft.SqlServer.Management.Smo.Server(".\CEF_2014_1") $db = New-Object Microsoft.SqlServer.Management.Smo.Database $db = $srv....

I'm implementing the Always Encrypted feature in SQL Server 2016. I have tried to create the certificate using PowerShell in Windows 10 environment as per the below article. https://docs.microsoft....

I have created the encryption certificate using below PowerShell script in dev. environment. Now, I need to create deployment document to configure the encryption on staging environment. $cert = New-...

OS Windows 10 x64. Version of MongoDB 3.6.5 When I'm starting mongo process, I'm always getting: MongoDB shell version v3.6.5 connecting to: mongodb://127.0.0.1:27017/ MongoDB server version: 3.6.5 ...

In config file I have: systemLog: destination: file logAppend: true path: c:\data\log\mongod.log storage: dbPath: c:\data\db journal: ...

I've written a Powershell script that scripts out the appropriate SQL scripts for all databases on a server as well as creating BCP files for the contents of each. This is to allow the restoration of ...

I am lazy and would rather parameterize once (to get an object_id for a name) and use Invoke-SqlCmd for the rest of the work. Given a series of functions meant to work with an arbitrary server ...

I would like to run a Powershell script via the SQL Server Agent. This script works fine if I run it manually through the command prompt, but the job history in SQL Server Management Studio tells me a ...

I am not able run the below stored procedure on SQL server from my command line using powershell invoke sql command(but able to run the below script directly going on to the SQL server) .please help ...

I have a big *.sql file that I run with Invoke-Sqlcmd and variables to do some tasks, and when I have an issue, it's a pain to debug because of the variables and I want to do logging of the SQL script ...

I am trying to get disk space report from bunch of servers and insert them into sql table.. below is sample of what i am trying to do,Server names will be populated from a table and passed as a ...

Our DBA team doesn't verify the backups using the below TSQL (which can easily be done post-backup and takes almost no time, so I don't get why not): RESTORE VERIFYONLY FROM DISK = 'D:\Backups\...

I have an automated third party backup places files on a network drive. I've mapped this drive to a local folder on the DB server using the following PowerShell script $pass ="xxxx"|ConvertTo-...

Recently I was asked to develop a solution by management to reinitialize a transactional replication whenever it fails using powershell. The request was made because our 3rd party vendor restores our ...

I am trying to get disk space report from bunch of servers and insert them into sql table.. below is sample of what i am trying to do set @ps = 'powershell.exe -noexit -c " $computers=Get-...

I'm trying to move the system databases using Powershell ie. without using any T-SQL. Using SMO : Install-Module SQL-SMO $smo = New-SMO -ServerName localhost $smo.databases["TempDB"]....

I get an error when I try to join the secondary replica to the Availability group thru Powershell while following the below Microsoft Documentation. Join-SqlAvailabilityGroup -Path "SQLSERVER:\SQL\&...

I'm trying to work out how to Restore the Latest Backup of a Database that is held on Azure Storage Blobs. This container contains other backups from different databases on a server but I'm only ...

Using SQL Server 2017 Developer Edition The command I'm using is: New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName host.doman.com -KeySpec KeyExchange -FriendlyName ...

Hi all, I installed a SQL server 2016 default instance and a SQL Server 2017 named instance (instance name is SQL17) on my Windows 2012 Server. I opened a powershell windows with administrator mode, ...

I have been trying to get the parameter value for RegisterAllProvidersIP in my AG environment. However, the command is not fetching me all results. The resultset has just 4 parameters, and I'm ...

I'm looking to export SSRS reports from SSRS 2005 into SSRS 2017. I have around 100 reports to move but in total there are around 500 subscriptions across all of these reports. The Script to file ...

My Goal: I'm wanting an excel document showing basic information for each table. I'd be happy with the same information shown when you Alt+F1 on the table but ideally I want a separate sheet per table....

I have a SQL database table containing configuration for a large number of devices. I need to update the value of one of the properties (TemplateID) for about 1000 of these devices, based on a ...

I'm adding records to a postgres database using a powershell script. How can I tell how many records are in a transaction - or to put it another way how can I tell how many INSERT statements were ...

I have a Powershell script that restores a database using the SqlRestoreAsync method. I have a decent size database which I'm restoring (~55Gb) and I'm trying to find the progress of the restore ...

I have a postgres database which I populate via a powershell script. I’m having trouble with the time it takes to for the script to perform an INSERT The powershell script is very simple, it reads ...

I am using PowerShell to automate an export of an access databse (.accdb) to postgresql. As a step of that I am using a VBA script to convert all the table and column names to lowercase so they play ...

I need to update the password for the SSRS Execution account for every 15 days. How can I automate this process using power shell or some other scripting?

I'll do my best to explain this as best I can, but kindly bear with me as I'm not a DBA and hacking my way through this. I'm tasked with ongoing deployment of SQL Server for end user clients on new ...

Long story short I'm working on using PowerShell to automate a nightly DB conversion from access to PostgreSQL. In it's more basic form the script does the following. Copies the .accdb file to a ...

I am seeing the below error when trying to add database in secondary replica during the Always On configuration using powershell. I have granted the ENDpoint connect permission successfully to the ...

In Powershell, I have some data that I am importing from a .csv, and some data points aren't always entered so I need to replace them with [DBNull]::Value. The problem is that when I go to use Write-...

Related tags

Hot questions

Language

Popular Tags