RSS Forums RSS

Windows Script Host question (WSH logon script)

Please support our Windows NT / 2000 / XP / 2003 advertiser: Programming Forums
Reply
Posts: 3
Reputation: mujtba is an unknown quantity at this point 
Solved Threads: 0
mujtba mujtba is offline Offline
Newbie Poster

Help Windows Script Host question (WSH logon script)

  #1  
Jan 11th, 2006
Hi ,

Im REAL new with VB and scripting. Im more into networking. I have about 4 departments. I want to MAP the users to their shared drives on the network, and I also want to map their My Documents folder to their shared drive on the network. How do I do that? I found the following snippet on microsoft:

Const ENGINEERING_GROUP = "cn=engineering"
Const FINANCE_GROUP = "cn=finance"
Const HUMAN_RESOURCES_GROUP = "cn=human resources"

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\\FileServer\Users\" & wshNetwork.UserName

Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

If InStr(strGroups, ENGINEERING_GROUP) Then

wshNetwork.MapNetworkDrive "g:",
"\\FileServer\Engineering\"
wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\EngLaser"
wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\Plotter"
wshNetWork.SetDefaultPrinter
"\\PrintServer\EngLaser"

ElseIf InStr(strGroups, FINANCE_GROUP) Then

wshNetwork.MapNetworkDrive "g:",
"\\FileServer\Finance\"
wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\FinLaser"
wshNetWork.SetDefaultPrinter
"\\PrintServer\FinLaser"

ElseIf InStr(strGroups, HUMAN_RESOURCES_GROUP) Then

wshNetwork.MapNetworkDrive "g:",
"\\FileServer\Human Resources\"
wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\HrLaser"
wshNetWork.SetDefaultPrinter
"\\PrintServer\HrLaser"

End If


My info:
Departments:
IT
QA
Finance
Engineering
Executive

Fileserver:
Neptune1
Nas1

I will use Group Policy in AD to implement this. All users have 2000 or XP. So I want to look at the department, and MAP users to their drives. Can someone modify the code for me to reflect that?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Posts: 2
Reputation: Humanvoice is an unknown quantity at this point 
Solved Threads: 0
Humanvoice Humanvoice is offline Offline
Newbie Poster

Re: Windows Script Host question (WSH logon script)

  #2  
Jan 30th, 2007
It's much more easier to do these exact things with scriptlogic's tool - desktop authority.
It's a gui based scripting solution and you can pervent yourself from possible mistakes and issues.
Reply With Quote  
Posts: 15,220
Reputation: jbennet is a glorious beacon of light jbennet is a glorious beacon of light jbennet is a glorious beacon of light jbennet is a glorious beacon of light jbennet is a glorious beacon of light jbennet is a glorious beacon of light 
Solved Threads: 455
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Windows Script Host question (WSH logon script)

  #3  
Jan 30th, 2007
cant you do this through user/group policy?
Master of puppets Im pulling your strings - blinded by me, you cant see a thing. Master! Master!

If i am helpful, please give me reputation points.
Reply With Quote  
Posts: 1,730
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Solved Threads: 83
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: Windows Script Host question (WSH logon script)

  #4  
Jan 30th, 2007
it's all easily done with gpmc, scripting, IMO, is for more complex tasks
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Windows NT / 2000 / XP / 2003 Forum
Views: 8944 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:47 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC