Quantcast
Viewing all articles
Browse latest Browse all 21975

how to get log for each share

Hi, everyone i m new in powershell and scripting 
looking for your advie on below query 

Here i am not able to get the log as per requirment 

my requirment is  to get the log for each shares in the $shares

PS C:\Temp> $shares = Get-Content .\sharefolders.txt
PS C:\Temp> $shares
\\dc-02\c$\Temp
\\dc-03\c$\Temp

PS C:\Temp> $sharelog = $shares -replace "\\", "_"
PS C:\Temp> $sharelog
__dc-02_c$_Temp
__dc-03_c$_Temp

foreach ($share in $sharenames)
{
Robocopy $shares c:\temp /E /L /NFL /R:0 /W:0 /BYTES /Log:??????
 }

now how to set the value for Log:????

i want different file with $sharelognames 

__dc-02_c$_Temp.log
__dc-03_c$_Temp.log

Ashish Gaur


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>