How can i List / Set users profile path, HomeFolder, Logonscript?

Well use ActiveRoles Managment Shell for Active Directory!

Like Vmware Powercli, Quest ActiveRole is an addin for powershell. You can download it here.

Ok, now the script!

Thanks for ServerFault about how to create the folder with correct permissions.

#**********************************************
# Check and Set User Tse Profile
# Abdi Medhi
# www.medkorp.com/DoTheJob
#**********************************************

# Add QAD Snap-In
if ( (Get-PSSnapin -Name quest.activeroles.admanagement -ErrorAction SilentlyContinue) -eq $null )
{
    Add-PSSnapin quest.activeroles.admanagement
}

Function SetupProfile
{
Write-Host " "
Write-Host "Setup User Profile"
$Username = get-qaduser	$user
$Login = $Username.logonname

#TSE Profil
$Profil = "\\Magneto.super-vilains.bad\tseprofile$\" +$Login
$HomeDir = "\\Magneto.super-vilains.bad\tseHomeDir$\" +$Login
$HomeDirLetter = "W:"

#Setup User Folder HomeDir
Write-Host "Creating User Folder" -ForegroundColor Yellow

$Folder = New-Item -Path $HomeDir -Name $Login -ItemType Directory
$Rights = [System.Security.AccessControl.FileSystemRights]::FullControl
$Inherit=[System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
$Propagation=[System.Security.AccessControl.PropagationFlags]::None
$Access=[System.Security.AccessControl.AccessControlType]::Allow
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("$Login",$Rights,$Inherit,$Propagation,$Access)
$ACL = Get-Acl $HomeDir
$ACL.AddAccessRule($AccessRule)
$Permission = Set-Acl $HomeDir $ACL

get-qaduser $user | set-qaduser -TsProfilePath $Profil
get-qaduser $User | set-qaduser -TsHomeDirectory $HomeDir
get-qaduser $User | set-qaduser -TsHomeDrive $HomeDirLetter

$Result = Get-QADUser $User

Write-Host "UserName: " $Result.name -ForegroundColor Green
Write-Host " "
Write-Host " Citrix ProfilPath: " $Result.TsProfilePath -ForegroundColor Green
Write-Host " Citrix HomeFolder: " $Result.TsHomeDirectory -ForegroundColor Green
Write-Host " Citrix HomeFolder Drive: " $Result.TsHomeDrive -ForegroundColor Green
Write-Host
}

$User = Read-Host "Enter UserName (windows login)"
Write-Host " "
$Result = Get-QADUser $User

Write-Host "UserName: " $Result.name -ForegroundColor Green
Write-Host " "
Write-Host " Citrix ProfilPath: " $Result.TsProfilePath -ForegroundColor Yellow
Write-Host " Citrix HomeFolder: " $Result.TsHomeDirectory -ForegroundColor Yellow
Write-Host " Citrix HomeFolder Drive: " $Result.TsHomeDrive -ForegroundColor Yellow
Write-Host
Write-Host "=====================================";
Write-Host " Setup User Tse Profile ." -ForegroundColor Yellow ;
Write-Host "=====================================";
Write-Host "1. Yes";
Write-Host "2. No";

$Result = Read-Host "Choose Options"
write-host ""

      Switch ($Result)
      {
      1 {"Yes" ;
      SetupProfile}
      2 {"No" ;
	  Write-Host "No modification made";
	  exit}
	}

The script ask you for a username (windows login name) and show if use have already Tse settings. After the script will ask you if you want to setup the user Tse Profile.powershell-1

if you choose “Yes”:powershell-2

You can check in AD the Tse Profile is set

powershell-3