Registered member login:
Register Now
Altirigos » Altiris Administrators » Scripts » Auto Logon Script

» Current Poll
Do you leave the Aclient enabled?
YES - 83.05%
196 Votes
NO - 16.95%
40 Votes
Total Votes: 236
You may not vote on this poll.
» Stats
Members: 9,948
Threads: 12,158
Posts: 56,984
Top Poster: Nick (4,991)
Welcome our newest member, rmerrill
» Online Users: 32
0 members and 32 guests
No Members online
Most users online at once 294, 06-30-2007 at 12:24 PM.
» July 2010
S M T W T F S
27282930 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Reply
Old 02-01-2007, 09:43 PM   #1 (permalink)
 
Status: Super Altiris Admin
Join Date: 08-15-2006
Location: Scottsdale, AZ
Posts: 224


Auto Logon Script

Don't know if this has ever been requested.......I would like to have a script which would log me onto workstations so I don't have to manually log on.

Just curious if this is possible....

Thanks....
__________________
Pete
Tanman is offline   Reply With Quote
Old 02-02-2007, 01:33 AM   #2 (permalink)
 
jdean's Avatar
 
Status: Super Altiris Admin
Join Date: 02-24-2005
Location: Orange County, California, USA
Posts: 585


I'm not grasping the full context of what you're asking.

If you want a script to connect to a machine that's not a problem. If you want a script to be run from the CTRL ALT DEL screen then it isn't possible.

I can write scripts to Lock workstations but not unlock them. Shutdown, reboot, logoff all tangible goals but logging on isn't going to happen with vbscript. I don't know about third party apps.

Quote:
Originally Posted by Tanman
Don't know if this has ever been requested.......I would like to have a script which would log me onto workstations so I don't have to manually log on.

Just curious if this is possible....

Thanks....
__________________
IT Factotum * Altiris Addict * Wise Monger * VBScript Zealot

Jereme Dean
Orange County, CA
jdean33442@gmail.com
jdean is offline   Reply With Quote
Old 02-02-2007, 06:22 AM   #3 (permalink)
 
maeron's Avatar
 
Status: Altiris Admin
Join Date: 03-06-2006
Location: Sweden
Posts: 74


I have a little ugly idea.... IF it doesn't matter that you restart the computer....

Run this VBSCRIPT on the computer first:

Code:
 
Dim WSH
Set WSH = CreateObject ("WSCript.shell")
'Change details in the Registry
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "1"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "HERE YOU SET THE USERNAME"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", "AND HERE IS THE PASSWORD"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "AND HERE THE DOMAIN OR COMPUTERNAME"
Then make a job that restarts the computer

NOW after it restarted you are loggin in as the user you set in the script.

To remove the Autologin feature run the following script afterwords:

Code:
 
Dim WSH
Set WSH = CreateObject ("WSCript.shell")
'Change details in the Registry
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "HERE YOU SET SOMETHING"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", "AND HERE IS NOT!!! THE PASSWORD"
WSH.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "AND HERE THE DOMAIN OR COMPUTERNAME"
Remember to restart again

I don't know if this help but It dows the job

/Martin
maeron is offline   Reply With Quote
Old 02-06-2007, 07:47 PM   #4 (permalink)
 
rdvanorman's Avatar
 
Status: Super Altiris Admin
Join Date: 05-25-2005
Location: Fort Worth, Texas
Posts: 145


I have a VB Script I got somewhere. We use it at times to push out updates that required a logged in user. It changes the keys in the registry to login automatically with a specified account. After a specified time you can have it return to normal. I'd be glad to share will all. BTW This script locks out local keyboard and mouse input.

Auto login

Dim objShell, strPWD, CurUser, LocMach
strComputer = "."
adminUser = "Username" ‘Local Administrator Account
strPWD = "password" ‘Password for the local Administrator Account
unBlock = 7200000 ‘Amount of time in milliseconds before the machine resets itself
strDomain = "Domain" ‘Resets the domain name on the login screen
Const ForceRestart = 6
Const ForWriting = 2

