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

learn more… | top users | synonyms (2)

5
votes
1answer
6k views

Cacti graph not showing

I have created php script for cacti which outputs data in format like: <variable>:<value> Output of my script: temperature:20 humidity:15 Then I created data input method where input ...
5
votes
4answers
6k views

How to script printer creation on a Windows Server 2008 R2 clustered print server?

As per subject. I've found some ways of scripting printer creation on Windows print servers using WMI, but it looks like WMI doesn't support clustered print servers (or clustered servers at all). ...
5
votes
3answers
4k views

Ubuntu Upstart script hangs on start and stop

I have an upstart script that will start a custom jetty server. When I do sudo start [myservice] nothing happens. Subsequently, sudo status [myservice] show it as: [myservice] start/killed, process ...
5
votes
2answers
2k views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This ...
4
votes
4answers
900 views

Linux: How to change the extension of a bunch of files?

I have a directory full of files ending with .xxx. (Apple.xxx, Orange.xxx, Bannana.xxx) I want to change their extensions to .yyy. (Apple.yyy, Orange.yyy, Bannana.yyy) What's the quickest way to ...
4
votes
7answers
24k views

Move stored procedures from one database to another in SQL Server

I'm using SQL Server 2008, and I would like to copy stored procedures from one database to another. How?
4
votes
2answers
532 views

Where is the script that creates home folders in linux?

I want to added public_html and private_html folders for users of my web server (Fedora 8 or 10 or something). Where is the script that will create those folders for them when they log on? Is there ...
4
votes
5answers
237 views

What is wrong with following bash script?

I wrote following line in my script , but it not assigning any value to variable a a= grep -n mark /etc/samba/smb.conf |cut -d: f1 I aspect line number where mark string present in smb.conf in ...
4
votes
12answers
11k views

Cisco Guy looking for best language to automate tasks and pull info from routers & switches [closed]

I am a cisco engineer and am wanting to learn ways to automate tasks for router and switches and pull info, etc... I am unix/linux challenged. So I deal with windows. Perl or Ruby keep coming up ...
4
votes
4answers
252 views

Disabling ssh as root on Linux boxes and the challenges of writing scripts

It's a common suggestion from security-minded people to disable ssh as root on Linux boxes. My question is this: Let's say you normally write lots of scripts which ssh to a large number of Linux ...
4
votes
2answers
2k views

How To Shutdown Ubuntu Automatically X Minutes After Starting Up?

How would one automatically shutdown an ubuntu OS 30 minutes after it was turned on? Or 15 minutes after it was turned on? Etc? I tried creating an init.d script like so: shutdown -h +5 But my box ...
4
votes
8answers
572 views

What have you used Makefiles for (besides build automation)

Makefiles are great for automating builds, installs and tests. But, that is not the end of Make. I have used makefiles to do many tasks like cleaning up logs, keeping mirrored web pages and ...
4
votes
6answers
551 views

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 ...
4
votes
6answers
30k views

Execute program on remote computer using PowerShell

How can I execute a program on a remote machine using powershell?
4
votes
5answers
1k views

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 ...
4
votes
3answers
11k views

How to use a config file (ini, conf,…) with a Powershell Script ? Is it possible?

Is it possible to use a configuration file with a PowerShell script ? for example, the configuration file: #links link1=http://www.google.com link2=http://www.apple.com ...
4
votes
1answer
715 views

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 ...
4
votes
3answers
3k views

Change Passwords for All Users on Linux Server

I've got 10 Linux servers that I need to lock down, by resetting the passwords for every single user all at once. The story behind this is long, but the general idea is that I need it to happen very ...
4
votes
6answers
19k views

How to get the IP Address for your Local Area Connection on Windows Server?

I want to create a batch or vbs file that will put together a url and executed. Part of that url needs to be the actual ip address of the machine. How I am able to get that IP address in a variable ...
4
votes
2answers
5k views

Can I use rsync to create a list of only changed files?

I am using rsync in a bash script to keep files in sync between a few servers and a NAS. One issue I have run into is trying to generate a list of the files that have changed from the during the ...
4
votes
2answers
4k views

Run a script after I unlock my Windows session?

How do I run a script each time I unlock my Windows 7 session? So, if I lock my session and then log in again, I want the script to run. Do login scripts configured in the Group Policy do this or ...
4
votes
2answers
432 views

What is the best way to keep track of changes people are making to your servers?

HI Folks, I work at a company with a handful of windows servers in production running our software as a service offering. Part way through making a bunch of changes such as creating new Databases, ...
4
votes
3answers
5k views

Importing a large SQL script into SQL Server?

I'm trying to move a database from our production server to our test server. I've used Microsoft's Database Publishing Wizard to create a script containing the schema and data for the production ...
4
votes
1answer
1k views

How to export a Full SMTP Log in Office 365

In Office 365, is it possible to export the SMTP log? Maybe in powershell or any other way. My goal is to have a complete overview of all messages send from and to a specific domain.
4
votes
4answers
887 views

Lightweight script for monitoring disk space, ports, etc.?

If I want to monitor some machines that I'm not the primary maintainer of (ie, I don't have access to install packages), are there any lightweight alternatives to things like Nagios? I'm looking for a ...
4
votes
5answers
2k views

Bash: Quotes getting stripped when a command is passed as argument to a function

