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
6
votes
8 answers

Anyone have a script to delete a specific local windows profile?

I'm looking for Powershell (preferred) script, or .CMD or .VBS, to delete a specific user profile on a workstation (WinXP) or terminal server (2000, '03 or '08). I know all about the delprof utility... That only allows you delete based on a period…
Jordan W.
  • 1,423
  • 1
  • 13
  • 20
6
votes
7 answers

Get Latest Tag From Subversion

Is there a way to determine the newest tag in subversion? For an application I've deployed the client needs to have another server that they can access in case the live server goes down. There is already an automated system to copy the database to…
Brian Fisher
  • 641
  • 3
  • 10
  • 15
6
votes
5 answers

Powershell recursive WMI query

I'd like to start at the top of a WMI namespace, recurse through all the objects, then recurse through each object's property list, filtering out and returning to console only those properties that have mem in their names. This is what I have so…
quux
  • 5,368
  • 1
  • 24
  • 36
6
votes
1 answer

Automatically assign elastic IP to ec2 spot instance with user data script

Is it possible to automatically assign an Elastic IP address to a spot instance that has a persistent spot request using the 'Advanced' 'User Data' script box? I'm thinking that I could craft a script like... #!/bin/bash # Credentials export…
redband
  • 153
  • 2
  • 6
6
votes
1 answer

Run specific script after every Windows Update

Is there a way to run a specific script each time Windows update completes (i.e., after reboot or after an update that doesn't require a reboot)? My application is suffering from MSCOMCTL.OCX updates, and it seems that every time Windows Update…
krlmlr
  • 523
  • 1
  • 5
  • 17
6
votes
6 answers

Powershell script to delete oldest files (not relative to current date)

I DO NOT want to "delete files older than X days." If I wanted to do this, I'd just pick one of the thousands of scripts out there that have already been written for that purpose, and I wouldn't bother asking such a trivial question on…
Jonathan J
  • 584
  • 2
  • 5
  • 11
6
votes
3 answers

Can I "register" python scripts to execute on Windows?

I have Python 2.5 installed on Windows XP and a collection of scripts available in a certain directory. According to this article by Amanda Birmingham I can setup up a path for the Python executable and the one for where the scripts live. Which…
Jonathon Watney
  • 621
  • 1
  • 10
  • 17
6
votes
9 answers

Successfully, permanently ban a user from a website?

I have a social networking website and I want to ban a user from the website. I've added his IP address to the ban list in the .htacess file and to the php level for banning that user, but he keeps coming back with different IPs. How can I…
mahen3d
  • 4,342
  • 14
  • 36
  • 57
6
votes
6 answers

How to add a shutdown script (not by using gpedit.msc or active directory)?

I have created a script I want to deploy on my XP workstations as a shutdown script. I know I can add my script as a shutdown script with the UI (gpedit.msc), but I want to automate the deployment of my script. My workstations are not part of a…
Francis
  • 481
  • 2
  • 7
  • 19
6
votes
7 answers

Need a script/batch/program that runs a command that won't be killed when the parent is killed

The scenario I use Zabbix to monitor my servers and recently I wanted to add some more metrics for the Windows ones. For security reasons, I used Zabbix's User Parameter feature, but it limits the execution of external commands to about 3 seconds.…
billc.cn
  • 454
  • 1
  • 5
  • 12
6
votes
6 answers

Prevent sudo, apt-get, etc. from swallowing pasted input to STDIN?

I often write up wiki instructions to install various server packages on Ubuntu (11.10 Oneiric at the moment). They always involve things like: sudo apt-get install -y postfix sudo cp ~/siteconfig/etc/postfix/main.cf /etc/postfix but when you cut…
Jay Levitt
  • 229
  • 2
  • 6
6
votes
5 answers

Bash: Execute piped lines from stdin

I haven't found a solution to this after some searching. I think the search terms are just too general. I'd like to know how to execute a number of lines (at the bash prompt) which are generated by some other source. For example, I have a Python…
SabreWolfy
  • 368
  • 1
  • 2
  • 13
6
votes
3 answers

Bash variable assignment using another variable as part

I have the following excerpt from a bash script used to backup a database #!/bin/bash DB=database_name DBUSER=username FILENAME=$DB_$(date +%s).sql I am trying to reuse the value of DB within the FILENAME variable assignment, but it won't let me…
LukeR
  • 3,126
  • 2
  • 30
  • 25
6
votes
2 answers

Where do you share or find useful powershell, bash, batch, vbs, scripts?

I just wrote a quick little powershell script to make my life easier for a task that I was facing. I thought it would be nice to put it on the Internet, where someone else may also find it useful. The trouble is that it feels like overkill to open a…
Nate
  • 2,151
  • 6
  • 26
  • 41
6
votes
2 answers

Tips for optimizing RHEL/CentOS kickstart workflow

I'm working in an environment that consists of CentOS systems located in multiple data centers and office locations. I've been using a reasonable kickstart with a solid post-install script, but want to streamline and expand the process. We have our…
ewwhite
  • 197,159
  • 92
  • 443
  • 809