Announcement

Collapse
No announcement yet.

TS Profile management script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • TS Profile management script

    We often need to delete the roaming profiles of terminal servers (Citrix) for an application that is load balanced across 32 servers.

    Instead of manually checking every server and the networkshare for the profile .
    As it is load balanced, we do not know on which server a profile has been created.
    I wanted to create a batch.
    I started of with the following, but it doesn't work.
    I would like some advice on how best to do it:
    What i got so far:
    Code:
    Echo Enter the profile that needs to be removed from the application acceptance servers
    Echo.
    Set "Target=\\Servername\Share$\Documents and Settings"
    
    SET UserProfile=
     Set /P UserProfile=" UserProfile: "
    
    Rem Local copy of the profile
    
    IF Exist "%Target%"\"%UserProfile%" ,(
       Del /Q "%Target%"\"%UserProfile%"
           )Else (
                  ECho Profile does not exist on "%Target%"
                 )
    
    Rem Roaming copy of the profile
    
    Set "Roaming=\\servername\Share$\Profiles\"%UserProfile%"
    
    If Exist "%Roaming%" ,(
       Del /Q "%Roaming%"
           )Else (
                  ECho Profile does not exist on "%Target%"
                 )
    Set "Redir=\\Servername\share$\Redir\"%UserProfile%"
    
    Rem Redirected profile folders
    
    If Exist "%Redir%" ,(
       Del /Q "%Redir%"
           )Else (
                  ECho Profile does not exist on "%Target%"
                 )
    Thx for the help!
    Last edited by Killerbe; 19th August 2008, 15:35.
    [Powershell]
    Start-DayDream
    Set-Location Malibu Beach
    Get-Drink
    Lay-Back
    Start-Sleep
    ....
    Wake-Up!
    Resume-Service
    Write-Warning
    [/Powershell]

    BLOG: Therealshrimp.blogspot.com
Working...
X