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.
VijayaGuruAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.