I have a list of computers in wslist.txt and after the first computer every other computer gets a different logon account then identified in the vbs. Here is what I have so far:
Thanks for your help.
Code:
Dim ru, rp
ru = "domain\account"
rp = "password"
Set WshShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
For Each strComputer In Split(oFSO.OpenTextFile("wslist.txt").ReadAll, vbNewLine)
WshShell.Run "schtasks.exe /create /s \\" & strcomputer & " /tn CleanUp1 /tr \\Path\cleanup.vbs /sc monthly /st 02:00:00 /ru " & ru & " /rp " & rp & ""
WshShell.Run "schtasks.exe /create /s \\" & strComputer & " /tn Defrag1 /tr \\path\defrag.vbs /sc monthly /st 04:00:00 /ru " & ru & " /rp " & rp & ""
Next
Thanks for your help.