?
Solved

Server Authentication with VBA

Posted on 2011-03-18
7
Medium Priority
?
851 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
6 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The article covers five tools all IT professionals should know about, as they up productivity by a great deal!
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

839 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