Hello,
I want to use Powershell toolkit 3.3 to throttle SnapVault relation at a specific time of the day. I can run the script successfully from the powershell command line. The same script will fail if I run it in the Micsosoft task schedular of Win 2012R2 using system account. I've tried to right click on the script in the task scheduler, and then run it but the script stays in "running" state forever. I added a couple of commands to write text to a log file to know where the script stops at, and I found it stops at "connect-nacontroller filer_ip -Credential $cred"! Please note that system account has full right on the machine. Here's the script:
I ran the following commands to store the secure pass in a file:
$secureString = Read-Host -AsSecureString "Enter password to convert to secure string"
$secureString | ConvertFrom-SecureString | Out-File -PSPath "C:\ps.txt"
-------------------------- script start from here
$secureString = Get-Content -PSPath "C:\ps.txt" | ConvertTo-SecureString
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "username",$secureString
connect-nacontroller filer_ip -Credential $cred
Set-NaSnapvault -PrimarySystem primary_filer -PrimaryPath /vol/vol_name -SecondaryPath /vol/vol_name -MaxTransferRate 4mb
exit
Do you have any idea what's going on or how to fix it?
Appreciate your quick help!
Thanks,