|
-
Mar 14th, 2005, 06:49 PM
#1
Thread Starter
PowerPoster
-
Mar 14th, 2005, 08:11 PM
#2
Re: Retrieve Username of User on Remote Computer
Hey there PC 
This may be a place to start. I use it to load a ComboBox in my NetSend app:
VB Code:
Private Sub Load_Users()
Dim objDomain As Object
Dim objUser As Object
On Error GoTo Err_Handler
Set objDomain = GetObject("WinNT://" & Environ$("USERDNSDOMAIN"))
Set objUser = GetObject(objDomain.Schema)
objDomain.Filter = Array("User")
For Each objUser In objDomain
cboUsers.AddItem objUser.Name
Next
Set objDomain = Nothing
Set objUser = Nothing
Exit Sub
Err_Handler:
If Not (objDomain Is Nothing) Then Set objDomain = Nothing
If Not (objUser Is Nothing) Then Set objUser = Nothing
MsgBox "Description: " & Err.Description & vbCrLf & _
"Number: " & Err.Number, vbInformation + vbOKOnly, App.Title & " - Error"
End Sub
Bruce.
-
Mar 14th, 2005, 08:49 PM
#3
Thread Starter
PowerPoster
-
Mar 14th, 2005, 10:42 PM
#4
Re: Retrieve Username of User on Remote Computer
This might help steer you in the right direction...not sure where to go with it but
if you go to search:
pick computers
the enter the computer name in the network..it will return the user name
not sure how you could do this in VB
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Mar 15th, 2005, 08:40 PM
#5
Thread Starter
PowerPoster
Re: Retrieve Username of User on Remote Computer
Obtaining Workstation User Logon Information
That example seems to work, but it returns all users that have logged on for a while it seems, but it seems to list the current user last. 
Edit: I guess theres a problem though that it won't be able to tell you if someone is logged onto the computer or not.
Last edited by Pc_Madness; Mar 15th, 2005 at 08:43 PM.
-
Mar 15th, 2005, 09:07 PM
#6
Member
Re: Retrieve Username of User on Remote Computer
Dear Brute Fox,
Why i can't run your code? I get the error : Run-time Error(-2147463168) Automation Error when i tried to compile it. Do i need to add any references?
-
Mar 15th, 2005, 09:21 PM
#7
Re: Retrieve Username of User on Remote Computer
dglienna, did you not see the following in the code you posted?
VB Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2005 VBnet, Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
' applications, but [HL="#FFFF80"]you may not reproduce
' or publish this code on any web site[/HL],
' online service, or distribute as source
' on any media without express permission.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
Mar 15th, 2005, 09:44 PM
#8
Re: Retrieve Username of User on Remote Computer
Oops. I have it on my system, but I didn't read the exclusions. This has become a sore point. i tried to link to it the other day, but it was just the same link that PC Madness had in the first post, and the thread was removed. I asked if I should have posted the code, and was told "After I tested it to see if it worked."
It says that I can use it in my own application, so by creating a form and a few controls makes it my own.
Does that mean that I can post it?
- P C - It's the 5th one on the page.
-
Mar 15th, 2005, 09:52 PM
#9
Re: Retrieve Username of User on Remote Computer
 Originally Posted by Randy Birch
... or distribute as source
' on any media without express permission.
No you cant without permission.
Best thing to do is to link to the page I suppose?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 15th, 2005, 10:17 PM
#10
Re: Retrieve Username of User on Remote Computer
I tried that yesterday, and was blasted because it was the same link that PC posted when he started the thread. I clicked the link that was five links down on the posted page, and the link was the same! Now I posted it and was blasted again.
-
Mar 15th, 2005, 10:36 PM
#11
Re: Retrieve Username of User on Remote Computer
 Originally Posted by laisengchew
Dear Brute Fox,
Why i can't run your code? I get the error : Run-time Error(-2147463168) Automation Error when i tried to compile it. Do i need to add any references?
Nope. What OS are u using?
Bruce.
-
Mar 15th, 2005, 10:36 PM
#12
Re: Retrieve Username of User on Remote Computer
Well I am late getting into this one but if its a duplicate link then there is no point posting it.
If you find something else thats worthy then post it if its legal.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 15th, 2005, 10:40 PM
#13
Re: Retrieve Username of User on Remote Computer
He obviously linked to the page that had all of the links, but no particular program, and I tried to link to a link that was linked to. The page that I tried to link to HAD the code that I then tried to post on it.
IT IS THE FIFTH LINK ON THE PAGE.
-
Mar 15th, 2005, 11:17 PM
#14
Re: Retrieve Username of User on Remote Computer
Chill, David. You dont have to yell! I know its the fifth link on the page. I was referring to you posting a different link that
points to a different article or code sniplette. There is no point in posting a direct link to the same on in the original
first post.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 15th, 2005, 11:20 PM
#15
Re: Retrieve Username of User on Remote Computer
My point is that I didn't realize it pointed to the first page and not the second.
There is no way to link to the correct page. That's why I yelled. Not to you, but to PC Madness, so he can find it.
-
Mar 15th, 2005, 11:29 PM
#16
Re: Retrieve Username of User on Remote Computer
Regardless, its not that hard to say PC_Madness, look at the 5th link on that page? You did it on an earlier post.
I dont appreciate yelling, no matter who its directed at.
This is what you should have done - Enumerating the User List and Obtaining User Info
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 16th, 2005, 12:09 AM
#17
Re: Retrieve Username of User on Remote Computer
That's what I thought that I was doing. I keep forgetting the I have a copy link in Fx. That is the solution. Sorry about losing my cool. It's just been hard helping this time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|