09-19-2012 06:01 PM
I found a solution to unlock the library via powershell (http://www.symantec.com/connect/forums/scheduling-unlock-job-be2012). When I try to run the command I receive the following error:
PS C:\Users\sysadmin> c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
Submit-BEUnlockJob -RoboticLibraryDevice '"Robotic library 00009"'
The term 'Submit-BEUnlockJob' is not recognized as the name of a cmdlet, functi
on, script file, or operable program. Check the spelling of the name, or if a p
ath was included, verify that the path is correct and try again.
At line:1 char:19
+ Submit-BEUnlockJob <<<< -RoboticLibraryDevice Robotic library 00009
+ CategoryInfo : ObjectNotFound: (Submit-BEUnlockJob:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\sysadmin>
I tried changing Submit-BEUnlockJob to -Submit-BEUnlockJob but I still get errors;
PS C:\Users\sysadmin> c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
-Submit-BEUnlockJob -RoboticLibraryDevice '"Robotic library 00009"'
Missing expression after unary operator '-'.
At line:1 char:2
+ - <<<< Submit-BEUnlockJob -RoboticLibraryDevice Robotic library 00009
+ CategoryInfo : ParserError: (-:String) [], ParentContainsErrorR
ecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
PS C:\Users\sysadmin>
I don't know much about powershell or how to fix the error, any help would be appricated.
Also which part of the backup job do I add the unlock script to?
Solved! Go to Solution.
09-19-2012 06:50 PM
You can either put the import-module and the submit-beunlockjob cmdlets in a script and schedule the script, or do it in-line. See this document for some examples.
http://www.symantec.com/docs/TECH189795
09-19-2012 06:12 PM
You need to import the BEMCLI module before you can use any BEMCLI cmdlet. See my article below on how to do the import.
https://www-secure.symantec.com/connect/articles/preparing-your-powershell-environment-run-bemcli-and-scripts
09-19-2012 06:28 PM
Any other way to unlock the library via a scheduled task?
09-19-2012 06:49 PM
I've followed your guide and it's still not working.
With get-executionpolicy -list I receive the following:
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
I've run import-module "\program files\symantec\backup exec\modules\bemcli\bemcli" via BE Management Console.
PS error:
PS C:\Users\sysadmin> c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
Submit-BEUnlockJob -RoboticLibraryDevice '"Robotic library 00009"'
The term 'Submit-BEUnlockJob' is not recognized as the name of a cmdlet, functi
on, script file, or operable program. Check the spelling of the name, or if a p
ath was included, verify that the path is correct and try again.
At line:1 char:19
+ Submit-BEUnlockJob <<<< -RoboticLibraryDevice Robotic library 00009
+ CategoryInfo : ObjectNotFound: (Submit-BEUnlockJob:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\sysadmin>
09-19-2012 06:50 PM
You can either put the import-module and the submit-beunlockjob cmdlets in a script and schedule the script, or do it in-line. See this document for some examples.
http://www.symantec.com/docs/TECH189795
09-19-2012 06:53 PM
The import-module cmdlet must be run for each powershell session or script. It is not a one-time thing. You must import the module for every run. If you want to automate the import-module, put it in the profile. See my article which I have referenced above.
09-19-2012 08:15 PM
I am getting closer.
In unlocklib.ps1 I have:
import-module bemcli
Submit-BEUnlockJob -RoboticLibraryDevice '"Robotic library 00001"'
I have tried changing "Robotic library 00009"' to "Robotic library 00001"'. but I get the following error:
PS C:\scripts\BackupExec> C:\scripts\BackupExec\unlocklib.ps1
Submit-BEUnlockJob : Cannot bind parameter 'RoboticLibraryDevice'. Cannot convert value ""Robotic library 00001"" to type "BackupExec.Ma
nagement.CLI.BERoboticLibraryDevice". Error: "Cannot find any RoboticLibraryDevice objects with the name "Robotic library 00001"."
At C:\scripts\BackupExec\unlocklib.ps1:2 char:41
+ Submit-BEUnlockJob -RoboticLibraryDevice <<<< '"Robotic library 00001"'
+ CategoryInfo : InvalidArgument: (:) [Submit-BEUnlockJob], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,BackupExec.Management.CLI.Commands.SubmitBEUnlockJobCommand
I am not sure how to work out which library to use, could you point me in the right direction?
We dont' have anyone to manage BE full time, thanks for your help thus far.
Edit found the command in the original post of mine to run: Get-BERoboticLibraryDevice. I am waiting for the process to finish.
09-19-2012 08:16 PM
Here is the result from Get-BERobo...
PS D:\Program Files\Symantec\Backup Exec> Get-BERoboticLibraryDevice
Name StorageType Active Paused Disabled Servers
---- ----------- ------ ------ -------- -------
IBM 2 RoboticLibraryDevice False False False {VSDOM01}
PS D:\Program Files\Symantec\Backup Exec>
09-19-2012 08:37 PM
You need to use this
Get-BERoboticLibraryDevice "IBM 2" | Submit-BEUnlockJob -confirm:$false
09-19-2012 08:41 PM
Thank you :)