LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-22-2018, 10:11 AM   #1
MSmith_CCC
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Rep: Reputation: 0
Linux To Windows Scripting


Good morning!

I apologize but I don't really know where to begin with this. Here's what I'd like to do if possible.

I have a few old boxes that I want to put a very thin, no-gui distro of Linux on and start using them as single-task machines for simple things that can just run all day and night.

The tasks I want them to do, however, are against Windows machines.

For example, I'd like to have a single box that cycles through scanning all applicable subnets and, as it finds an online system, it attempts a few steps.

First, it would check whether or not a scheduled task already exists on that Windows machine. If it does, it's done.

Second, if no task present, it would check to see if a specified share exists (say... \\system\taskfolder). If not exists, create it on that Windows machine.

Third, if/when share exists, check to see if saved scheduled task (mytask.xml) exists in \\system\taskfolder. If it doesn't exist, it will put a copy of it on there from the current Linux box to that Windows share.

Fourth, it will then reach out to the Windows machine and run schtasks to deploy the task. Similar to, if I were on a Windows box, I'd use psexec \\system cmd.exe /c schtasks -myswitchesetc...

Is this possible from a basic, stripped down Linux box to a group of identified, on a domain, Windows boxes (of course, I have the correct Win creds)?
 
Old 04-22-2018, 11:45 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
some of them obviously possible, some of them may require windows related knowledge.
Especially how do you want to execute commands on which version of windows (like how to find scheduled tasks)?
 
Old 04-22-2018, 06:39 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by MSmith_CCC View Post
Is this possible from a basic, stripped down Linux box to a group of identified, on a domain, Windows boxes (of course, I have the correct Win creds)?
So you seem to like challenges.

Windows is extremely bad at these kind of things. They tried to patch Windows here and there so a few overly complicated methods can be used to carry out rudimentary tasks.

One of those patches is called Powershell. It seems to be possible to do Powershell over SSH and that should your the solution. Google for "Powershell over SSH" and you'll find some information.

jlinkels
 
Old 04-23-2018, 12:34 AM   #4
MSmith_CCC
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
some of them obviously possible, some of them may require windows related knowledge.
Especially how do you want to execute commands on which version of windows (like how to find scheduled tasks)?
Command line is fine, Powershell as well. All systems will be Win7 to Win10 with at least Powershell v2 available, v5 where I've already had my hands on them. :-)
 
Old 04-23-2018, 12:36 AM   #5
MSmith_CCC
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlinkels View Post
So you seem to like challenges.

Windows is extremely bad at these kind of things. They tried to patch Windows here and there so a few overly complicated methods can be used to carry out rudimentary tasks.

One of those patches is called Powershell. It seems to be possible to do Powershell over SSH and that should your the solution. Google for "Powershell over SSH" and you'll find some information.

jlinkels
PoSH over SSH? I've played a decent amount in PoSH and never even heard that referenced. I'll start looking. Thanks for the lead. Like I said with this post, didn't have a clue where to begin. Will check in in a couple of days with what I can find.

Thanks!
 
Old 04-23-2018, 12:46 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
just for example:

https://www.nsoftware.com/powershell/server/
https://unix.stackexchange.com/quest...rdesktop-comma
cygwin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate FTP / Scripting FTP Transfers files from linux to windows m/c ashishshukla Programming 5 05-26-2016 09:10 AM
LXer: Shell Scripting Part I: Getting started with bash scripting LXer Syndicated Linux News 0 04-29-2015 08:03 AM
LXer: Scripting the Linux desktop, Part 2: Scripting Nautilus LXer Syndicated Linux News 0 02-17-2011 04:02 AM
Is there a shell scripting interpreter in/for Windows? FirstBorn Programming 3 08-03-2008 02:51 PM
A few issues with X-windows and scripting... cheshirechap Slackware 1 08-13-2004 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration