Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Adding a file to each users Home Drive

$
0
0

Afternoon

I have a directory with over 200 users listed within (it is their homes drive)

i wish to place a file i have in each users home drive using powershell

however i have the path \\locationtohomedrivearea\users.name

Basically what i want to happen is to copy a file from a central location to each individual users drive above but i appear to have issues with powershell creating a full path for each individual user

My syntax i am using is as follows

$root = "locationtousershomedrivearea"
$user = GCI $root
foreach($user in $users){
$fullpath = "$root" + "\" + "$user" }

Write-Host $fullpath

I could then use the full path to move a file to for each user and in future re use this to rename files within the users home drive etc

if you could point me in the right direction that would be great

Barrie


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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