![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | schedule a task with WMI? i just wrote a script to do backups (with an imaging product) and now i want to make a script to deploy this and there are two things i need to do that im not really sure how to do. 1) create a schedule task with WMI (i want wmi so i can do it remotely) 2) create an account and add it to the admin group 3) modify the remote systems path enviornment var. (not a must, but would be nice) |
My System Specs![]() |
| | #2 (permalink) |
| | RE: schedule a task with WMI? Justin, One simple way is to use Control Panel > Scheduled Task to call a batch file (*.bat or *.cmd) that will launch the actual *.ps1 script. Make sure that the account has the right credentials to connect and function remotely on the target machine. Hope this helps. Do let us know. Thanks! -- http://www.leedesmond.com/weblog/ "Justin Rich" wrote: Quote: > i just wrote a script to do backups (with an imaging product) and now i want > to make a script to deploy this and there are two things i need to do that > im not really sure how to do. > > 1) create a schedule task with WMI (i want wmi so i can do it remotely) > 2) create an account and add it to the admin group > 3) modify the remote systems path enviornment var. (not a must, but would be > nice) > > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: schedule a task with WMI? To create the tasks remotely use the following WMI class: Win32_ScheduledJob It has a method create, by using this method you can create a schedule. Details: http://msdn2.microsoft.com/en-us/library/Aa394399.aspx regards On 24 Nov., 13:02, Desmond Lee <m...@xxxxxx> wrote: Quote: > Justin, > > One simple way is to use Control Panel > Scheduled Task to call a batch file > (*.bat or *.cmd) that will launch the actual *.ps1 script. Make sure that the > account has the right credentials to connect and function remotely on the > target machine. > > Hope this helps. Do let us know. Thanks! > > --http://www.leedesmond.com/weblog/ > > "Justin Rich" wrote: Quote: > > i just wrote a script to do backups (with an imaging product) and now i want > > to make a script to deploy this and there are two things i need to do that > > im not really sure how to do. Quote: > > 1) create a schedule task with WMI (i want wmi so i can do it remotely) > > 2) create an account and add it to the admin group > > 3) modify the remote systems path enviornment var. (not a must, but would be > > nice) |
My System Specs![]() |
| | #4 (permalink) |
| | Re: schedule a task with WMI? You can also schedule the task with schtasks.exe: schtasks /s <computerName> /create /sc minute /mo 10 /tn "PowerShell Script" /tr "C:\WINDOWS\system32\WINDOW~1\v1.0\powershell.exe c:\scripts\yourScript.ps1" /ru <username> /rp <password> More examples can be found here: http://www.microsoft.com/resources/d....mspx?mfr=true ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > i just wrote a script to do backups (with an imaging product) and now > i want to make a script to deploy this and there are two things i need > to do that im not really sure how to do. > > 1) create a schedule task with WMI (i want wmi so i can do it > remotely) > 2) create an account and add it to the admin group > 3) modify the remote systems path enviornment var. (not a must, but > would be > nice) |
My System Specs![]() |
| | #5 (permalink) |
| | Re: schedule a task with WMI? For your second request see Brandon's function ("Re: Windows XP, Users and Groups" thread) function Add-UsertoLocalGroup{ Param([string]$user,[string]$group,[string]$server) If(!($server)){$server = get-content env:COMPUTERNAME} Write-Host "Adding User [$user] to group [$group]" Write-Host "----------------------------------------------" -ForegroundColor gray $srv = [ADSI]("WinNT://$server,computer") $u = [ADSI]("WinNT://$server/$User,User") # Getting Group and Adding User $g = [ADSI]("WinNT://$server/$group,group") $g.psbase.invoke("add",$u.psbase.path) } ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > i just wrote a script to do backups (with an imaging product) and now > i want to make a script to deploy this and there are two things i need > to do that im not really sure how to do. > > 1) create a schedule task with WMI (i want wmi so i can do it > remotely) > 2) create an account and add it to the admin group > 3) modify the remote systems path enviornment var. (not a must, but > would be > nice) |
My System Specs![]() |
| | #6 (permalink) |
| | Re: schedule a task with WMI? I wrote a blog post on "Creating Environment variables", its for local use, I'll try to find a way to do it remotely: http://scriptolog.blogspot.com/2007/...variables.html ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > i just wrote a script to do backups (with an imaging product) and now > i want to make a script to deploy this and there are two things i need > to do that im not really sure how to do. > > 1) create a schedule task with WMI (i want wmi so i can do it > remotely) > 2) create an account and add it to the admin group > 3) modify the remote systems path enviornment var. (not a must, but > would be > nice) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Rename schedule task | VB Script | |||
| Task Schedule batch file | Vista General | |||
| Schedule a task with Vista task Scheduler wakes up computer and mo | Vista General | |||
| Schedule Task | Vista performance & maintenance | |||
| schedule task in powershell | PowerShell | |||