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