473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Login script based on ou

Have a new domain with users from 2 different location and only want 1 script. Have started a login script that should be based on what OU the user is located in. Here is what i have done that is not working.

Const City1 = "ou=City1"
Const City2 = "ou=City2"


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


If InStr(strGroups, City1) Then

Set wshNetwork = CreateObject("WScript.Network")

wshNetwork.MapNetworkDrive "h:",
"\\SSEP8SW3HATE\Home$\" & wshNetwork.UserName"

wshNetwork.MapNetworkDrive "k:",
"\\FileServer\City1\"

wshNetwork.MapNetworkDrive "n:",
"\\FileServer\City1\"

wshNetwork.MapNetworkDrive "o:",
"\\FileServer\City1\"

wshNetwork.MapNetworkDrive "p:",
"\\FileServer\City1\"

wshNetwork.MapNetworkDrive "t:",
"\\FileServer\City1\"


wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\Printer"

wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\Printer"

wshNetWork.SetDefaultPrinter
"\\PrintServer\Printer"


ElseIf InStr(strGroups, City2_GROUP) Then

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\\SSEP8SW3HATE\Home$\" & wshNetwork.UserName"

wshNetwork.MapNetworkDrive "k:",
"\\FileServer\City2\"

wshNetwork.MapNetworkDrive "n:",
"\\FileServer\City2\"

wshNetwork.MapNetworkDrive "o:",
"\\FileServer\City2\"

wshNetwork.MapNetworkDrive "p:",
"\\FileServer\City2\"

wshNetwork.MapNetworkDrive "t:",
"\\FileServer\City2\"

wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\Printer"

wshNetwork.AddWindowsPrinterConnection
"\\PrintServer\Printer"

wshNetWork.SetDefaultPrinter
"\\PrintServer\Printer"


End If

.
Feb 6 '08 #1
0 978

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Sniffer-Dog | last post by:
Hi I just wondered if anyone can spot anything wrong with the following? I have now added the session_start(); as the first command in the code to all the pages needing it. When I click on a...
2
by: bryce21 | last post by:
I'm trying to write a script that logs into Yahoo Fantasy Football. Once logged in, I'll be able to grab stats and various other pieces of info about our league. The problem I'm having deals with...
6
by: R. Rajesh Jeba Anbiah | last post by:
Q: How to implement a login system? A: Use sessions. When the user logins, store the session id in the database and then compare the current session id with the one stored in the database on every...
2
by: harris | last post by:
I am needing some help with a few asp pages and a login script. Let me start by describing my project. I am trying to connect to a database and verify a users login and password, then based on...
3
by: | last post by:
My questions concerns building a login system based on checking for the existence of the user's email address only.... 1. Is it ok for me to use IP address to allow user to bypass all login and...
5
by: Kivak Wolf | last post by:
Hi, I am currently trying to make a website that requires an account to use so it can disply the data according to the account. I have ASP.NET 2.0 installed and working fine. However, it is not...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
7
by: Andrea | last post by:
Hi there! I have to do a php script that daily surf a webpage (I do it with crontab) and collect some data. The proble is that to access that webpage I have to do a login. I have the login data,...
4
by: adam.waterfield | last post by:
I am just wondering if anyone here can help with a problem that we have here. We have a PHP based website/application that has a user login that is connected to our AD setup. This works fine....
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.