NT AUTHORITY \ ANONYMOUS LOGON的“Restore-SQLdatabase”登录失败

时间:2013-04-25 18:34:41

标签: sql-server-2012 powershell-v2.0 database-backups database-restore

我有一个用于数据库备份/恢复的PowerShell脚本。出于某种原因,我使用new-pssessioninvoke-command远程执行脚本。我是

1.connecting to remote server
2.the local server is in a domain
3.the remote server is in same domain
4.Using the domain account which exist in both the machine and have admin rights.
5.My SQL Service (I mean the instance/engine) is running with 
  the same Domain account

备份命令Backup-SQLdatabase成功,但恢复Restore-SQLdatabase失败 错误Login failed for NT AUTHORITY\ANONYMOUS LOGON

仅仅是因为试用/错误我将“NT AUTHORITY \ ANONYMOUS LOGON”添加到了必须进行恢复但没有运气的机器中的管理员组。

任何线索我做错了什么(或者)如何解决这个问题。

感谢您的帮助。

感谢。

编辑: -SQLTrustedConnection切换是否可以解决此问题?

1 个答案:

答案 0 :(得分:0)

尝试了一下之后我找到了一个技巧。恢复必须发生的机器我作为用户添加了“NT AUTHORITY \ ANONYMOUS LOGON”。

如何添加:

使用SSMS连接到数据库实例 - >扩展安全性 - >展开登录 - >右键点击登录 - >创建新登录