Solved

Server Authentication with VBA

Posted on 2011-03-18
7
829 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
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 500 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

765 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