Show All Users Who Have A Profile In NT And 2000 In A List Box
I want to create a List of users how have a profile in NT or 2000. Will I have to program it using the system registery or is there an easier way.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Get All Users Profile Dir Or User List In Win2k Or XP.
Hi !
I tried this code to get all users profile:
' Function API name : GetAllUsersProfileDirectory
' ----------------------------------------------------------------------------
Private Const TOKEN_QUERY = (&H8)
Private Declare Function GetAllUsersProfileDirectory Lib "userenv.dll" Alias "GetAllUsersProfileDirectoryA" (ByVal lpProfileDir As String, lpcchSize As Long) As Boolean
Private Declare Function GetDefaultUserProfileDirectory Lib "userenv.dll" Alias "GetDefaultUserProfileDirectoryA" (ByVal lpProfileDir As String, lpcchSize As Long) As Boolean
Private Declare Function GetProfilesDirectory Lib "userenv.dll" Alias "GetProfilesDirectoryA" (ByVal lpProfileDir As String, lpcchSize As Long) As Boolean
Private Declare Function GetUserProfileDirectory Lib "userenv.dll" Alias "GetUserProfileDirectoryA" (ByVal hToken As Long, ByVal lpProfileDir As String, lpcchSize As Long) As Boolean
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@allapi.net
Dim sBuffer As String, Ret As Long, hToken As Long
'set the graphics mode of this form to 'persistent'
Me.AutoRedraw = True
'create a string buffer
sBuffer = String(255, 0)
'retrieve the all users profile directory
GetAllUsersProfileDirectory sBuffer, 255
'show the result
Me.Print StripTerminator(sBuffer)
'create a string buffer
sBuffer = String(255, 0)
'retrieve the user profile directory
GetDefaultUserProfileDirectory sBuffer, 255
'show the result
Me.Print StripTerminator(sBuffer)
'create a string buffer
sBuffer = String(255, 0)
'retrieve the profiles directory
GetProfilesDirectory sBuffer, 255
'show the result
Me.Print StripTerminator(sBuffer)
'create a string buffer
sBuffer = String(255, 0)
'open the token of the current process
OpenProcessToken GetCurrentProcess, TOKEN_QUERY, hToken
'retrieve this users profile directory
GetUserProfileDirectory hToken, sBuffer, 255
'show the result
Me.Print StripTerminator(sBuffer)
End Sub
'strips off the trailing Chr$(0)'s
Function StripTerminator(sInput As String) As String
Dim ZeroPos As Long
ZeroPos = InStr(1, sInput, Chr$(0))
If ZeroPos > 0 Then
StripTerminator = Left$(sInput, ZeroPos - 1)
Else
StripTerminator = sInput
End If
End Function
'-------------------------------------------------------------------
but its not get all dir
please help me or tell me how to get all users list
thanks !!!
Serverside List Box To Show Connected Users
hi all, can someone help me with designing a serverside listbox ( or treeview or something) that will show me whos connected to my program? Thanks in advance, ill give any details needed to get this going!
Users Profile Path
Can someone assist me in creating a line of code that will get me to the users profile directory. In other words, if he is logged in as Administrator or Joeblogg, I need to get at that dirctory to do some file manipulation.
for ex........ this is part of a batch file
cd %userprofile%
rd "local settings emp"
Ive looked at the API "GetUserName", I think that might work if I use that as a variable and add a "" behind it with the appropriate sub folders but Im hoping for a better way.
thanks in advance
Win XP /Win 2000 Profile Directory
Hi,
I know on Windows 98/Me the user profile is located in the Windows directory, I can access that with "SomeString + "profilesanynamy" But i cannot find a way to access the profiles on Win XP/2000 in c:Document and Settings
Is there a code that will find this directory?
How To Show The BMP To Be Same For All Desktop Users And NoteBook Users
Hai,
I devoloped an VB application in the Win2000 Advanced server. I installed the application to the 2000 Professional and Windows XP users. All the user who have the Desktop is working fine and the bmp in one of my Form is shown correctly. But only for the XP users who have the LapTops i am facing the the problem. I have attached the picture of the Form here.
1. The Picture scr1 is the one the XP LapTops users are getting.
2. The Picture scr2 is the one where all the XP and 2000 Professional users are getting. ACtually this the correct one which i need to show for all the user.
Kindly view the attached picture and tell me how to show a same screen to all the users.
In the Devolopment machine and the XP desktop users have the Pixel 800 by 600 when i set the same for the XP Note book users itks not shwowing fine. its getting too small.
Thank you,
Chock.
Windows 2000 - How To Identify Current Profile
on a network with win2000 where everyone must log in via a network profile, i.e I can login to any machine with my username, how can I get VB to determine which profile is currently logged into on the computer the program is running on?
How Do I Show The Users Current IP
Can Some one please tell me how to show the users current IP in a label lets call the Label1 . How could I get the label to show the current IP?
Thanks in advance!
Show LogIn Users
Hello to all,
Is there a way of knowing all those who are accessing my vb application on the network. I need to show those users in a list when I click the <Show All Login Users> button.
Thanks for sharing.
Best Way To Show Datato Users From SQL ?
Bit of a broad question this but...
Whats going to be the best way to present the user with a view of a table from SQL.
I've done some work using ADO in the past that was non-interactive (just automated updates) so I can work with recordsets etc.. but whats the best control to present to the user.
No updates, just read only.
Essentially, the project is straighforward.
Present the user with a view of the database.
Allow the user to enter search criteria and present them with the results.
So, I'm seeing 2 forms. The first with a view from record 1 (and scroll bars / forward|back buttons) and a second form which shows records matching the search criteria.
Is this where flexigrids are used ?
Just need a point in the right direction.
Thanks
How To Show A Message To Users?
Hello everyone,
I'm doing a COM add-in using VB6. I want to show a message to the user, say "We are updating your form, please wait....." something like that, then this message box disappear automatically. Is there a way to do that in VB6? Anyone can help?
Thanks in advance! Your any help will be greatly appreciated!
Windows 2000 Users...
Has anyone else found that they can't run the API Viewer that comes with VB6 on Win2K?
Other Users Cannot Run My Vb Application In Windows 2000
Hi, everyone,
I have an application written in vb. I packaged it and installed into windows 2000 using local administrator's account. After I installed it, I run it and it works fine for me. But when other user logged on, and tried to run it, it gave a runtime error said something like one of the ocx is not registered correctly or it's dependency file is missing.
All I want to to is that when I install the application, and everyone logged in to the windows would able to run the application.
If someone have idea what I did not do or what I did wrong, it would be thankful for you sugguestions.
thanks.
Win 2000 Users Connected To Files
How would I go about finding out who is connected to a file on a 2000 server? Basically I want to know how to gain access, using vb, to the computer management under administrative tools. There I can see the users connected, but I would like to get this list into vb so I can disconnect users as needed.
Thanks in advance for your help.
Delete Users Windows 2000
How do I delete users in batch from Exchange server (and their mailboxes) in Windows 2000/Exchange 2000?
Thank you
Concurrent Users And Access 2000
Please advise what exactly is a concurrent user.
I have about 200 projects in a Access 2000 database that has 4 relational tables where each project memo field will be updated about 3 - 4 times a week by around 50 users. The Front end will be a Cold Fusion web page.
Is a concurrent user when each owner tries to search/update the same project record at same time? Or is it where users are viewing the database and not actually updating it at the same time? It looks like Access can handle the size of what I am doing but not sure what a concurrent user is and how can I test if my database can handle this?
In my case each user will update their own project a 3 or 4 times a week but maybe 10 or 20 might be viewing their own specific project record at the same time and others will be viewing reports at the same time.
Can Access 2000 handle that?
VB6 And SQL Server 2000, Databse Users And Logins
Hi everyone!
I am working on an application using VB6 and SQL Server 2000.
I have created the database TestDB (using enterprise manager). Also I have created two users of the database, named admin and guest. I have created the logins for the users (under the security node in enterprise manager). The authentication mode is "Both Windows and SQL Server."
Now,
I want to create a form that asks the user to enter the server to connect with, the user name and the password. The interface consists of a combo box of available servers, a combo box for the list of databases on the server, and two text boxes for user login name and password.
1. How can I get the list of available servers??
2. How can I fill the combo box for the database name??
3. How can I verify that the user has the authentication to use the specific database.
I am not going to provide the interface to create the new users. The new users will be created through enterprise manager (but if anyone can tell me that it can be done through vb code easily then I will certainly go for that). But still I want to provide the user an interface to change the password. How can that be done???
Thanks in advance.
Jawad Khan
Detecting Users Logged Into Access 2000
Hi all.
Anyone have any success detecting the users logged into Access 2000? I'm trying to use the MS FAQ #198755 without any success ... It is giving me the error "3251: Object or provider is not capable of performing the requested operation." This is my code:
Code:
Private Sub DetectButton_Click()
On Error GoTo Err_DetectButton_Click
Dim FormsConnect As ADODB.Connection
Set FormsConnect = New ADODB.Connection
FormsConnect.CursorLocation = adUseClient
FormsConnect.Open "DSN=Billing Forms;"
Set MyRecSet = FormsConnect.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
While Not MyRecSet.EOF
MsgBox MyRecSet.Fields(0)
Wend
Set MyRecSet = Nothing
FormsConnect.Close
Set FormsConnect = Nothing
Exit_DetectButton_Click:
Exit Sub
Err_DetectButton_Click:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_DetectButton_Click
End Sub
Any ideas? Thanks.
- Mike
List Of Users
Ok i am looking for a way to get a list of all local users on a Pc, must work on all 9X machines 2000/XP
There is always the obvious, yet wasteful method of enumerating the folders in Documents and Settings/Profiles folder but I was hoping that there was a better way. Any ideas?
List Of Users
hi is it possible to get a list of all the users on a networkand passwords... i'm making a logon with vb for my friends network( i know it sounds stupid but thats what he wants) and i'm not sure how i could a)get a list of users and passwords using vb and b) have it when you click logon it looks through the list of users to see if its a valid user and password
Get List Of All Users On XP/NT?
I foudn out how to get the current user with GetUserName API call the other day - is there a way to get a list of all available users on the computer and fill a listbox with them using API or some other easy call?
Thanks alot!
Users List
I am sure that this has been posted before, however I have been searching all morning and can not find it.
I am looking for a way to get a list of all users. I would like to be able to get a list for both the local machine as well as the network and be able to differentiate between the two, however the main thing I really need now is a list of local users.
List Of Users 98/nt?
hi
i need to retreive the list of users that have logged into the current PC - running win 98 or 2000 etc..
reason - i need to let the user set prefs for each user individually.
thx!
List The XP Users That Are On The Pc
Hi people,
This is my second message so be nice on me , i am still a noob.
I was wondering after some search work, is it possible to list the xp users that are on a the pc when using windows XP.
Example:
You open the program, and the program will return a list of all the users that are on the pc. (only working on windows xp I gues).
list1:
1. Mark
2. Linda
3. Peter.
4. etc...
Does somebody has the source code for this? or has a helping hand in the right direction.
Thanks in advance, Devoney
Getting Users List - Need Help.
hey all,
I need a solution for the following problem, which I have to implement using VBScript.
Basically the idea is to collect the number of users, whose password have been expired.
1) I have to collect these users from Userlist as well as from User groups. CUrrently the requirement is to collect users from groups.
2) Once I have done this, I need to grab only generic users from the list thus excluding system users.
I have to implement this on Win2000 and in VBScript. Thankx for all the help.
List Of Users On An Xp Machine
Ive looked thru the registry and cannot find anything about this.
I now wonder if there is away to get a list of users by listing all the folders in the docs and settings and subtracting the "all users", and "default users" folders from that list.
Any help would be great
Domain Users List
Hi all,
I would like to get the Domain Users List of my NT4.0 Domain (I'm a Domain Admins so I've no security problem).
Does anyone knows how I can develop an application or can say me what I have to use?
Please help! :-)
Getting List Of Users Fonts
How do I get a list of the available font on the users computer to use in a drop down combo box and how do I then enter them into the box?
Sorry, using combo box's is a first for me!
Thanks
List Logged On Users
Hello
I want to be able to get a list of all the logged on users logged on to a Windows 2003 Server (or the Windows 2000 Server Family; because they are very similar). I have some code that i tried on a domain-less network (workgroup) and it worked by providing the users that were connected to my computer using my files. But i assume that Windows 200x Server login works different because it doesn't returns any users logged on.
I have attached the project that i made to try to get it to work.
Thanks in advance for any help your can provide
Regards, Jono
Getting A List Of Network Users
Hi,
I've seen a number of posts asking how to find a list of PC's and IP addresses from the network but somehow I was wondering if it was possible to get a list of network usernames. The reason is I'm building an add user function to my program but the user name has to be the same as the users network logon ID. So I wanted to validate any users added,
I would really appreciate any help
Thanks
List WIndows XP Users
I'm writing a program that needs to know the name of every user with an account on a WinXP machine. It MUST be the exact same as returned by the GetUser API that gets the current user. Basicly my program works on every account, and each account's reg item must be accessable from every account, but when it's installed, it must create a reg key for every user on the machine. So - does anyone have a code snippet that will list every computer user in a listbox?
How To Get A List Of Users Using A File
We are on a local area network powered by Microsoft NT Server. I have developped some applications which use database files on the network. For whatever reason that can come up, I'd like to be able to find out who's using a file so I can delete/rename it without having to go around and ask everybody to logoff the application.
I don't want to build another db to keep track of who's using what. Since Windows knows there is a sharing violation when I try to delete the file, there must be a way to find out thru some commands (maybe API?) who has a handle on a file.
Any ideas ?
How Can I List The Users In Oracle?
How can I list the users in Oracle? which command do I need to use and I have created many users and I want to view all of them. And I need the sql command for that.
Furthermore, I have granted few privilages to a user named: Aftab how can I list the privilages that I have granted to him?
Pls help me.
Thank you!
Obtaining List Of NT Users
How do I get a list of all NT users on the network (LAN)? (Win NT 4 with Novell Netware). Not bothered about status (logged in/out, etc), just a simple list of user names.
I'm hoping there is a VB object I can use, instead of API, but any solutions will be better than what I have at the moment (i.e. nothing!!).
To Get The List Of NT Domains And Users
Hi,
1. How do i get a list of all the NT domains available thru my VB code, which is the API call that i have to make?
2. How do i get the list of all NT users in a particular domain?Again the name of the API that i may have to use?
Something like when i log into a NT workstation(ctrl+alt+del), i get a list of the available domains, i want a similar list of all the domains that is available.
Thanks,
Desi
Get List Of Users Connected To My Shares..
Quote:
Originally Posted by 3lit3
Is it possible to get a list of users currently connected to my shared folders, and ofcourse wich folder they are connected to?
Hi I have tried to find this out also, searched all of this forum and found nothing on it. Is this not possible? Or is this something that can't be done? If anyone has any ideas please let me know.
List Users On Windows Machine
I'm working on a backup program, designed to backup critical files from user-accounts on a windows 2K/XP/2k3 machine.
-for this purpose i need to somehow obtain a list of existing users on the system.
if for example i have a machine with the following 3 user-accounts createrd:
1. Administrator
2. Test1
3. Test2
-I want a way of detecting the following list:
1. Administrator
2. Test1
3. Test2
4. All Users
-because I am making copies of the user's folders in the documents folder. -and since some program store valuable information in the "All users" folder, I'll want to do a backup if this folder aswell.
Furthermore I need some way to detect what version of windows is installed - i need some function that returns for example:
1. WindowsXP
2. Windows2000
3. Windows2003
4. WindowsME
5. Windows98
6. Windows95
Also is there a way to detect the path the the "documents folder" - that beeing the root folder of the "Documents and settings" folder, the one in wich all the user's folders are located in? (for example: "c:Documents and Settings")
-I know %systemroot% goes to c:windows, but i need some way of finding the user's documents folder...
hope someone can help me out
List Of Database Users In Drop Down
Is there a way to pull a list of all of the SQL database users that have access to a particular database and have them displayed in a drop down menu in a vb program?
Thanks,
Rick
|