What kind of configuration do I have to do on a W7 workstation in order to execute a kixtart script that is called by local GPO as the users open a session. The objective is to execute automatically (when the user open a session)a script on a W7 disconnected from the network.
#204162 - 2012-01-3112:15 PMRe: How to execute script s in W7 with the local GPO
[Re: yellowdog]
WittoWitto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
During user logon, add an entry to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Let it start a script on the computer Check for the environment variable %LOGONSERVER% Now you should know if the user is logged on to the domain or with cached credentials
Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
If the systems aren't part of a domain, why don't you just start the group policy msc on the local system. Since it isn't connected to a domain, you are only going to see the local computer policy. Select User Configuration, Windows Settings, Scripts, Logon and put your login script there. Is that what you were after, or am I missing something?
#204172 - 2012-01-3111:58 PMRe: How to execute script s in W7 with the local GPO
[Re: Les]
MartMart KiX Supporter
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Correct. I'm currently logged on with cached credentials and %logonserver% is filled with the name of one of my DC's so checking it will not work. Pinging a DC would be more reliable. Still not 100% though.
I found a good article on this... and it appears that %logonmode% worked at one time, but broke at some point. There doesn't seem to be a real good answer for this.
#204181 - 2012-02-0105:34 PMRe: How to execute script s in W7 with the local GPO
[Re: Allen]
Glenn BarnasGlenn Barnas KiX Supporter
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
The Kix @LOGONMODE macro also broke some time ago. I've been using a simple workaround for years..
When you are logging in via a live network connection, the netlogon folder is placed first in the system path. If you split the %PATH% variable and element 0 contains "netlogon" you can be reasonably sure that you're on a live connection and not offline/cached.
Code:
If InStr(Split('%PATH%', ';')[0], 'NetLogon')
'Live login' ?
EndIf
This might help in this situation. I don't use GPO-based login scripts so can't say for sure.
Glenn
_________________________ Actually I am a Rocket Scientist!
#204185 - 2012-02-0202:14 AMRe: How to execute script s in W7 with the local GPO
[Re: Allen]
Glenn BarnasGlenn Barnas KiX Supporter
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
This has been part of our commercial login script for a couple of years now. I know the logic works for legacy scripting, so the test must be for GPO script.
We use this logic to decide if the user's home folder should be mapped manually, most specifically for when a VPN user connects and then wants to run the login script instead of logging in via the VPN.
Glenn
_________________________ Actually I am a Rocket Scientist!