• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

vb script

hi,

I need vbscipt for desktop management.

Please find the below details having for every users:

1) Cubicle ID like A001, B001, and etc.,
2) Computer name
3) User login ID and password

We are facing lot of problem like to find the machine where it is located (which cubicle id belongs to this machine) bcoz of updating AV or  troubleshoot something we want. So we want to write vb script to solve this problem.

We can do the following things:

For the user creation in domain, we are entering user id / id's, cubicle details (location details) and computer name in description box on Active directory.

Below is our requirement for developing script:

Before entering the login for every user in the machine, it will ask the cubicle no. computer name and user id. These details are verified from domain AD  Whether the details are correct or not. if the 3 details are correct then user can able to entering their password and work with this machine otherwise machine not logon again asking for the above information.

So please help to write vb script for above requirement.

Thanks and regards,
Vijay.
0
VijayaGuru
Asked:
VijayaGuru
  • 3
  • 3
4 Solutions
 
RobSampsonCommented:
Hi.  Unfortunately, you can't do *anything* before a user fully logs in.

The best you could do is have a form open after they log in, to ask for the information.

When I read your requirements, you say that a user cannot log in if they don't enter the correct information, but you also say that your AD has wrong data.  So wouldn't this mean that there is a high chance that all users would try to enter wrong information, and no-one will be able to log in?

Anyway, for an example of how information can be gathered by users, I suggest you look at this post:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_22942348.html

Regards,

Rob.
0
 
ednetmanCommented:
I think what you are looking for would require a custom gina, sort of like the enterprise password solutions that allow a user to open a password reset form from the CTRL + ALT = DEL screen.

You will probably have to hire someone to do this for you.  Look at RentACoder.com, or other sites like that.

They will give you price estimates before work begins.  You may want to ask them to make sure that a silent install can be performed.  This way you can deploy the updated gina remotely via the software delivery method your company uses.
0
 
VijayaGuruAuthor Commented:
hi,

Thanks for your solutions.

I need the simple script for desktop management. User should enter the cubicle id (mixed with alphabet and numerical letters) before logon to the machine. if the cubicle is correct then user can able to logon otherwise not able to logon to the machine. This cubicle details are mentioned in description column for every user account on AD domain. So it will check the AD and acknowledge the user when tried to entering cubicle id.

Please help me to write the script and need urgently.

Thanks and regards,
Vijayaguru M
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ednetmanCommented:
Sorry Vijayaguru,

Like Rob said, you can't run ANYTHING interactively BEFORE a user logs in.  This is a core security feature of Windows.  Now, there are products that modify this behavior by creating their own custom gina to replace the msgina.dll.  In fact, Novell does it with NWGina.dll, Symantec Ghost has a custom gina, and there are many others that use this method.  Your solution is to either have someone code this for you, or modify your requirements.

For example, let the user log in then run a vbscript that asks for the information.  If the data fails, have the script run a command like "psshutdown -f -o"  This would log the user off.  All that that would require is the psshutdown tool from Microsoft.  If the data is correct, close the pop-up and allow the user to log in.  You can make the window full screen and have it launch before the apps and start menu appear by placing  a shortcut to your script in the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"HotKeysCmds"="C:\\WINNT\\system32\\MyScript.vbs"
0
 
RobSampsonCommented:
Hi, ednetman is right.

With VBScript, the best you can do is launch a script immediately after login, which can be configured to log the user off if information is incorrect.  However, this key
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"HotKeysCmds"="C:\\WINNT\\system32\\MyScript.vbs"

will not stop the desktop loading.  You are better off using
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"HotKeysCmds"="C:\\WINNT\\system32\\MyScript.vbs"

as this loads before the desktop paints, but then you also must have a StartUp *and* Logoff script that adds this key to registry.  The reason is because RunOnce keys are run, then deleted, so you need to keep putting it back there.

Here's an example.  This script, at logon, will check the description for the current computer in AD, and if what the user enters does not match, it will log them off.

'=========================
Set objShell = CreateObject("WScript.Shell")
Set objADSysInfo = CreateObject("ADSystemInfo")
Set objComputer = GetObject("LDAP://" & objADSysInfo.ComputerName)
strRequired = objComputer.Description
strUser = InputBox("Enter your cubicle ID:", "Cubicle ID")
If LCase(strRequired) <> LCase(strUser) Then
     MsgBox "You entered an incorrect cubicle ID."
     strCommand = "shutdown -l -f -t 00"
     objShell.Run strCommand, 1, False
End If
'=========================


and you will need to run this batch file at StartUp and Logoff to add the registry key to run the script.

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v "HotKeysCmds" /d "wscript C:\WINNT\system32\MyScript.vbs"

Regards,

Rob.
0
 
RobSampsonCommented:
Hi angelIII, I would suggest that my answer (ID: 22933832) and ednetman's answer (ID: 22932359) be accepted as they address the issue the author is asking about, and provide workable solutions.

Regards,

Rob.
0
 
ednetmanCommented:
Wow, this took a LONG time to go in to an abandoned status.  I agree with Rob.  i don't think VijayaGuru is coming back to this question.  Split the points and give us both A's!!!!
;-)

~Ed
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now