Page 1 of 1 1
Topic Options
#156128 - 2006-01-27 05:05 PM IsLocalAccount function?
gforgeot Offline
Fresh Scripter

Registered: 2005-12-01
Posts: 5
Hi,

I'm looking for a simple function to check if the logged account is a local one or a domain one.
Can you help me?

Thanks

Top
#156129 - 2006-01-27 05:08 PM Re: IsLocalAccount function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hmmm... need to wonder how your user is running the script. If it is a network logon script, it should not run for a local logon.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#156130 - 2006-01-27 05:11 PM Re: IsLocalAccount function?
gforgeot Offline
Fresh Scripter

Registered: 2005-12-01
Posts: 5
It is on a network drive but some IT need to test it with some local accounts (not always the same it would have been so simple ) mapping handly the drive.
Top
#156131 - 2006-01-27 05:13 PM Re: IsLocalAccount function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If it is a network logon and local users are running it *manually*, the @LogonMode macro will tell.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#156132 - 2006-01-27 05:19 PM Re: IsLocalAccount function?
gforgeot Offline
Fresh Scripter

Registered: 2005-12-01
Posts: 5
Domain users are also running it manualy. It is a script to genrate conf file before launching the application.
Top
#156133 - 2006-01-27 05:31 PM Re: IsLocalAccount function?
gforgeot Offline
Fresh Scripter

Registered: 2005-12-01
Posts: 5
I think that with the @LDOMAIN and @HOSTNAME I might be abble to do something quite simple
Top
#156134 - 2006-01-27 05:41 PM Re: IsLocalAccount function?
gforgeot Offline
Fresh Scripter

Registered: 2005-12-01
Posts: 5
Something like that


Function IsLocalAccount
DIM $tmp
$tmp=iif(@LDOMAIN=Left(@HOSTNAME,Instr(@HOSTNAME,".")-1),True,False)
$IsLocalAccount=$tmp
EndFunction

Top
#156135 - 2006-01-27 06:16 PM Re: IsLocalAccount function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I was thinking along the lines of checking the cache in:
HKEY_CURRENT_USER\Software\KiXtart\TokenCache
This would require that you invoke InGroup() to populate the cache.

But if what you have works, then go for it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 475 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.112 seconds in which 0.069 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org