Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для sunnykey

Пользователь


Сообщения: 124
Благодарности: 47

Профиль | Отправить PM | Цитировать


Код: Выделить весь код
#Powershell script.
#Don't forget unlock script executing by 
#using command "Set-ExecutionPolicy RemoteSigned" or "Set-ExecutionPolicy Unrestricted"
#Save this file with ".ps1" extension
$dest="g:\folder\"
function CopyFromDisk($ip,$cred) {
    New-PSDrive -Name P -Root "\\$ip\folder" -PSProvider FileSystem -Credential $cred
    Get-ChildItem p:\* -Recurse -Force | Copy-Item -Destination "$dest\$ip" -Recurse -Force
    Remove-PSDrive -Name P
}

$cred=Get-Credential
for ($i=2;$i -lt 255;$i++) {
    CopyFromDisk -ip "10.11.0.$i" -cred $cred
}

-------
cmd умри, powershell живи=)
Powershel 4.0 microsoft.com/ru-ru/download/details.aspx?id=40855


Отправлено: 16:40, 24-09-2013 | #8