Questions tagged [scripting]

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

Scripting is usually done in a scripting language. Such scripting languages are often dynamically typed and interpreted, as opposed to compiled languages. Examples of such languages include PowerShell, Perl and Bash.

1826 questions
0
votes
5 answers

ubuntu: runing .sh files as root

How do I run a .sh script with root privileges from Ubuntu's cmd? Some scripts require to enter the password. I watn to avoid this.
lak-b
  • 117
  • 1
  • 2
0
votes
1 answer

#! won't make linux run an interpreter

Here's the script: #!/usr/bin/env ruby CODES = {} puts "ok" Under root user everything is fine: # ./test.rb ok When munin's default interpreter is /bin/false nothing is happpening: # su munin -c ./test.rb When default interpreter is /bin/sh, it…
Pavel Koryagin
  • 255
  • 1
  • 3
  • 8
0
votes
1 answer

What tools can run scripts on multiple windows servers?

I'm looking for a tool that can schedule a job (shell script, vbs, powershell) on 100+ standalone Windows servers. I know Altiris can do that, but I think it needs an agent on every server. I prefer an agentless (affordable) solution. Tips would be…
ZEDA-NL
  • 846
  • 1
  • 6
  • 13
0
votes
3 answers

Local login script to delete folder of currently logged in user

How can I create a login script that will delete the contents of the folder below, each time a user logs off of a PC? (We have a shared PC that about a dozen users use, for a particular program. That program caches their AD login credentials in the…
Citizen Chin
  • 532
  • 2
  • 12
  • 21
0
votes
1 answer

Hyper-V and Windows Server with Powershell/Automated?

So my work is looking into Automating Hyper-V Servers for Test Environments, Basically in the end we want to have a sort of Web/Form interface for selecting a server spin up. Right now it's done manually but for the first part maybe scripting some…
user57862
0
votes
1 answer

How to reference Domain-Admins with icacls?

I need to reference the "Domain-Admins" group in a batch file. The line in question looks like this: icacls "test\folder" /grant mydomain.com\Domain-Admins:F ... and works as expected. But how do I reference the "Domain-Admin" group in general? My…
bjoster
  • 4,805
  • 5
  • 25
  • 33
0
votes
1 answer

Powershell script to insert SQL Statement with a apostrophe error

I have the following part of a script that takes objects form Exchange and AD and inserts into a MYSQL table. But some of the Full Names variables have a ' like the distribution group PA's. Here's the script part of: # Get Distributions List…
MuddyBiker
  • 1
  • 1
  • 3
0
votes
2 answers

Ruby Script to get some stats from Servers

I've been tasked with writing a script that will run on a server every few hours to log the cpu usage, memory, and disk utilization. This script will be run on windows and linux boxes. I chose ruby for this task. I am new to scripting. I have…
0
votes
1 answer

Manipulating Launchd from Python?

I have a simple python script for manipulating a plist file. Once this file is updated, I'd like to have that same script unload and then load that plist file in launchd. Normally, I'd use launchctl from the command line to do it. I could still do…
Sigsegv
  • 101
  • 2
0
votes
2 answers

Good pratice to create script to start/stop/restart service?

I was wondering what is a good pratice to create a good script to start/stop/restart some service. I will try to make myself more clear, ok ? Nowadays, I do something like this: let's say I would like to create a script to start/stop/restart a…
Valter Silva
  • 155
  • 1
  • 4
  • 14
0
votes
1 answer

One-liner to retrieve external IP address

Possible Duplicate: Finding the Public IP address in a shell script For use in scripting, it would be handy to be able to do this: IP=`....something ....` echo ...$IP... >> configfile I'm looking for the IP address as seen by the web, in this…
Steve Bennett
  • 5,750
  • 12
  • 47
  • 59
0
votes
2 answers

Powershell changing Date to the first of last month when the script runs

If I run the script on 2/4/2013or any other day in February I want the date to be change to 1/1/2013. I am replacing date on line 59 with this value. #Get the content of the CMS Script. $CMSReport = Get-content C:\reports\CMSReport.acsauto # Go to…
Carlos
  • 21
  • 1
  • 1
  • 4
0
votes
1 answer

Is there a way to create a mail enabled contact from a script in Exchange 2003?

I've seen the newer cmdlets for 2010+ in Exchange, but it looks like the only way to do things in 2003 Exchange is through the management console. Is there anyway to make contacts from a script?
johnny
  • 2,328
  • 9
  • 37
  • 57
0
votes
1 answer

Omnibus uniform Chef version install across platforms

So I'm looking for a uniform way to install chef on a number of different servers running different platforms. I know I can use the omnibus installer for this, but I also need a way to lock or otherwise keep the versions consistent across machines.…
CRThaze
  • 151
  • 8
0
votes
1 answer

Export hardware specifications to a spreadsheet for Windows Server

I have a bunch of servers : Windows 2003 and 2008. I just wanted to export these hardware specs to a spreadsheet: cpus : num processors, clock speed, etc total hard disk space total used disk space computer model I started writing a script to do…
James
  • 157
  • 3
  • 14