Log off session script

I need to create a script which log off all the users sessions in citrix server at night.can anybody help me in such script?
alaayehya1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alaayehya1Author Commented:
I need to logoff both the active sessions and the disconnected sessions.disconnecting the sessions will not help me solve my problems and maintains the profiles on the server.
0
bigbunk390Commented:
Take a look at this one.
http://www.dabcc.com/article.aspx?id=2859

You could create a batch file and place it on the server that calls the command from the site above.
You then create a scheduled task to run the batch at the time you desire.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

bigbunk390Commented:
Here is the link to the site that has the latest version of the file described in the link I provoded above:

http://www.ctrl-alt-del.com.au/CAD_Utils.htm

Scroll down near the bottom of the page to find it. It says it allows you to logoff all sessions and/or disconnected sessions.
0
alaayehya1Author Commented:
thank you bigbunk390

but here i have 1 more question can i write this in a script  as batch file then create task and execute it from the server or no I need to download the freeware and setup it on the server.

would you please tell me how we write this in a script?

thanks
0
bigbunk390Commented:
Yes, you can create a batch file and have task scheduler run it.
You will need to download the file and have it on the server if the task is going to be ran on the server.
The batch would look like this (if the batch file and the tslogoff file should be in the same directory for ease but can be placed anywhere; just make sure the path is correct):

@echo off
TSLogoff ALL
exit


If you wanted to run the batch from say your workstation and log off sessions on 2 servers; you would download the file to your computer and the batch would look like this (the batch will need to run as a user that has rights on the server to log users off; like an admin):

@echo off
TSLogoff ALL /SERVER:Server1
TSLogoff ALL /SERVER:Server2
exit
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alaayehya1Author Commented:
it's partially solved
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.