Hi ChMod,

I still say you should speak with Management and at least express your concerns as this is against good security policies. NO, you can not do it during logon unless the user already has Administrator or Power User rights on the system, that is why it must be done as a remote Administrative script.

None the less, yes it CAN be done with KiXtart.

This script requires KiXtart v4.22 being run from an account that has Administrative rights on the workstations already.

First you need to get a list of all the workstations. You can probably use one of these UDFs to get the list.

NetView2() - Enumerate all computers in your domain
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=82503

COMNetView() - Enumerate all computers in your domain
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=82500

Then strip out any Servers or other computers you want to exclude.

Then run this script ... (modify the portions that apply to your information). It will check the list of computers supplied and ping to see if they are online, if they are found online it will add the Domain Users to the Power Users group on the system.

NOTE: This will not work though for foreign language OS as the group names will not be valid.

Howard Bullock though may have something to get around that if you need it.

GrpMaint.exe (756K) Ver: 0.9.2.2
http://home.comcast.net/~habullock/Perlutilities.htm
http://home.comcast.net/~habullock/Library/GrpMaint.exe


If you simply want to register KiXforms.dll on the systems you could also run this UDF and not modify the Security Groups on the systems.
RemoteExec() - execute a process on remote PCs
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=83206

Code:
Break On

Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')

Dim $System,$Systems,$CloseFile,$Results,$Results1,$Results2,$Results3,$Status,$AddTo
$Systems=ReadFile('C:\REPORTS\PowerUsers.txt')
For Each $System in $Systems
If $System
$Results = Join(wshpipe("ping " + $System + " -n 1",1),@CRLF)
$Results1 = Split(Split($Results,":")[2],"=")[0]
$Results2 = Split(Split($Results,"for")[1],":")[0]
$Results3 = Split(Split($Results,"from")[1],":")[0]
Select
Case (SubStr($Results,20,3)="not")
$Status=$System+'*'+'No DNS Entry'+'*'+'*' ; Not found in DNS
? $Status
Case (SubStr($Results1,2,5)="bytes")
$AddTo=AddToLocalAdmin($System,'Power Users','your domain','Domain Users')
$Status=$System+'*'+'Online'+'*'+$Results3+' Add Group: ' + $AddTo
? $Status
Case 1
$Status=$System+'*'+'Offline'+'*'+$Results2 ; Has an IP in DNS
? $Status
EndSelect
EndIf
Next

Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction

Function ReadFile($file)
Dim $lf, $f, $_, $t
$lf=Chr(10)
$f=FreeFileHandle
$_=Open($f,$file)
If @ERROR Exit @ERROR EndIf
Do $t=$t+$lf+ReadLine($f) Until @ERROR
$_=Close($f)
$ReadFile=Split(SubStr($t,2),$lf)
EndFunction

Function AddToLocalAdmin($Computer,$GroupToAddTo,$Domain,optional $GroupToAdd,optional $AccountToAdd)
Dim $Group,$User,$Admin,$Err
$Group = GetObject('WinNT://' + $Computer + '/' + $GroupToAddTo + ',group')
If $GroupToAdd<>""
$User = GetObject('WinNT://' + $Domain + '/' + $GroupToAdd + ',group')
EndIf
If $AccountToAdd<>""
$User = GetObject('WinNT://' + $Domain + '/' + $AccountToAdd + ',user')
EndIf
$Group.Add($User.ADsPath)
$Err = @ERROR
$AddToLocalAdmin=$Err
EndFunction

Function fnCOMErr($lErr)
If $lErr<0 $lErr=VAL("&"+Right(DecToHex($lErr),4)) EndIf
Exit $lErr
EndFunction