Active IQ Unified Manager Discussions

Running a WFA backup from the Command Line

fenton
4,403 Views

Hi,

I am trying to run a backup from the WFA Command Line:

{WFA_INSTALL}/bin/Backup.ps1 admin admin c:\TEST\Test.backup

I consistently getting the following failure:

PS C:\Program Files (x86)\NetApp\WFA\bin> ./Backup.ps1

Exception calling "backup" with "1" argument(s): "Caller unauthorized"

At C:\Program Files (x86)\NetApp\WFA\bin\Backup.ps1:16 char:38

+ $returnString = $backupService.backup <<<< ($FileName)

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : DotNetMethodException

Clearly my user id is valid as I can login via the portal;  

Any pointers ?

Cheers

Rich

1 ACCEPTED SOLUTION

fenton
4,403 Views

Firstly you need to define a backup user with the WFA portal;  Login to WFA as admin and create a new user (I called mine "backup") and give him a role of backup; Do this via:

Tools > Users > (right click New) or Actions > New

This user is required to run the backups via the CLI (Note: you will get Unauthorised access if you try and login to the WFA portal using this user ID)

Next login into the WFA Server and launch a Command Prompt:

and run:

cd "C:\Program File (x86)\NetApp\WFA\bin"

powershell .\Backup.ps1 "backup username" "backup password" "filename for the backup"

(the command/script will return the complete filename for the backup)

Note: In order to run Powershell script on your server you may have to Enable Script Support - this post will show you how:

http://www.tech-recipes.com/rx/2513/powershell_enable_script_support/

Note 2: depending on what you tried initially you may find that PowerShell caches your credentials - if after the above your still getting un-authorised access errors;  close your command prompt window and retry

Many thanks to Dekel for helping me sort this...

View solution in original post

3 REPLIES 3

fenton
4,404 Views

Firstly you need to define a backup user with the WFA portal;  Login to WFA as admin and create a new user (I called mine "backup") and give him a role of backup; Do this via:

Tools > Users > (right click New) or Actions > New

This user is required to run the backups via the CLI (Note: you will get Unauthorised access if you try and login to the WFA portal using this user ID)

Next login into the WFA Server and launch a Command Prompt:

and run:

cd "C:\Program File (x86)\NetApp\WFA\bin"

powershell .\Backup.ps1 "backup username" "backup password" "filename for the backup"

(the command/script will return the complete filename for the backup)

Note: In order to run Powershell script on your server you may have to Enable Script Support - this post will show you how:

http://www.tech-recipes.com/rx/2513/powershell_enable_script_support/

Note 2: depending on what you tried initially you may find that PowerShell caches your credentials - if after the above your still getting un-authorised access errors;  close your command prompt window and retry

Many thanks to Dekel for helping me sort this...

dcornely1
4,403 Views

Hello,

This is a great new feature in WFA, thank you!

One thing I'd like to ask is does anyone know how I could append a date string to this backup file name?  This would enable me to run this from a backup program like Netbackup and easily add a new file each day.  Thanks!

-Dave

fenton
4,403 Views

You cold wrap the command above into a batch or power shell script and pass a date string to the output file name

I'll see if I can whip up a script to do this in the next couple of days

Public