Hallo Ich muss das Benutzerprofil von mehreren PCs sichern, kann ich einige globale Befehle wie% Userprofile% für meinen Code verwenden, um den angemeldeten Benutzer zu sichern. Auch warum ist mein Skript nicht korrekt, die Ordner zu sichern, die ich ihm erzählt habe. Die Ausgabe ist derzeit nicht verfügbar, es sagt nur, dass Sie mehr Rechte benötigen, um diese Ordner zu öffnen. Userprofile Robocopy Backup
$Destination=Read-Host "Please type the path directory you want to copy the backup files" #destination
$Folder=Read-Host "Please type the root name folder" #name of backup folder
$validation=Test-Path $Destination #validate the destination if it has the privileges
New-PSDrive -Name "Backup" -PSProvider FileSystem -Root $Destination #temporary folder for the backup
if ($validation -eq $True){
Set-Location Backup:
}
else{
Write-Host "Error!Run Script Again"
break
}
robocopy "C:\Users\user\desktop" $Destination\$Folder *.* /mir /sec
robocopy "C:\Users\user\pictures" $Destination\$Folder *.* /mir /sec
robocopy "C:\Users\user\documents" $Destination\$Folder *.* /mir /sec
Function Pause{
Write-Host "Backup Sucessfull!!! `n"
}
Pause
Dank Ich denke, es hat funktioniert, aber das Problem, das ich jetzt mit Blick habe, ist, wenn ich am Ausgang aussehen – Valentino
Es sieht wie folgt aus: – Valentino
http://imgur.com/a/5AZNa Ich hoffe, dass Sie mir helfen können – Valentino