forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Finding all user profile usernames

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marculos
Newbie


Joined: 08 Feb 2007
Posts: 17

PostPosted: Mon Sep 17, 2007 2:55 pm    Post subject: Finding all user profile usernames Reply with quote

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
View user's profile Send private message
marculos
Newbie


Joined: 08 Feb 2007
Posts: 17

PostPosted: Mon Sep 17, 2007 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Sep 17, 2007 5:04 pm    Post subject: Reply with quote

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. Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
marculos
Newbie


Joined: 08 Feb 2007
Posts: 17

PostPosted: Mon Sep 17, 2007 5:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Tue Sep 18, 2007 9:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group