Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:46:54+00:00 2026-06-15T06:46:54+00:00

I am trying to backup a remote database on the LAN to a network

  • 0

I am trying to backup a remote database on the LAN to a network shared drive. I tested using the same approach using .NET and it did work but i am planning to use this PowerShell script withing out Jenkins Continuous Integration tool.

$dbserver = "dbserver"
$location = "\\otherserver\Temp\"
$user = "user"
$pwd = "password"

$timestamp=((get-date).toString("yyyy_MM_dd_hh_mm"))
$file = $location + "jira_" + $timestamp + ".bak"

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null

$connection = New-Object "Microsoft.SqlServer.Management.Common.ServerConnection" 
$connection.ServerInstance =$dbserver
$connection.LoginSecure = $false
$connection.Login = $user 
$connection.Password = $pwd

$server = New-Object "Microsoft.SqlServer.Management.Smo.Server" $connection
$backup = New-Object "Microsoft.SqlServer.Management.Smo.backup"
$backup.Action = 'Database'

$device = New-Object ('Microsoft.SqlServer.Management.Smo.BackupDeviceItem') ($file, 'File')
#$device.DeviceType = 'File'
#$device.Name = $file

$backup.MediaDescription = "Disk"
$backup.Database= "jira"
$backup.Devices.Add($device)
$backup.SqlBackup 

I don’t get any exceptions but also I don’t get any information that can help me troubleshoot my code. Using all available throw, catch, try I can only get.

MemberType          : Method
OverloadDefinitions : {System.Void SqlBackup(Microsoft.SqlServer.Management.Smo.Server srv)}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : System.Void SqlBackup(Microsoft.SqlServer.Management.Smo.Server srv)
Name                : SqlBackup
IsInstance          : True
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:46:55+00:00Added an answer on June 15, 2026 at 6:46 am

    SqlBackup is a method. When you call a method you need to include opening and closing parenthesis:

    $backup.sqlbackup($server)
    

    Omitting the parens will output the method signature instead of calling the method. Omitting the method signature is not an error hence no error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to take remote backup of sql server database using Perl. But somehow getting
I’m trying to backup a SQL08 database to a target on a remote drive
I am trying to backup a database using the PHP system command and mysqldump.exe.
I'm trying to backup my database from a Java application. Currently, I'm using xampp
I'm trying to backup my database through ODBC with vb.net but can't find a
I am trying to backup my Firebird 2.5 database file by code: FbBackup backupSvc
Can anyone help me, I'm trying to backup a database located on localhost\SQLEXPRESS but
I am trying to take database backup. How can I do that when getdate
I am trying to create a backup of my SQL Server Database in Visual
I am trying to restore a database by first restoring a full backup and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.