重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Powershell:powershell脚本同步备份文件到其他服务器

Remove-PSDrive Z

创新互联建站于2013年创立,先为应城等服务建站,应城等地企业,进行企业商务咨询服务。为应城企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

$User = "192.168.1.1\administrator"
$PassWord = ConvertTo-SecureString -String "Passw@rd" -AsPlainText -Force
$Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PassWord
New-PSDrive -Name Z -PSProvider FileSystem -Root \192.168.1.1\Backup -Persist -Credential $Credential
$timelabe = Get-Date -UFormat "%Y-%m-%d-%H-%M"
Get-date -uformat "%c" >> d:\log\$timelabe.log
echo "Starting synchronize files..." >> d:\log\$timelabe.log
robocopy D:\Backup Z:\ /mir >> d:\log\$timelabe.log
Get-date >> d:\log\$timelabe.log


本文标题:Powershell:powershell脚本同步备份文件到其他服务器
标题路径:http://cqcxhl.com/article/gjeigg.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP