Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


network login script with no domain

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,49091
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> network login script with no domain
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 network login script with no domain - 7/5/2007 9:50:33 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
I need a login script for no domain on the workstation.

We started to have our domain users bring in their own personal laptop to access the domain resources such as network printers and file servers.

I need to create a script for them to authenticate without them joining the domain.


So basically this script would access a "\\server
then authenicate Wscript.sleep 4000, WshShell.sendkeys "username{enter}" and WshShell.sendkeys "password{enter}"

then I'll do the scripting such as this:

Option Explicit
on error resume next
Dim objNet
Set objNet = CreateObject("Wscript.Network")
objNet.MapNetworkDrive "U:", \\server\USERS\folder\Domain1\user, True
WSCript.Quit


any ideas in how the script will look like in how to access the \\server




 
 
Post #: 1
 
 RE: network login script with no domain - 7/5/2007 11:49:03 PM   
  SAPIENScripter


Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You'll have to copy the script to each machine. I'd create a shortcut in the Startup Folder so it will run each time they logon.  I'd also have the script prompt them for a username and password so you don't have to customize the script for each user. If you really want to get fancy, add code at the end of the script to check the version of the script against a network copy and if the newtork copy is newer, copy it to the machine. This way you can update the logon script without having to revisit each machine.

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to kracksmith)
 
 
Post #: 2
 
 RE: network login script with no domain - 7/6/2007 1:05:49 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
wow! i like that.

1st how do i prompt  the username and password?

i also like the checking of scripts off the server for updates. that managebility would be really cool.
I probably need to research this 2nd part out when i have time. i'm not a scripter by trade.

(in reply to SAPIENScripter)
 
 
Post #: 3
 
 RE: network login script with no domain - 7/6/2007 2:33:44 AM   
  dm_4ever


Posts: 2723
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
quote:

1st how do i prompt  the username and password?

Look/Search for InputBox

MapNetworkDrive
allows you to pass to it a username and password.
http://msdn2.microsoft.com/en-us/library/8kst88h6.aspx

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kracksmith)
 
 
Post #: 4
 
 RE: network login script with no domain - 7/6/2007 2:56:47 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
thanks for the reply

I think the inputbox is a harder way to create.
1st I would need to create a inputbox for user and password, then it needs to authenicate to AD.

What I like to do is make the script go:

1. start, run, \\server (this auto prompt his username and password)
2. run a sleep command
3. then do a send key for username and password.
4. then run the login script such as

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "E:", \\Server\Public





(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: network login script with no domain - 7/6/2007 3:47:37 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
ok i've done a little research and now i need help. how come i can't map the drives? worst comes to worst i can have his mapped drive window open but i don't want that.


Option Explicit
'on error resume next 
Dim oWS, oWN, sUserID, sPW, objNet
Set oWS = WScript.CreateObject("WScript.Shell")
Set oWN = WScript.CreateObject("WScript.Network")
Set objNet = WScript.CreateObject("Wscript.Network")
sUserID = GetResponce(" Remote Logon Name", "user1", "jdoe")
If sUserID = "" Then Call CleanUp()
sPW = GetResponce("  Remote Password", "password1", "happycat")
If sPW = "" Then Call CleanUp()
objNet.MapNetworkDrive "F:", "\\server\DATA", True
objNet.MapNetworkDrive "R:", "\\server\Document Control", True
objNet.MapNetworkDrive "S:", "\\server\COMMON", True
objNet.MapNetworkDrive "U:", "\\server\USERS_snapw2k5\Domain1\user1", True
'oWN.MapNetworkDrive "U:", "\\server\USERS_snapw2k5\Domain1\user1", False, sUserID,sPW
'oWS.Run "explorer.exe /n , , U:\", 1, True
'oWN.MapNetworkDrive "F:", "\\server\DATA", False, sUserID,sPW
'oWS.Run "explorer.exe /n , , F:\", 1, True
'oWN.MapNetworkDrive "R:", "\\server\Document Control", False, sUserID,sPW
'oWS.Run "explorer.exe /n , , R:\", 1, True
'oWN.MapNetworkDrive "S:", "\\server\COMMON", False, sUserID,sPW
'oWS.Run "explorer.exe /n , , S:\", 1, True
Call CleanUp()
Sub CleanUp()
Set oWS = Nothing
Set oWN = Nothing
WScript.Quit
End Sub
Function GetResponce(sItem, sValue, sHint)
GetResponce = InputBox ( "Enter your " & sItem & vbCrlf & _
"then Click Ok." & vbCrlf & vbCrlf & _
"Example: " & sHint, "Remote Authinication", sValue)
End Function

(in reply to kracksmith)
 
 
Post #: 6
 
 RE: network login script with no domain - 7/7/2007 1:44:00 PM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
kracksmith, it seems to work fine for me... the only thing i could see that might be problematic is the login name... are the users typing in just "username" or are they using "Domain\Username"?  might be authentication problem... if you have only one domain just code it in, if not have the user type in domain\username for the inputbox function

'on error resume next 
Dim oWS, oWN, sUserID, sPW, objNet
Set oWS = WScript.CreateObject("WScript.Shell")
Set oWN = WScript.CreateObject("WScript.Network")
Set objNet = WScript.CreateObject("Wscript.Network")
sInput = GetResponce(" Remote Logon Name", "user1", "jdoe")
sUserID = "DomainName\" & sInput
If sUserID = "" Then Call CleanUp()
sPW = GetResponce("  Remote Password", "password1", "happycat")
If sPW = "" Then Call CleanUp()

< Message edited by sheepz -- 7/7/2007 1:45:22 PM >

(in reply to kracksmith)
 
 
Post #: 7
 
 RE: network login script with no domain - 7/9/2007 10:17:04 AM   
  kracksmith

 

Posts: 198
Score: 0
Joined: 2/24/2005
From:
Status: offline
How did you get it working?

i wasn't even able to get a mapped F drive. it says username and password is the error. (i did type in the correct username and password)

line 11 &  char 1 error


(in reply to sheepz)
 
 
Post #: 8
 
 RE: network login script with no domain - 7/9/2007 1:11:03 PM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
opps i forgot to post this line, i got the same error for line 11, i just added:

objNet.MapNetworkDrive "F:", "\\server\DATA", True, sUserID, sPW

(in reply to kracksmith)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> network login script with no domain Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts