Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Server Authentication with VBA

Posted on 2011-03-18
7
Medium Priority
?
839 Views
Last Modified: 2012-05-11
Can vba be used to authenticate a machine with a server?
This script will be run after login to an account in windows xp home (startup folder) to
authenticate the machine to a windows server 2003 server. (in a workgroup. not a domain)

this is an example that do the same thing with a batch file.
net use \\192.168.10.200\DataFile /user:myusername mypassword
Is VBA able to do the same thing?

1

I don't need to add a mapped network drive. So I can't use scripts like following
Set oNet = CreateObject("WScript.Network")
oNet.MapNetworkDrive "H:", "\\192.168.10.200\DataFile", True, "MyUsername","MyPassword"


2

I don't want to run a batch file from VBA to authenticate the machine (like the following script).
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "net use \\192.168.100.220\Public /user:myusername mypassword" , 0, False
Set oShell = Nothing


I need to know if VBA is able to authenticate a PC without adding a mapped network drive.
Any kind of help is much appreciated.


0
Comment
Question by:MnInShdw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 21
ID: 35170094
AFAIK you will have to do something that requires you to log in.

There might be some API call that will perform an operation that will cause the authentication process to be required where you can pass the user name and password.  
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 35170481
Sorry, but I don't understand what you mean. some sample codes or a little bit more explanation is much appreciated.
0
 
LVL 1

Accepted Solution

by:
crystal_Tech earned 2000 total points
ID: 35180666
User Name and password must be set on the server 2003
Using INET component
In my case its working perfectly

 Dim ThisUrl As String
    ThisUrl = "192.168.10.200"
   
    Inet1.RemoteHost = ThisUrl
    Inet1.AccessType = icDirect
    Inet1.Protocol = icFTP
    Inet1.RemotePort = 21
   
    Inet1.URL = ThisUrl
    Inet1.UserName = "************"
    Inet1.Password = "*************"

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:MnInShdw
ID: 35198161
I'm receiving an error on line 4.
Unrecognized Object 'Inet1'
error code: 800A01A8


thank you
0
 
LVL 1

Expert Comment

by:crystal_Tech
ID: 35341605

i dont know about vba but in vb6 inet component you can get from
Projects > Components > Microsoft Internet Transfer Control 6.0
and you can get it

Place this component to your vb form
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 35735832
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question