I don't think I can use https://docs.dbatools.io/Export-DbaScript. I cannot get it to work. Still looking for TSQL code that will work.
Using TSQL How to Script All SQL Server Agent Jobs into One File
I am trying to find TSQL that will script all the SQL Server Agent Jobs into one File. I haven't found anything yet. Can someone point me to an URL that I can look into?
We are uninstalling SQL Server Standard and installing SQL Server Developer, thus, I have to script out the jobs into a file on a directory in a server before the uninstall and after installing SQL Server Developer then I can execute the file.
Developer technologies | Transact-SQL
SQL Server | Other
9 answers
Sort by: Most helpful
-
-
Olaf Helper 47,581 Reputation points2022-10-11T10:00:36.83+00:00 The term 'Get-DbaAgentJob' is not recognized as the name of a cmdlet,
You have to install/import the CmdLet first, see https://dbatools.io/download/
-
LauraC 21 Reputation points
2022-10-13T01:32:52.777+00:00 This is what I have typed in..........................................
PS C:\Windows\system32> Install-Module dbatools
PS C:\Windows\system32> Get-DbaAgentJob -SqlInstance DEV01 | Export-DbaScript -FilePath C:\Users\UserNameHere\export.sql -Append
WARNING: [21:15:50][Get-DbaAgentJob] Failure | The network path was not foundPS C:\Windows\system32> Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
PS C:\Windows\system32> Install-Module dbatools
PS C:\Windows\system32> Get-DbaAgentJob -SqlInstance DEV01 | Export-DbaScript -FilePath C:\Users\UserNameHere\export.sql -Append
WARNING: [21:23:14][Get-DbaAgentJob] Failure | The network path was not foundPS C:\Windows\system32>
What does this error "WARNING: [21:23:14][Get-DbaAgentJob] Failure | The network path was not found" mean?
What am I doing wrong? -
LauraC 21 Reputation points
2022-10-18T03:11:51.627+00:00 I was finally able to get dbtools to work. But I am being told that we cannot use it because it is a 3rd Party Tool. Is that true? Is it considered a 3rd Party Tool?