This is not a utility like what is being used there, this is a script file. You could add cscript. I suppose you could use something like Admin Script Editor to package this script as an executable, and then use it like you are wanting, but again I think that would be more work than it's worth. What would the command be to run this script against a list of computers? Or would you run it against an OU?
This is great though! Thanks for this script! It's not designed to be run against a list of computers. It could be fairly easily modified to do so, you just need a For Each Can I use this script to start an interactive program like notepad? I tried to use this script to logoff a user like: cscript remoteCommand.
The GetObject line returns me a "permission denied" error. To Anonymous, This page explains how to connect to WMI on a remote computer and all related security settings. Did all suggested security configurations but still couldn't make it work. Please suggest. Did you get any error messages?
Do you have administrator rights on remote computer? Hello Dmitry, Very nice article - thank you. Running under windows XP the interactive process spawns under the creator context as expected.
When launching under Windows it spawns under the localsystem account unfortunately. I'm thinking I might need to launch schtasks. Please, read my above comment: here. This script is very nice. I was wondering if there was a way to set it up so it could have a command like thefile.
Otherwise great job! Hey Dmitry, thanks for the post, it is very helpful. In your example, Notepad would open up every day! Do you have a suggestion for remotely and automatically removing the task that was created, after it executes the first time? Thanks, JasonRene. Actually upon closer review, I see that the scheduled job only runs once and then terminates, so please forgive my mistake on question 1.
However, question 2 remains - if you have any suggestions on how to determine the timestamp of the target machine, I would appreciate it. Anonymous November 7 , You have to pass arguments to your script. Solutions are explained here and here. JasonRene November 7 , You can get time from a remote computer. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses.
Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 0. Related Active 7 years, 11 months ago.
Viewed 4k times. CreateObject "WScript. Shell" objShell. Improve this question. Add a comment. Active Oldest Votes. Improve this answer. Establishing the WMI connection to the remote host is one additional line. You should add this extra line to make the answer self-contained. The reference to the MSDN page is useful for getting a deeper insight, but it shouldn't be necessary for the OP to follow it to get a working solution out of the answer.
0コメント