Page 2 of 2 <12
Topic Options
#70173 - 2002-11-21 03:45 PM Re: HKU/@SID vs HKCU
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, what about:
code:
$remotepcname="whatever"
for $counter=0 to 256
$sid=enumkey("\\"+$remotepcname+"\HKU",$counter)
if @error
$counter=256
else
$=writevalue("\\"+$remotepcname+"\HKU\"+$sid+"\software\microsoft\whereeveryou_need_to","put","it dot com","reg_sz")
endif
next

_________________________
!

download KiXnet

Top
#70174 - 2002-11-21 03:48 PM Re: HKU/@SID vs HKCU
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Enumerate this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

to get a list of all profiles. You can enumerate HKU to see which ones are active.

I have some Perl code that can be run as an ADMIN and it will load ALL profiles hives not currently loaded so that manipulate them. Maybe that is the process you want to code in KiXtart.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#70175 - 2002-11-21 03:53 PM Re: HKU/@SID vs HKCU
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Seems like a lot of work for something (screensavers, in this case) that can be done by policies.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70176 - 2002-11-21 04:00 PM Re: HKU/@SID vs HKCU
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, that you are correct on.
these are the little things that policies are for [Wink]
_________________________
!

download KiXnet

Top
#70177 - 2002-11-21 11:39 PM Re: HKU/@SID vs HKCU
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Additionally, you can only access the registries of logged-in users remotely. If a user is not logged into a specific computer, then the user profile (registry) is not available for that user on that computer.
_________________________
There are two types of vessels, submarines and targets.

Top
#70178 - 2002-11-21 11:41 PM Re: HKU/@SID vs HKCU
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
unless it's separately loaded.

btw jens, you seem to be checking all todays actives.
good, no need for me to do that
_________________________
!

download KiXnet

Top
#70179 - 2002-11-21 11:44 PM Re: HKU/@SID vs HKCU
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Was at a National Instruments LabView seminar today all day and not at work. So, I'm late and behind thanks to a 56k connection at home (but it's free [Smile] ).
_________________________
There are two types of vessels, submarines and targets.

Top
#70180 - 2002-11-21 11:46 PM Re: HKU/@SID vs HKCU
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it's free and faster than les' connection.
you should be happy [Wink]
_________________________
!

download KiXnet

Top
#70181 - 2002-11-22 03:09 AM Re: HKU/@SID vs HKCU
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
However, I'd rather be in Canada as in Boston. Living expenses are just through the roof over here. Of course, working for a University doesn't help either. [Frown]
_________________________
There are two types of vessels, submarines and targets.

Top
#70182 - 2002-11-22 03:47 AM Re: HKU/@SID vs HKCU
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
But your taxes are less. We pay out about half of out income to taxes. [Mad]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70183 - 2002-11-22 05:13 PM Re: HKU/@SID vs HKCU
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
OK, one more off topic post regarding taxes [Mad] and then I will ask forgiveness for my involvement in hijaaking this thread. (It's the catholic way... sin on Sat. confess on Sun. [Big Grin] )

http://ca.news.yahoo.com/020627/6/nc0o.html
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70184 - 2002-11-25 02:10 PM Re: HKU/@SID vs HKCU
TomV Offline
Fresh Scripter

Registered: 2002-11-25
Posts: 7
Maybe i am a little off, but why would you want to change a screensaver setting for users that are not logged on?

If you change the Hkey_Users\.DEFAULT\etc\etc settings every new user on that system will get these settings.
Every other user that logs on gets the HKCU - registry setting through the logon-script.
Why bother with the SID?
_________________________
Tom ;-)

Top
#70185 - 2002-11-26 02:28 PM Re: HKU/@SID vs HKCU
littleJean Offline
Fresh Scripter

Registered: 2002-11-20
Posts: 8
Loc: luxembourg
thanks for your help.

break on
dim $filter[0]
$filter[0] = 'Computer'
$objDomain = GetObject('WinNT://' + @DOMAIN + ',domain')
$objDomain.Filter = $filter
for Each $OC in $objDomain
? $OC.Name
$Index = 0
do
$Sid = ENUMKEY("\\" + $OC.Name + "\" + "HKEY_USERS", $Index)
$Error = @Error
if NOT @ERROR
if substr($Sid,1,8) <> ".DEFAULT"
;timeout : 30 minutes.
;$res=WRITEVALUE("\\"+$OC.Name+"\HKEY_USERS\$Sid\Control Panel\Desktop","ScreenSaveTimeOut","1800","REG_SZ")
;Activate it
$res=WRITEVALUE("\\"+$OC.Name+"\HKEY_USERS\$Sid\Control Panel\Desktop","ScreenSaveActive","1","REG_SZ")
;specify screensaver
$res=WRITEVALUE("\\"+$OC.Name+"\HKEY_USERS\$Sid\Control Panel\Desktop","SCRNSAVE.EXE","C:\WINNT\System32\logon.scr","REG_SZ")
;Activate password protection
$res=WRITEVALUE("\\"+$OC.Name+"\HKEY_USERS\$Sid\Control Panel\Desktop","ScreenSaverIsSecure","1","REG_SZ")
;Disable screensaver properties
$res=WRITEVALUE("\\"+$OC.Name+"\HKEY_USERS\$Sid\Software\Microsoft\Windows\CurrentVersion\Policies\System","NoDispScrSavPage","1","REG_DWORD")
endif
else
if @ERROR and @ERROR <> 259
? 'Error : ' + @ERROR + ' ' + @SERROR
logevent(2,1,$OC.Name+' '+@SERROR,'','Test10.kix')
endif
endif
$Index = $Index + 1
Until $Error
Next

Do you think that I must convert in UDF, for others to use ?

Top
Page 2 of 2 <12


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

Who's Online
1 registered (Allen) and 5157 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.042 seconds in which 0.021 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