Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm calling xcp in a powershell script and i would like to capture exit code and the total files copied and\or scanned.
PS md $($account.newhome)
PS C:\netapp\xcp\xcp.exe copy $account.homedirectory $account.newhome
Below is an example of the last 5 lines output to screen:
57,262 scanned, 0 errors, 0 skipped, 57,259 copied, 34.1GiB (0/s), 9m50s
57,262 scanned, 0 errors, 0 skipped, 57,259 copied, 34.1GiB (0/s), 9m55s
57,262 scanned, 0 errors, 0 skipped, 57,261 copied, 36.9GiB (63.1MiB/s), 9m59s
Sending statistics...
Error sending statistics
Solved! See The Solution
1 ACCEPTED SOLUTION
robh-at-work has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"RTM"
i took one last look in the manual and found the line
"The output of XCP SMB commands can be redirected using the “>” operator. For example:"
# 2c write source and destination to a file just in case + create log file as samusername.txt
write-output $account.name "has a home directory located here:", $account.homedirectory | out-file -filepath C:\test\moving.txt -Append
write-output "wer're moving it here:", "$($account.newhome)`n" | out-file -filepath C:\test\moving.txt -Append
write-host $account.samaccountname "log file", $account.homedirectory | out-file -filepath C:\test\user_logs\"$($account.samaccountname).txt"
# 2d make new HomeDirectory based on samaccountname and xcp to new storage array
# then set aduser homedirectory path and drive in profile and also remove any login.vbs
md $($account.newhome)
C:\netapp\xcp\xcp.exe copy $account.homedirectory $account.newhome | out-file -filepath C:\test\user_logs\"$($account.SamAccountName).txt"
set-aduser -Identity $($account.samaccountname) -Homedirectory $($account.newhome) -HomeDrive "H:" -ScriptPath " "
1 REPLY 1
robh-at-work has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"RTM"
i took one last look in the manual and found the line
"The output of XCP SMB commands can be redirected using the “>” operator. For example:"
# 2c write source and destination to a file just in case + create log file as samusername.txt
write-output $account.name "has a home directory located here:", $account.homedirectory | out-file -filepath C:\test\moving.txt -Append
write-output "wer're moving it here:", "$($account.newhome)`n" | out-file -filepath C:\test\moving.txt -Append
write-host $account.samaccountname "log file", $account.homedirectory | out-file -filepath C:\test\user_logs\"$($account.samaccountname).txt"
# 2d make new HomeDirectory based on samaccountname and xcp to new storage array
# then set aduser homedirectory path and drive in profile and also remove any login.vbs
md $($account.newhome)
C:\netapp\xcp\xcp.exe copy $account.homedirectory $account.newhome | out-file -filepath C:\test\user_logs\"$($account.SamAccountName).txt"
set-aduser -Identity $($account.samaccountname) -Homedirectory $($account.newhome) -HomeDrive "H:" -ScriptPath " "