I am trying to implement a dry run kind of mechanism for my script and facing the issue of quotes getting stripped off when a command is passed as an argument to a function and resulting in unexpected ...
4
votes
2answers
325 views

OK to modify HKLM\Software\Policies and HKCU\SOFTWARE\Policies on a domain?

Background: I have a domain (2003 Functional Level) with a mix of Windows XP and Windows 7 clients. We have been using Group Policy to manage our workstations. Now, I am in a situation I need to ...
4
votes
1answer
8k views

Batch script to test if a folder exists fails when checking a UNC path

I've written a small batch file to help us with a server migration to remap user directories using GPO. However in the batch file I'm having a syntax problem that appears right but it's still ...
4
votes
2answers
257 views

Repartitioning two disks without a loss of data

I am interning at a software company and I have hit somewhat of a brick wall. Here is the deal: The Problem: We have some boxes around here that were incorrectly partitioned for 2 x 500 GB drives. ...
4
votes
3answers
2k views

How would I create a PDF print server?

I have some old workstations with WindowsXP that I can install pretty much anything on, an office with about 80 people, a wintel environment, an existing Server 2003 file/printer server, and everybody ...
4
votes
1answer
1k views

Amazon EC2 notifying the instance when the autoscale service terminates it

I am in need of knowing when an instance is supposed to be shutdown by the autoscale, as I want the instances to register themselves and deregister themselves from a given service. I know that the ...
4
votes
1answer
4k views

How to stop Subversion from prompting about: Server certificate verification failed: issuer is not trusted

I need to be able to deploy new instances of an application from a subversion repository. This is accomplished by running shell_exec() from a PHP script. However, Subversion won't let me check out ...
4
votes
1answer
5k views

How does Outlook identify “Extra Line Breaks”

I am writing a script that emails the output to me, and I read it in Outlook. For some reason Outlook removes all the line breaks in the message, and gives me a little notice that it has removed the ...
4
votes
5answers
3k views

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 ...
4
votes
6answers
4k views

email output of powershell script

I found this wonderful script that outputs the status of the current DFS backlog to the powershell console. This works great, but I need the script to email me so I can schedule it to run nightly. I ...
4
votes
1answer
4k views

How can I find all groups a user belongs to via DSQUERY

How can I find all groups for a specific user (groups for which the user is assigned) using dsquery?
4
votes
2answers
5k views

Create kickstart configuration file from existing configuration

Is there a script or another way to automatically generate a kickstart configuration file from the system state of an existing server so that the file can be use to replicate (not clone) the ...
4
votes
3answers
624 views

Send bash -x output to logfile without interupting standard output

Is there a way to send the information displayed by running a bash script with the -x option to a file, while not changing the standard output seen by a user running the script? This is a debugging ...
4
votes
2answers
7k views

delete registry key using wildcards

I'm hoping to find a way to delete registry keys based on wildcards using a batch file rather than writing some vbscript. Does anyone have an example? I'm forced to proceed with MS's wonderful ...
4
votes
2answers
2k views

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 ...
4
votes
2answers
823 views

Is it possible to have a scheduled task click a button in Windows?

One of my clients has an application that can not be run from command line or via API but needs to be run on an scheduled basis. It would require that I launch the application if it's not already ...
4
votes
3answers
245 views

Windows Server 2008/2003 - determine all “used” local network ports

I have been tasked with enabling the local firewall on 100+ servers. The systems are running many different applications using many different ports. I began with an nmap scan, but without going to ...
4
votes
2answers
1k views

How to get from a Hyper-V 2008 R2 node with Powershell the IP address and Vlan ID

I tried to take from the Hyper-V (Hyper-V 2012) node with this command the IP address: Get-VM | select -ExpandProperty networkadapters | select vmname, ipaddress The thing is that i take as an ...
4
votes
1answer
917 views

Trying to monitor file/folder changes on the server and send notification. What am I dong wrong?

I am trying to make a script to monitor a directory of the EC2 webserver I am managing. I found inotify and tried to make the following script but upon trying it nothing happened. #!/bin/sh while ...
4
votes
1answer
375 views

I'm looking for a robust way to determine if a service can be stopped or killed

I'm looking for a robust way to determine if a service can be stopped without data loss or corruption, or if a regular stopping will work if the service can be killed via powershell. I thought about ...
4
votes
1answer
2k views

Shorcut to list pending updates in Microsoft Windows

Is it possible to create a shortcut to "View update history"? Or, do you have a script (powershell, vbs, cmd, ...) to list pending updates?
4
votes
2answers
3k views

What version of Windows Management Framework is installed?

How do you check to see what version of Windows Management Framework (WMF) is installed? It seems like it should be a simple thing to find out, but I cannot. Even Googling a bunch of different ...
4
votes
2answers
459 views

Scripted forwarding for Outlook 2003

We have a staff member in sales who has gone onto a 4 day week (getting ready for retirement), so each Thursday afternoon her email needs to be forwarded to another user and each Friday afternoon it ...
4
votes
2answers
286 views

Any ideas for automatic initial/scripted configuration of a NetApp?

The background is to make a solution where we can automate as much as possible the building up of ‘pods’ that include server/network/storage and that will be built at remote sites. In an ideal world ...
4
votes
3answers
307 views

How do I launch a command on a remote computer with an invalid domain trust? (using local creds)

I intend to use WMIC to reset the trust of a machine that is remote, and off the network. All of the following variations result in an "access denied": The following works fine: net use ...