powershell's questions - English 1answer

261 powershell questions.

We are using SSDT Visual Studio Database projects. I modified single table (eg added column, etc), and want to deploy new table in two Dev/QA instances. I do Not want to publish other changes in the ...

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 moved the report server from one server to another. Now I need to change the Shared Dataset url in the 300 report definition, from server_1 to server_2. Below is a bit of problematic source in XML: ...

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 ...

I'm trying to execute a powershell script, and use a proxy to do. The job runs correctly, but using whoami within the script to log the executing user indicates that the script is not being run by the ...

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 . ...

I want to report on failed Sql Agent jobs using Get-SqlAgentJobHistory but excluded jobs that were not invoked by the service account. I'm running this cmd: Get-SqlAgentJobHistory -ServerInstance $...

I'm trying to get a list of all the AD groups along with their sub groups. It should be recursively populated and then displayed with the following column style Parent_Group, Child_Group_Level1, ...

I need to extract AD groups and all of it's subgroup into an excel sheet.Basically the script should loop though each of the AD group and get their subgroup. AD_Group Subgroup ---------- -----...

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

Our Database exists in many different scripts within our source control. i.E. every table has it's own scripts for creating the table, the indexes and so on. When needed, we can rebuild the entire ...

We have source control in Visual Studio Database Projects (SSDT). To make cross database references, we utilize something like this below in Project References. We need Project references, since ...

I'm creating a PowerShell job step to perform index stats in parallel. The job is designed to perform index maintenance on alternating databases based on database ID & the day of week. Originally, ...

When i try insert statement on heroku postgres console the arabic character appear "????" On linux every thing work fine, but on Win 10 Powershell is seems that there is problem with encoding ...

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 ...

I'm unable to get the DBAChecks Powershell module to work. I'm new to Powershell, I've been able to use DBATools, but getting errors when I'm attempting to use DBAchecks. I've attempted to use the ...

I'm experimenting with source controlling my SQL Agent Jobs & Schedules as .json files and deploying them with the dbatools SQL Agent command suite. Given $sa = Get-Credential and foo.config of ...

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 ...

I followed the instruction at https://dbatools.io/offline/: download zip & unzip run $env:PSModulePath to find all the paths. copy to C:\Program Files\WindowsPowerShell\Modules. run Get-ChildItem ...

Using the script below I find out where are the data and log folders: declare @rc int, @dir nvarchar(4000) declare @data nvarchar(4000) declare @log nvarchar(4000) ...

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 ...

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 ...

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 ...

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 ...

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, ...

Related tags

Hot questions

Language

Popular Tags