In my organization, we spend a lot of time changing the path to the user's home folders, based on users changing roles, etc. I wrote a very simple powershell script that sets the homedir path from csv .:
Import-Csv C:\Dir\homedir.csv | ForEach-Object {
Set-ADUser $_.SamAccountName –HomeDirectory $_.HomeDirectory
}
What I would like to do this is to check users for the presence of -profilepath (roaming profile) and change it (if any) to "$_.HomeDirectory"\Profile(all roaming profiles follow this design). If not, it will simply move on to the next user and do the work as needed.
I played with cameramen ifand really did more harm than good. Has anyone got a life buoy that they can leave me with?
source
share