Server 2003 Domain, Windows 7 & vbs Login Script

I have a Windows Server 2003 AD domain with 500+ XP clients.  We have a comprehensive login  script (written in vbs) that is launched by default domain policy and, as part of its role, maps printers according to the location of the client pc / laptop and the group membership of the user.  We are about to introduce a suite of 30 Windows 7 desktops but I note elsewhere that these can have problems with vbs logon scripts.  Please can someone advise on how to ensure that we can continue to run the login across all client pcs - XPPro & W7Pro.  Thanks.
LVL 1
cmdownAsked:
Who is Participating?
 
McKnifeConnect With a Mentor Commented:
Hi.
Another way would be to quit scripting here and use GPOs from now on. So called "Group policy preferences" henceforth GPPs (see MS kb943729) can be used for your task even on xp (with kb 943729 installed). To use GPPs, take a windows 7 pc and install RSAT, next, activate it as a windows feature and connect to your 2003 DC through it. GPPs have many advantages and are highly recommended.
0
 
WindowsITAdminCommented:
Hi.
I don't know what classes or functions work with Windows 7 but I know that it's prepared to work with Powershell and it don't have 100% compatibility with vbs files. The best way to ensure that it will work is to test your script with one computer with windows 7.

Hope this helps.
0
 
Nenad RajsicCommented:
The only way to test which vb functions from your login script work on windows 7 is to test it on one of your windows 7 machines. When you log in see if your printers are mapped correctly, mapped network drives etc. then if you see that one if one of your steps is not working search for a VBS code that will work on win 7 only for that particular function.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
Ivano ViolaSystem AdministratorCommented:
We have a Server 2003 Domain and use one vbs login script to map drives based on AD groups (no printer mappings) for both operating systems. Currently we have not experienced any problems mapping drives. We do call the script using a batch file only because we have some KiXtart scripts that also run during the logon process. UAC is still activated on the Win7 machines. All users are local admins on their machines.

If you have any problems let me know. I don't mind sharing the script we use.
0
 
cmdownAuthor Commented:
Thanks All for your responses so far.  Ivanoviola and McKnife I feel are closest to where we are with this.  Our script sets printers, mappings and desktop properties and captures details such as machine name, ip address etc & writes to several log files.  As this deployment is within a large upper school environment making all users local machine admins is not an option.  Also, only 30 out of 580 computers will be W7Pro (at this time) so we really need a quick fix to get this working again without detracting from the functionality of the login script for the XPPro users.
0
 
McKnifeCommented:
There are only a few assumptions we can make so far about what is going wrong. As I read many postings here and there about problems with .vbs logon scripts and never about problems with .bat logon script on windows 7, I am tempted to advise you to use .bat for the tasks that .bat can handle (which should be most or all).
Please also read the last 3 postings of http://www.minasi.com/forum/topic.asp?TOPIC_ID=12977
0
 
Ivano ViolaConnect With a Mentor System AdministratorCommented:
Find attached the vb script I use. It logs results/user info along with other info. The only thing we needed to change when we introduced Windows 7 machines was the log file path.
We use a batch file to call this. Hope this helps.


mapdrives.vbs
0
 
cmdownAuthor Commented:
Hi both
We've confirmed that vbs is now actually running (WSH reinstall required) but some of the low level calls that query the AD are causing the scripts to fail.
I've uploaded a function from the main logon script, which is failing at line 25 (Set adoRecordset = objCommand.Execute) when it queries AD to get the location field from the computer record.  Any ideas ?  
 
 

Function GetObjectLocation
	strUser = "MYDOMAIN\Addcomputer"
	strPassword = "Password"
	strserver = "DomCtrl"
	strloc = "BLANK"
	'= Obtain Root DSE
	Set objRootDSE = objNS.OpenDSObject("LDAP://" & strserver & "/RootDSE", strUser, strPassword, ADS_SECURE_AUTHENTICATION)
	strDNSDomain = objRootDSE.Get("defaultNamingContext")
	'= Obtain Domain from RootDSE
	strdomain = strDNSDomain
	Set objCommand = CreateObject("ADODB.Command")
	Set adoConnection = CreateObject("ADODB.Connection")
	adoConnection.Provider = "ADsDSOObject"
	adoConnection.Open "Active Directory Provider"
	objCommand.ActiveConnection = adoConnection
	strBase = "<LDAP://" & strDNSDomain & ">"
	strFilter = "(&(objectCategory=computer)(name=" & strcomputername & "))"
	strAttributes = "adspath,description"
	strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
	' Run the query.
	objCommand.CommandText = strQuery
	objCommand.Properties("Page Size") = 100
	objCommand.Properties("Timeout") = 30
	objCommand.Properties("Cache Results") = False
	Set adoRecordset = objCommand.Execute
	' Enumerate the resulting recordset.
	Do Until adoRecordset.EOF
		locatecomputer = TRUE
		strorigcomputerpath = adorecordset.Fields("AdsPath").Value
		strdescription = adorecordset.Fields("description").Value
	    adoRecordset.MoveNext
	Loop
	' Clean up.
	adoRecordset.Close
	adoConnection.Close
	strPath = strorigcomputerpath
	Set objcomputer = objNS.OpenDSObject(strPath,strUser, strPassword,ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION)
	on error resume next
	strloc = objComputer.Get("Location")	
	GetObjectLocation = UCASE(strloc)
End Function

Open in new window

0
 
cmdownAuthor Commented:
Points increased to 350
0
 
cmdownAuthor Commented:
All
This problem has been resolved, although the reason is unclear.  Seperate to this posted problem we had to make a minor & unrelated change to the vbscript to allow for some additional functionality. As part of this, the sub and function calling sequence within the script changed and the problem just disappeared.  Weird !
Points awarded to ivanoviola & McKnife for assistance
0
 
cmdownAuthor Commented:
Thanks for all your help.  Readers of this post please see my above comment on what resolved the issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.