Periodically, I'm asked to change my password, and if I'm not logged out from every server, it can cause all sorts of issues.
Ignore everything below. This is so much easier than I was making it.
PsLoggedOn will simply scan your network and tell you where you're logged on. Not sure how I missed this!
PsLoggedon.exe -l MyDomain\MyUser
There is a WMIC command that can be used to see where you're logged in at on the network. This is probably the recommended way if you're running newer servers.
However, we still have a lot of older servers that don't fully support WMIC. I therefore take the following approach:
From command prompt, run
NET VIEW | FIND /I "DB" > SERVERLIST.txtThis populates the list with all DB servers (per our naming conventions).
I then run
NET VIEW | FIND /I "AS" >> SERVERLIST.txtThis, per our naming conventions, appends the app servers (hosting jboss or WebSphere).
Note the >>, so that the SERVERLIST.txt is not overwritten by the output redirection.
I then execute PSLOGGEDON (download from sysinternals/PSTools) as follows:
for /F %i in (SERVERLIST.txt) do PsLoggedon.exe -L %i >> loggedon_output.txt 2>&1This will read the systems in SERVERLIST.txt and, for each one, execute the PSLoggedon.exe -L command. Output will be piped to loggedon_output.txt.
NOTE: loggedon_output.txt is not truncated at any point. If you're like me and tend to run this from the same place over and over again, you'll need to clean it up manually before you begin.
Good luck :-)