Set objShell = CreateObject("WScript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
LocMach = objNetwork.ComputerName
CurUser = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName")
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CurrentUserName", CurUser
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", LocMach
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", adminUser
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", strPWD
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "1"
objShell.Regwrite "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\S tart", 4, "REG_DWORD"
objShell.Regwrite "HKLM\SYSTEM\CurrentControlSet\Services\Mouclass\S tart", 4, "REG_DWORD"

Set FileSysObj = WScript.CreateObject("Scripting.FileSystemObject")
strStartup = objShell.SpecialFolders("AllUsersStartup")
Set MessageFile = FileSysObj.OpenTextFile(strStartup & "\Message.vbs", ForWriting, True)
MessageFile.WriteLine("MsgBox ""This machine is currently blocked for maintenance..."" _")
MessageFile.WriteLine("& chr(13) & ""PLEASE DO NOT SHUT IT DOWN!"" & chr(13) _")
MessageFile.WriteLine("& ""For further information call"", vbExclamation, ""IT Systems Notice""")
MessageFile.Close
Set FailsafeFile = FileSysObj.OpenTextFile(strStartup & "\Failsafe.vbs", ForWriting, True)
FailsafeFile.WriteLine("Dim objShell, strPWD, CurUser, FileSysObj, strStartup")
FailsafeFile.WriteLine("Const ForceRestart = 6")
FailsafeFile.WriteLine("Const unBlock = 7200000")
FailsafeFile.WriteLine("strComputer = "".""")
FailsafeFile.WriteLine("strDomain = ""domainname""")
FailsafeFile.WriteLine("set objShell = createobject(""WScript.Shell"")")
FailsafeFile.WriteLine("strPWD = """"")
FailsafeFile.WriteLine("Wscript.Sleep unBlock")
FailsafeFile.WriteLine("CurUser = objShell.RegRead(""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CurrentUserName"")")
FailsafeFile.WriteLine("objShell.Regwrite ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName"", strDomain")
FailsafeFile.WriteLine("objShell.Regwrite ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword"", strPWD")
FailsafeFile.WriteLine("objShell.Regwrite ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon"", ""0""")
FailsafeFile.WriteLine("objShell.Regwrite ""HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\ Start"", 1, ""REG_DWORD""")
FailsafeFile.WriteLine("objShell.Regwrite ""HKLM\SYSTEM\CurrentControlSet\Services\Mouclass\ Start"", 1, ""REG_DWORD""")
FailsafeFile.WriteLine("set FileSysObj = WScript.CreateObject(""Scripting.FileSystemObject" ")")
FailsafeFile.WriteLine("strStartup = objShell.SpecialFolders(""AllUsersStartup"")")
FailsafeFile.WriteLine("FileSysObj.DeleteFile strStartup & ""\Message.vbs"", true")
FailsafeFile.WriteLine("FileSysObj.DeleteFile strStartup & ""\Failsafe.vbs"", true")
FailsafeFile.WriteLine("Set colOperatingSystems = GetObject(""winmgmts:{impersonationLevel=impersona te,(Shutdown)}"")_")
FailsafeFile.WriteLine(".InstancesOf(""Win32_Opera tingSystem"")")
FailsafeFile.WriteLine("For Each objOperatingSystem in colOperatingSystems")
FailsafeFile.WriteLine(" ObjOperatingSystem.Win32Shutdown(ForceRestart)")
FailsafeFile.WriteLine("Next")
FailsafeFile.Close

Set colOperatingSystems = GetObject("winmgmts:{impersonationLevel=impersonat e,(Shutdown)}")_
.InstancesOf("Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(ForceRestart)
Next

This will disable the login if you don't want to wait for the timeout

Dim objShell, strPWD, CurUser, FileSysObj, strStartup
Const ForceRestart = 6

set objShell = createobject("WScript.Shell")
strPWD = ""
strDomain = "Domain"
CurUser = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CurrentUserName")
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", strDomain
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", CurUser
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", strPWD
objShell.Regwrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0"
objShell.Regwrite "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\S tart", 1, "REG_DWORD"
objShell.Regwrite "HKLM\SYSTEM\CurrentControlSet\Services\Mouclass\S tart", 1, "REG_DWORD"


set FileSysObj = WScript.CreateObject("Scripting.FileSystemObject")
strStartup = objShell.SpecialFolders("AllUsersStartup")
FileSysObj.DeleteFile strStartup & "\Message.vbs", true
FileSysObj.DeleteFile strStartup & "\Failsafe.vbs", true

Set colOperatingSystems = GetObject("winmgmts:{impersonationLevel=impersonat e,(Shutdown)}")_
.InstancesOf("Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(ForceRestart)
Next
__________________
Roger VanOrman
Network Analyst
Holt Cat

Last edited by rdvanorman; 02-06-2007 at 08:38 PM..
rdvanorman is offline   Reply With Quote
Old 02-06-2007, 08:35 PM   #5 (permalink)
 
Sachiv's Avatar
 
Status: Super Altiris Admin
Join Date: 06-21-2005
Location: Auckland NZ
Age: 28
Posts: 100


Your aware that means anyone could turn on your workstation and log it on as you?

I think you'll reconsider your request after the first email to the whole company confessing of your affair with the janitor in the broom cupboard. . (sent my someone having access to your e-mail).

---------

If your any sort of admin with any sort of privelages I would steer clear from this type of stuff.

Yes we just got audited...
Sachiv is offline   Reply With Quote
Old 02-07-2007, 08:35 AM   #6 (permalink)
 
Nick's Avatar
 
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,991


Yeah, using autologin can be a double edged sword and is something I check for on my network regularly.

I think it has uses but I would recommend that if you use it that it's of limited use and uses an account that has very limited rights.
__________________
Scire potentia est (knowledge is power)
Nick is offline   Reply With Quote
Old 02-07-2007, 08:41 AM   #7 (permalink)
 
Nick's Avatar
 
Status: Altiris Architect (Site Founder)
Join Date: 01-01-2005
Location: RDU, North Carolina, USA
Posts: 4,991


Yeah, using autologin can be a double edged sword and is something I check for on my network regularly.

I think it has uses but I would recommend that if you use it that it's of limited use and uses an account that has very limited rights.
__________________
Scire potentia est (knowledge is power)
Nick is offline   Reply With Quote
Old 02-07-2007, 09:19 AM   #8 (permalink)
 
brianl's Avatar
 
Status: Altiris Admin
Join Date: 01-05-2006
Location: Wisconsin
Posts: 56


We use a vbscript to set these also. We're imaging systems and then setting this through a DS job. For some reason it sets all of the registry settings but the PC does not log in because after reboot, DS has let the PC trying to log into the Local PC. Anyone have ideas how we can resolve this? It works every time if we push from NS.
__________________
"History will never accept difficulties as an excuse."
brianl is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 05:52 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
vB.Sponsors
Altirigos