#140514 - 2005-05-28 12:19 AM
Help with FAQ code for replacing LOGON text in User Profiles
|
Huffinagle
Getting the hang of it
   
Registered: 2002-09-04
Posts: 75
Loc: McMinnville, OR, USA
|
How can I get the following code to work in my environment? Windows 2000 Active Directory. The code in red are my personalized information.
I've run the code and received the message, "script complete" but the test user profile wasn't modified. Code:
CLS BREAK ON $DomainString='MCMINNVILLE' $GroupString='ISTEST' $GroupObj = GetObject('WinNT://' + $DomainString + '/' + $GroupString) For each $UserObj in $GroupObj.Members ;-Look for the word NTLOGON in case of NTLOGON OR NTLOGON.BAT IF $UserObj.AccountDisabled<>'True' AND INSTR($UserObj.LoginScript,'NTLOGON') ?$UserObj.Name ?$UserObj.FullName $UserObj.LoginScript = 'WKIX32.EXE KIXTART.KIX' $UserObj.SetInfo $error=@error $logshare='H:' $logfile=$logshare+'\'+$DomainString+'CHANGESCRIPT.CSV' $logdata=$UserObj.Name+','+$UserObj.FullName+','+$error+@CRLF LOGGER($logfile,$logdata)
ENDIF Next ?'--' ?'Script complete' SLEEP 4
FUNCTION LOGGER($logfil,$logdat) $result=0 $n=0 DO $result=Open(1, $logfil, 5) IF $result<>0 IF $n=0 ;First wait ?'Please wait' ELSE ;follow waits '.' ENDIF SLEEP 3 ELSE $result=WriteLine(1, $logdat) $result=Close(1) ENDIF $n=$n+1 UNTIL $result=0 OR $n=5 ENDFUNCTION Also, it looks like there is a FUNCTION creating a log file. Where is this log file being created? Original FAQ Link
|
|
Top
|
|
|
|
#140516 - 2005-06-07 02:19 AM
Re: Help with FAQ code for replacing LOGON text in User Profiles
|
Huffinagle
Getting the hang of it
   
Registered: 2002-09-04
Posts: 75
Loc: McMinnville, OR, USA
|
Les,
I think I understand what you are saying. I need to replace NTLOGON with the text that is currently in my user account logonscript field. Is that correct? Currently, the BATch file name is login1.bat.
Would I then replace NTLOGON with login1.bat in the UDF? You also mentioned an LDAP string. Can you give me an example?
Thanks, Matt
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 271 anonymous users online.
|
|
|