| View previous topic :: View next topic |
| Author |
Message |
marculos Newbie
Joined: 08 Feb 2007 Posts: 17
|
Posted: Mon Sep 17, 2007 2:55 pm Post subject: Finding all user profile usernames |
|
|
Hi,
Is there an easy was to find out all the users who have logged on to a pc i.e. what are the usernames that have a profile in C:\Documents & Settings ?
I need to find out all the usernames so I can write registry keys for each user that has a profile.
Any help would be most appreciated. |
|
| Back to top |
|
 |
marculos Newbie
Joined: 08 Feb 2007 Posts: 17
|
Posted: Mon Sep 17, 2007 4:01 pm Post subject: |
|
|
I have just done some more testing and what I need to do is the following
I need to write a registry key in HKEY_CURRENT_USER for every user on a pc
e.g. when logged in as local administrator
for user1 profile create
HKEY_CURRENT_USER\Software\Lotus\Notes\Installer\DATADIR = c:\user1\data
for user2 profile create
HKEY_CURRENT_USER\Software\Lotus\Notes\Installer\DATADIR = c:\user2\data
Is this possible ?? |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Sep 17, 2007 5:04 pm Post subject: |
|
|
This way might help you some on your way.
| Code: | list create,1
list regkeys,1,USERS
info Available profiles:@cr()@cr()@text(1)
%z = 0
while @unequal(%z,@count(1))
%%Username = @regread(USERS,@item(1,%z)\Volatile Environment,Username)
info "registry write,USERS,"@item(1,%z)"\Software\Lotus\Notes\Installer\DATADIR,"%%Username
%z = @succ(%z)
wend
list close,1 |
I don't know if the \Volatile Environment is there for every account or only accounts of users that are logged on, but you might be able to find the username somewhere else in the HKEY_USERS registry root key as well.  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
marculos Newbie
Joined: 08 Feb 2007 Posts: 17
|
Posted: Mon Sep 17, 2007 5:57 pm Post subject: |
|
|
Many thanks for this.
When I run this script I get missing parameter to command for
list regkeys,1,USERS
Am I doing something wrong ? |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Tue Sep 18, 2007 9:28 am Post subject: |
|
|
It works fine here.
You could also use:
| Code: | list create,1
list filelist,1,@env(SystemDrive)\Documents and Settings,D
info Available profiles:@cr()@cr()@text(1)
list close,1
stop
|
Though I wouldn't hard code 'Documents and Settings'. Instead you'll need to have your script work out what the PC's Documents and Settings directory is called and where it is located. _________________ cheers
Dave |
|
| Back to top |
|
 |
|