I still cannot get this script to work completely. It will not append the
SamAccountName to the end of the home drive share.
#Set AD Home Folder path.
Start-Transcript -Path "C:\Temp\transcript.txt"

$targetOU = "OU=Accounts,OU=Employees,OU=BR-General,OU=Information
Technology,DC=ghsbtr,DC=net"

Get-ADUser -ResultSetSize $null -Filter * -SearchBase
"OU=Accounts,OU=Employees,OU=BR-General,OU=Information
Technology,DC=ghsbtr,DC=net" | Foreach-Object {
    $sam = $_.SamAccountName
    Set-ADuser -Identity $sam -HomeDrive "K:" -HomeDirectory
"\\ghsmsdfsfs1\UserData\$($_.SamAccountName)"
}
Stop-Transcript

The result it gives is \\ghsmsdfsfs1\UserData\
I need it to give this result \\ghsmsdfsfs1\UserData\lemmitt

Any help is greatly appreciated.


-- 
T. Todd Lemmiksoo

Reply via email to