A client that I am working with is trying to write a login script to connect users from different ou's (groups)to various shares and map the drives as they log in. Can this be done? Is this proposed solution a good work around for not using XP and group policies and where on earth would they start ?

Re: windows 98 login script for clients connecting to 2k server by Richard

Richard
Mon Feb 09 23:06:09 CST 2004

shawne wrote:

> A client that I am working with is trying to write a login script to
connect users from different ou's (groups)to various shares and map the
drives as they log in. Can this be done? Is this proposed solution a good
work around for not using XP and group policies and where on earth would
they start ?

Hi,

Yes, it can be done, if I understand what you want. A lot depends on the
client OS's supported. Group Policy can be applied to OU's, so each OU has
it's own logon script. If you don't use Group Policy, you can assign a logon
script to each user in AD Users & Computers on the "Profile" tab. You could
give each user their own logon script, or use one script for everyone. If
the clients have ADSI, you can test group membership and map drives
accordingly. If you want to map according to OU, then you must retrieve the
Distinguished Name of the user and parse this for the OU. For example, if
the client OS is at least W2k, you can use the ADSystemInfo object, as
follows:

' Retrieve user Distinguished Name.
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName

' Parse for the Distinguished Name of the parent OU.
intIndex = InStr(LCase(strUserDN), "ou=")
If intIndex > 0 Then
strOU = Mid(strUserDN, intIndex)
End If

' Test if user in ou=Sales.
If LCase(strOU) = "ou=sales,dc=MyDomain,dc=com" Then
... map drive or whatever.
End If

For sample logon scripts, and a FAQ on logon scripts:

http://www.rlmueller.net/freecode2.htm

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--




Re: windows 98 login script for clients connecting to 2k server by anonymous

anonymous
Tue Feb 10 08:01:07 CST 2004

Thank you for relying to my newsgroup post Mr. Mueller. The clients at this site are using Windows 98. They are trying to come up with a script similar to the #1login script that is on your web site. They are not sure if they will be nesting groups so login script #4 may or may not be an option. At some point this week we will be installing the dsclient onto our Win98 test pc's and testing the login process. Please sir if there is anything else that you can suggest it would be a great help. Thanks again. Shaw


Re: windows 98 login script for clients connecting to 2k server by Richard

Richard
Tue Feb 10 17:35:48 CST 2004

shawne wrote:

"shawne" <anonymous@discussions.microsoft.com> wrote in message
news:EA9369F0-04B2-4508-B065-5711C391B136@microsoft.com...
> Thank you for relying to my newsgroup post Mr. Mueller. The clients at
this site are using Windows 98. They are trying to come up with a script
similar to the #1login script that is on your web site. They are not sure if
they will be nesting groups so login script #4 may or may not be an option.
At some point this week we will be installing the dsclient onto our Win98
test pc's and testing the login process. Please sir if there is anything
else that you can suggest it would be a great help. Thanks again. Shawn
>

Hi,

The ADSystemInfo object is not available on Windows 98 clients, but the
other scripts should work fine. The only "gotcha" to watch out for is the
loop to retrieve UserName from the Wscript.Network object. This is only
needed during logon and only on Windows 95/98/ME clients (the loop also
works fine on any other client).

I would recommend Logon script #4. I include Logon script #1 on my site
because many are only comfortable with the WinNT provider. However, it is
slower. Even though more lines of code are often required with the LDAP
provider, it can do more and is faster. Also, the WinNT provider is blind to
OU's, so if you plan to map drives according to the OU a user resides in,
you have to use LDAP.

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--