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)

2
votes
2answers
641 views

Shell script command output in if condition comparison fails to compare to same value string

I'm incorporating a script snippet which determines Android version via: adb shell getprop ro.build.version.release which returns: 4.1.2 or 4.0.4 The snippet currently looks like this: if [ "$(adb ...
4
votes
1answer
1k views

Assign Static MAC address to VM Hyperv

I have a scenario that involves building out a ton of virtual machines in Hyper-V, I cannot use SCVMM and must use a scripted method to create these VMs. I have a CSV with all required information ...
0
votes
1answer
2k views

Using Powershell to Create Exchange Contacts from a .CSV file

What I would like to do is use a Powershell script to create Contacts within a certain folder in Active Directory from a .csv file. This script should allow me to create the first part of an email ...
1
vote
1answer
212 views

Scripting WINS Tombstone Removal

I'm creating a script to remove the tombstoned entries in WINS (required for exchange w/ multi domains). What I'd like to know is if removing those old entries will break anything? Or if there's ...
4
votes
2answers
486 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
350 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 ...
-1
votes
1answer
241 views

sed regexp for replacing xxx in define('DB_PASSWORD', 'xxxx');?

I'm looking for a regexp to quickly replace the password inside the following wp-config file, like so: define('DB_PASSWORD', 'xxxx'); Now the config file has many defines, so it essential to only ...
-1
votes
1answer
161 views

portqry to check connectivity

Is it possible to check the connectivity between 2 remote servers using portqry given that the portqry.exe command is executed on another server. for example, check the connectivity between serverA ...
2
votes
5answers
260 views

debian bash/sh string execution

I am stuck with this piece of code here user@server:~$ TEST="ssh rsync@otherserver.example.org 'date; hostname -A; uname -a'" user@server:~$ $TEST bash: date; hostname -A; uname -a: Command not ...
0
votes
1answer
173 views

Windows Login straight to Terminal Server

Essentially I'm looking for some way via batch (or potentially powershell, but win XP machines so ideally batch) to open up a RDP connection to a LAN based Terminal Server upon a user logging into a ...
0
votes
1answer
92 views

Script to move Maildir contents to its parent dir but for multiple folders

I totally suck at Bash/Python/Ruby/Perl Scripting (need to practice/learn some more) so I'm asking for a little help :-) I need to move about the contents of about 60 Maildirs to their parent folder ...
1
vote
2answers
85 views

computer startup script reporting success to a server

