Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Automatic Log off via username if possible

I am moving a TERMINAL SERVER between domains and need to preserve contents of the users profiles, i.e. There desktop folder. The way I plan on doing this is via a vb app that will log onto the server under the new domains username and then log off again (just to create the new profile folder) Once that done I will get my app to grab the contents of their profile from the old domian (c:\documents and settings\user.olddomain) to their new profile (c:\documents and settings\username.newdomain)

I have worked out how to automate all of it other than the logoff (tried using send keys...etc) Ideally I want a method of logging them off via username (rather than ts session id as that would mean knowing the session ID First which wouldn't be automated.

Help! :-)
0
kinton
Asked:
kinton
  • 2
1 Solution
 
McKnifeCommented:
To automate logoff, you could use the command shutdown -l -f
0
 
Jay_Jay70Commented:
or psshutdown from sysinternals has a a logoff switch which works pretty efficiently
0
 
kintonAuthor Commented:
Thanks dudes, a fine answer that worked a treat!
0
 
Jay_Jay70Commented:
glad to hear
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now