Page 1 of 1 1
Topic Options
#178271 - 2007-07-23 11:24 PM WriteValue( ) for Domain Users
smudley Offline
Fresh Scripter

Registered: 2004-07-15
Posts: 16
Loc: Texas of Course!
I'm writing a login script and I need to write entries into the registry when a normal domain user logs in.

I get an error 5 which I'm assuming is access denied.

Our company policy turns off regedit for domain users.
I've tried to search for something like my situation but it doesn't cover it totally or the topic goes off tangent.

If there is something specific, forgive me, my head is spinning reading though the threads and I'm approaching a deadline and really need to get something working.

This is all I have for code (pretty straight forward).

 Code:
writevalue( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","LegalNoticeCaption","Important Notice from ATI","REG_SZ")


Thanks in advance.

Smudley
_________________________
Thanks, Smudley

Top
#178272 - 2007-07-23 11:29 PM Re: WriteValue( ) for Domain Users [Re: smudley]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, hklm is of limits for normal users.
no matter what policy you have or don't.

but you should be able to add that caption to your policy.
_________________________
!

download KiXnet

Top
#178281 - 2007-07-24 06:05 AM Re: WriteValue( ) for Domain Users [Re: Lonkero]
smudley Offline
Fresh Scripter

Registered: 2004-07-15
Posts: 16
Loc: Texas of Course!
Unfortunately our AD is hosed pretty good and scripting is our only choice right now.

Any other ideas?
_________________________
Thanks, Smudley

Top
#178282 - 2007-07-24 06:10 AM Re: WriteValue( ) for Domain Users [Re: smudley]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use a remote admin script like this:
 Code:
$comps=comnetview()
for each $comp in $comps
  $rc=writevalue('\\'+$comp+'\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
,"LegalNoticeCaption","Important Notice from ATI","REG_SZ")
next

COMNetView() is available in the UDF Forum.


Edited by Sealeopard (2007-07-24 06:11 AM)
_________________________
There are two types of vessels, submarines and targets.

Top
#178418 - 2007-07-25 07:57 PM Re: WriteValue( ) for Domain Users [Re: Sealeopard]
smudley Offline
Fresh Scripter

Registered: 2004-07-15
Posts: 16
Loc: Texas of Course!

Thanks @Sealeopard,

That works for a "one shot gets all" approach.
Unfortunately I need it for each individual login just in case I miss one.
_________________________
Thanks, Smudley

Top
#178422 - 2007-07-25 08:35 PM Re: WriteValue( ) for Domain Users [Re: smudley]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
It does not matter if running regedit is disabled or not. Regular user cannot write to HKLM on Windows XP unless the permissions are changed.

There are some topics around on this board about runas (one N) and runnas (two N's). Runas is not secure because the username and password is in plain text in your script. Anyone can read this and therefore (ab)use the credentials. Runnas is a tokenized runas app that is much more secure then the first one.

Also you could warp the script in an executable. For example ASE can do that but there is also a free app on this board called kix2exe.

If there is no other way whatsoever I'd go for runnas (with the two N's).

The best (imho) and most secure way however would be to fix the AD and use GPO.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#178471 - 2007-07-26 06:09 PM Re: WriteValue( ) for Domain Users [Re: Mart]
smudley Offline
Fresh Scripter

Registered: 2004-07-15
Posts: 16
Loc: Texas of Course!
Thanks @Mart,

I agree with you on fixing AD but I ain't the boss so I must trudge on in the dark ages lol.
_________________________
Thanks, Smudley

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 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.03 seconds in which 0.013 seconds were spent on a total of 13 queries. Zlib compression enabled.

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