I am using Group Policy to deploy a computer startup script that tries to uninstall one program and install another. I need this script to report its status (whether a certain file exists on the ...
0
votes
1answer
87 views

Auto-restart “screen” script not working

I'm looking over a script that would actually be restarting game-servers in case they crash. The game-servers are actually started in a screen session through a control panel. They have to be ...
1
vote
1answer
333 views

Set the username and password for DCOM application

Is there a way to run a script against a remote machine to enter the username and password for a specific DCOM application? Locally on the server, I can open up Command Prompt, and type: dcomperm ...
2
votes
1answer
92 views

Test Multiple Server for login (WIndows 2008)

I currently run a PING sanity check test (batch file with result file) on over 80 servers in 4 environment. But, even if we "ping" ok 100% of the servers, it doesn't mean that the machine are working ...
0
votes
1answer
59 views

Script to rename home folder from a name to an assigned number

I am looking to rename some home folders within AD to and card ID number for my users. i want to eliminate having to manipulate a home folder for a user when the name changes so we are going to a ...
0
votes
2answers
109 views

monit displays false number from my uptime script

I've wrote a script for fetch real uptime and display in monit. But I think it displays just exit error status. My uptime script is: #!/bin/sh uptime=`uptime | awk -F " " '{print $3}'` echo $uptime ...
1
vote
1answer
308 views

Is there a programmatic way to determine free disk space on a Linux server?

I have a collection of Linux servers, each of which has a local hard drive with a /tmp directory. Occasionally, the /tmp directory on a server will fill up and cause errors. I want to automate the ...
0
votes
1answer
297 views

Issue with ifconfig in a shell script (using cron)

If I execute this script manually in Debian: #!/bin/bash /sbin/ifconfig wlan0 down /sbin/ifconfig wlan0 up sudo iwconfig wlan0 essid "WLAN_NETWORK" sudo iwconfig wlan0 key myPassword sudo dhclient ...
4
votes
5answers
2k 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 ...
2
votes
1answer
337 views

Red hat script on shutdown

I need to backup some files every time i will shutdown a Red Hat enterprise 4 Linux. I thought about make it with a script in /etc/rc0.d but shutdown process should wait for my script to finish. So ...
1
vote
1answer
129 views

suggestions on scripting a move of lots of files from one linux host to another [closed]

I've got several TB and many thousands of files I need to move across the network from one Linux host to another. I'd like to get suggestions on how to script this with the following points in mind: ...
0
votes
1answer
111 views

Backing up remote Postgres database

I have a Windows 2008 Server machine with a postgres database running on it. I'd like to back it up daily and have it sent to another machine (running Ubuntu or Windows). What's the best way to set ...
-1
votes
3answers
60 views

What shell scripts have run [closed]

Is there any way to determine what shell scripts ran within a certain time frame? I.e. I need to know all the shell scripts that ran yesterday between 2:00 an 5:00.
0
votes
2answers
2k views

Need to modify VB script so it deletes all existing network printers first

We have a fantastic VB script that adds multiple network printers, then goes on to select one of them to be the default. Dim multiPrinter, UNCpath1, UNCpath2, UNCpath3 UNCpath1 = "\\server\printer1" ...
-3
votes
1answer
104 views

On linux, how can I create script to reboot server if it loses internet for x hours? [closed]

I have ubuntu server that has some services that only come back after loosing internet for an extended period of time with a reboot. Does anyone have a script that can reboot server if lose internet ...
1
vote
2answers
454 views

How to prevent termination of long-running Python script

I have a cron job running a Python script on a VM-based remote Ubuntu server. The script takes a couple hours to run, and I'm noticing the kernel appears to be terminating the script before it ...
1
vote
1answer
273 views

Batch script to create home home directories from list of names

I'm trying to create a home directories with permissions from a text file. I can only get the batch file to run the first line. Can anyone tell me why? I initiate the scripts by running go.bat as ...
0
votes
0answers
41 views

Server setup scripts, patches and migrations

I have written some scripts which I use to configure various servers in a uniform way. Each time I deploy a server I run the relevant scripts so that I know they're all configured the same. I then ...
0
votes
1answer
335 views

.bat file - Nagios v3.2 service check and start if stopped

I'm just barely getting into programming so I do apologize for my ignorance. I'm trying to create a .bat file that will check if a service is running on XP Pro. If service is running it will exit 0. ...
12
votes
2answers
290 views

What is the industry standard method for administering the change of the local administrator password for all machines on a domain?

Although there appears to be three available options, one of which is actually secure, there seems to be only two available choices that will be able to impact machines that are not powered on at the ...
0
votes
1answer
87 views

Changing Zone files with sed

I have this dns zone file I was unable to change the resource record type A to CNAME @ IN SOA ns1.domain.com. webdev.domain.com. ( 2006080101 ; serial 8H ; refresh 2H ...
3
votes
1answer
56 views

Getting WINS Server Statistics

I know WINS is ancient. No need to remind me. For what it's worth, this effort is going toward a project to retire it from the environment altogether. But before I can do that - I need to be able to ...
0
votes
1answer
34 views

Running server side applications that have no front end or user interaction.

I am setting up a system that required a series of scripts that run 24/7 quering a database to check if data meets certain requirements and then triggers alarms as well as inserting data into the ...
-4
votes
1answer
1k views

How to automate a transfer of file from server to local system using ftp

I have a windows server 2003 which generates backup file to ftp folder in the server(using my own script). And I will ftp and copy it to my local hard disk daily. How can I automate this process using ...
-1
votes
1answer
83 views

ESXi free scripting [closed]

I am trying to figure out if it is possible to script commands on the esxi system to run commands on the esxi system after the first auto start vm at a specific time after it is powered on before the ...
-2
votes
1answer
657 views

Script to copy down portions of a roaming profile [closed]

I'm currently working on migrating users to Windows 7 from XP. We use roaming profiles. Xp creates a folder named "Profile", while Windows creates "Profile.V2". Theses folders are independent of each ...
3
votes
2answers
105 views

Discrepancy in ssh-agent behavior

It seems like i'm having a bit of a discrepancy between the behavior of ssh-agent for two accounts I have configured. I wrote a simple monitoring script to check on the availability of some VMs we ...
0
votes
3answers
34 views

Measuring Program execution time

I would like to call a program from a script, (malwarebytes, chkdsk, A/V scan) and have the script keep track of how long the program ran. Could someone point me in the direction of what I should be ...
0
votes
2answers
247 views

how to get the full path of a of an open file

I have script that runs on a Windows server to perform operations on certain files. The script often fails because various users (even myself) have open file shares on the server that they've ...
2
votes
1answer
70 views

Remove DVD drive from device manager - command line

Is there a way through command line to uninstall the entry under DVD/CD-ROM drives in device manager? Somehow someone applied a GPO on our top level domain and it's affected a number of things, I've ...
1
vote
3answers
646 views

How can I suppress the “…this does not map back…” message when using SSH?

I am writing a script that attaches to several of our machines via SSH to check some usage stats. Each time I do: ssh -i ~/.ssh/ourkeyfile.pem user@host I get the typical message: Address ...
0
votes
4answers
347 views

Script runs on 50 servers. How can I ensure only one executes a particular step?

I have some work that needs to be done on 50+ servers. The first step is to checkout an updated version of some source code onto a shared directory (assume all have the shared drive mounted). The ...
0
votes
1answer
99 views

Close a SSH Session when it suspend

I start a ssh session on a remote host and execute a script on the remote host. The Script is an update script that change the remote IP. Now my local bash script hanging on the line with this ...
1
vote
0answers
695 views

Powershell Script Hard drive Inventory

I've created a script to get hard drive information from our servers. The script use WMI to query the Win32_LogicalDisk class and returns "Size (GB)", "Free Space (GB)" and "Free Space (%)" for each ...
45
votes
6answers
11k views

Why use Chef/Puppet over shell scripts?

New to Puppet and Chef tools. Seems like the job that they are doing can be done with shell scripting. Maybe it was done in shell scripts until these came along. I would agree they are more readable. ...
1
vote
1answer
415 views

How to not run /etc/profile.d/custom.sh during Secure FTP login

When I attempt to Secure FTP (using WinSCP) to my CentOS 6.4 box I'm prompted with a message that states: Received too large (168438314 B) SFTP packet. Max supported packet size is 1024000 B. This ...
0
votes
0answers
72 views

Batch script terminates too soon

I need some help with Windows batch/CMD scripting. I wrote a script to record mic-in to a MP3 for 12 hours. It runs ok when running it manually. It will run with task scheduler too - just that, ...
0
votes
2answers
312 views

Putting this command into bash script

with help of google , script that measures multicast streams bandwidth. Here it is tcpdump -tnn -i eth1 -f multicast | sort | uniq -c | awk '{print $3,"> "$5,$1*$NF/2*8/1024 " Kbps"}' | awk '$1 ...
4
votes
1answer
570 views

How to get Mailbox Folder Permissions with SamAccountName or UPN?

I need to collect and store the folder permissions for each folder in each mailbox of our Exchange system. I'm already aware of the Cmdlet Get-MailboxFolderPermission but it has a serious problem. ...