Solved

Login Scripts in AD 2000

Posted on 2009-07-05
6
204 Views
Last Modified: 2013-12-05
I am in the middle of migrating data from stand alone servers to Blade/SAN systems, thus I would like to start using login scripts as opposed to using persistent drive mappings. I am new to writing scripts in AD, but I have done a little work in NetWare.

I need something simple like:

If user is a member of (group name) then
Net use T:\\sharename\
End  

I also need users to map to their Home folders by %username%

Do you have something short and simple?

0
Comment
Question by:edromer20
  • 3
  • 2
6 Comments
 
LVL 23

Expert Comment

by:debuggerau
ID: 24781765

;- login.vbs

ON ERROR RESUME NEXT

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set NetObj = WScript.CreateObject("WScript.Network")
Set CheckDrive = NetObj.EnumNetworkDrives()

DriveLetter = "G:" 'DriveLetter must be a CAPITAL letter
RemotePath = "\\SVR\SHARE"
AlreadyConnected = False
For i = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(i) = DriveLetter Then AlreadyConnected = True
Next
If AlreadyConnected = True then
NetObj.RemoveNetworkDrive DriveLetter
NetObj.MapNetworkDrive DriveLetter, RemotePath
'WshShell.PopUp "Drive " & DriveLetter & "Disconnected, then connected successfully."
Else
NetObj.MapNetworkDrive DriveLetter, RemotePath
'WshShell.PopUp "Drive " & DriveLetter & " connected successfully."
End if


if UserString = "specificAcct" then
WSHNetwork.MapNetworkDrive "M:", "\\SVR1\c$"
WSHNetwork.MapNetworkDrive "N:", "\\SVR1\C$"
WSHNetwork.MapNetworkDrive "O:", "\\SVR1\D$"
WSHNetwork.MapNetworkDrive "K:", "\\SVR1\e$"
WSHNetwork.MapNetworkDrive "P:", "\\SVR1\blabla"
WSHNetwork.MapNetworkDrive "Q:", "\\SVR1\e$"
End If


This should disconnect permanent mappings too..
Or just use the direct method as described for specificAcct.
remember, it is a .vbs file..
you could also map home drives from within AD itself under the profile tab for each user..

0
 

Author Comment

by:edromer20
ID: 24999797
What tool is use to create VBS and how are the scripts tested or implemented in an AD environment.
0
 
LVL 23

Accepted Solution

by:
debuggerau earned 50 total points
ID: 25001153
There are many script writers like Visual Studio, but notepad will suffice.

Usually, you would test them in an test environment, how you implement is dependent on the type of script, this one for instance is best used in a login script, either explicitly defined in AD, or from Group Policy.

Hope that helps
0
 

Author Closing Comment

by:edromer20
ID: 31599987
Home folders are addressed through user object? Can you recommend a beginner resource for writing scripts for AD 2003/2008?
0
 

Author Comment

by:edromer20
ID: 25005581
Can you recommend an easy to follow resource for writing and implementing scripts?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why would someone make a DC a member of the administrator's group 6 41
set-aduser powershell command issue 2 29
Server timing 4 19
Additional DC vs Child Domain 12 18
Know what services you can and cannot, should and should not combine on your server.
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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 …

773 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