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)

1
vote
2answers
482 views

CentOS 7: Getting interface IP numbers

I am trying to autopopulate the /etc/issue in a CentOS 7 image (this will be a template, and it needs to be easy to identify the resultant VMs at a glance). I have the following in my ...
1
vote
1answer
237 views

Modifying xml definition of a running KVM domain via script

How can I modify the xml definition of a VM over ssh? I know that I can do this interactively by logging into the host and using: virsh edit <domain name> But I want to automate this ...
-1
votes
1answer
66 views

DNS server with scripting [closed]

I would like to know if there's any way of having a DNS server on Linux that runs a script and reply a different IP list depending on the script data returned. I've searched Google for 'DNS server ...
1
vote
2answers
319 views

How to automate GPG file decryption over SSH?

I would like to use GnuPG to decrypt short messages that are stored on a remote host (running Linux), i.e.: ssh [<user>@]<host> gpg -d <file-to-decrypt> interact with gpg-agent ...
-1
votes
1answer
52 views

how can i redirect run program command on different server [closed]

I have 2 server Linux server (RHEL5). Server1 is running X server where users connect to it with VNC/NX and the other one is for running programs. So users don't interrupt to each other, I want to ...
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 ...
-1
votes
2answers
54 views

How to discover my own IP address after login? [duplicate]

When I use SSH to connect to a Linux server, I see a message informing me about the origin of my last login. For instance: Last login: Mon Jul 7 14:37:09 2014 from host.example.net I would like to ...
7
votes
1answer
304 views

How do I remotely issue a CLI command to thousands of Windows domain computers at once?

I need to issue a CLI command (cmd.exe or PowerShell) to all of the thousands of computers on my domain. For obvious reasons, this is not going to involve doing the task manually, or physically ...
-2
votes
2answers
625 views

Check if an Antivirus is installed and enabled

I work in an entreprise with a lot of pcs > 1000 with os windows xp and 7 and symantec antivirus installed on it the probleme is : -how to check if the antivirus is installed on the computers -and ...
0
votes
3answers
69 views

How do I gather OS information about all users in AD?

I'm looking to make a script or something along those lines which will allow me to check the OS version of all users within the AD, without interrupting daily operations. So far i've found this script ...
41
votes
10answers
16k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
0
votes
2answers
163 views

Bash Script keeps respawning after it should die

#!/bin/bash PID=$(pidof daemon) kill $PID while ps -e | grep "[d]aemon" >> /dev/null; do sleep 30 done sh -c /root/daemon This script is set on a cronjob to kill and restart this program. It ...
1
vote
2answers
161 views

script to count the occurence of the particular string in the given time interval

We are trying to write a script "sendemail.sh" to count the number of occurrence of a particular string in a log file "SendEmail.log" within the given interval. We have a log file. In that we are ...
0
votes
2answers
1k views

Exception calling “UploadFile” with “2” argument(s): “The Content-Type header cannot be set to a multipart type for this request.” [duplicate]

I am working with a script that is supposed to first check if a PC is alive then FTP a file to a server. However, when running the script I am getting the following error: Exception calling ...
1
vote
1answer
1k views

Looking for a powershell script that can pull a file from a set of PC's and FTP

I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server. So the structure of the environment is that we have a file on ...
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 ...
-2
votes
1answer
3k views

powershell script that outputs date of the day as a file name

I have a script which lists local admins of all hosts in Active Directory below: $Searcher = New-Object DirectoryServices.DirectorySearcher([ADSI]"") $Searcher.Filter = "(objectClass=computer)" ...
0
votes
1answer
218 views

Why does this command to send emails work from the shell but not as a cron job?

I have a problem with cron jobs, I need to send email notification to users, I use this command curl "http://example.com/index.php?option=com_community&task=cron">/dev/null 2>&1 When ...
0
votes
1answer
28 views

Detect which scripts are using old interpreters

I have a few Debian machines with some nearly-orphaned script interpreters, for example /bin/bash3 and /usr/bin/perl510. How can I detect those scripts that still have the aforementioned interpreters ...
2
votes
1answer
241 views

Server Reboot Script - No Credentials

I'm looking at running a script to reboot a Windows 2012 server nightly, and all the guides seem to be for using scheduled tasks. As far as I know though, a change in the admin credentials will break ...
0
votes
1answer
355 views

Automate app pool recycling of an Azure Cloud Service Web Role

How can I script (e.g. using PowerShell) the action to recycle the app pool of a web site hosted in a Web Role on Azure Cloud Services? Only one instance of the cloud service is running (used for ...
0
votes
1answer
422 views

How to rebuild MS Agent Jobs from MSDB table?

This morning our DB server died. They restored backups to another server but these didn't include the many MS Agent jobs. Anyway I have managed to get a backup of the old MSDB table where all the ...
0
votes
2answers
287 views

Find Users without a password in UNIX AIX

I'm searching for a script that finds users who don't have a password. Could anybody please explain me the commands that are needed in such a script?
0
votes
1answer
366 views

Screensaver startup script (batch or reg) GPO, silent install

I have an application, which after it disconnects from a VPN connection, resets the screensaver settings. What I'd like to do is create a GPO script or batch file to run every time the user logs into ...
2
votes
2answers
4k views

AD Group and Distribution Group with O365

I have a O365 with Exchange, and a local AD. I want to manage distribution groups and distribution groups members via PS scripts (that will run by scheduled task), that look users' AD attributes ...
-2
votes
1answer
92 views

how to write a script to get ifInOctets and ifOutOctets? [closed]

Can any one help me with writing a script to get ifInOctets and ifOutOctets from a server 10.38.2.24 ? I need help
0
votes
1answer
133 views

VBscript - returning the path & size of a file

I would like to add a piece of code to SYDI that would return me the location & size of a specific file. For example, a server "X" has a DB file(s) & path like this: ...
2
votes
2answers
314 views

How to split logs according to patterns?

I would like to be able to split log files according to a pattern found in them. For example process all logs and look for /(\w+)\s to match /myresource but exclude /myresource/anythingelse, to ...
2
votes
2answers
50 views

Detecting in a script whether apache2 root is /var/www or /var/www/html

Apache2 recently changed the default root directory from /var/www to /var/www/html, which breaks the scripts I distribute for installing some software I wrote. Is there a reliable way of detecting ...
2
votes
1answer
1k views

Bash script match grep output and send message

I am developing a script for monit status checking so I can send OK status messages to NagiOS NSCA server (passive checks). The problem I am having is that my bash script still sends messages if the ...
0
votes
1answer
71 views

Bash — Using a character-based graphical utility to store output

I'm using bash to script a remote dialing program in an Ubuntu(14.04) server and I am having some significant trouble trying to read the output from it. I would like the program to execute as I would ...
0
votes
1answer
72 views

Finding valid email service providers in a large list of domains

I have a list of approximately 13K free email/webmail providers from circa 2000. Obviously the vast majority of these services have gone out of business, and the domains have either lapsed, or been ...
-1
votes
2answers
449 views

Server 2008 R2 - Script to kill idle sessions over [closed]

Looking for a script that can end idle session shares on a Server 2008 R2. If sessions are left open for too long there are programs that fail to update due to files/folders being open. I am looking ...
2
votes
2answers
2k views

Copy-item FileSystem provider error

Copy-item cmdlet is not working as expected, i don't understand why. This is my code : $Source = "C:\folder1" $Destination = "\\172.22.0.115\c$\folder2\" $Password = ConvertTo-SecureString ...
0
votes
1answer
44 views

How to catch system events when a program is being updated and robotize routine steps when you update software?

I'm a support engineer for an accounting program. The program runs under Windows. I have to update many of this accounting software bases daily. I mean the software is always the same. But users may ...
0
votes
0answers
71 views

Powershell deploment script into multiple 2003 windows servers

I have created a script "test.ps1" that runs security checks on folders within machines. Now I want to deploy this script into 70 windows servers so it can run these security checks on all of them. ...
4
votes
3answers
301 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 ...
0
votes
1answer
282 views

Can't figure out how to get started with powerdns-recursor lua scripting

I have a server (Ubuntu 12.04) where I run powerdns-recursor. I'm trying to add some logic to certain requests and have got my target set on lua scripting for powerdns. I don't seem to be able to ...
3
votes
3answers
874 views

Year Month day from file name in shell script

I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log ...
1
vote
1answer
133 views

Need to get a list of all users within a subnet of servers

I am looking to write a batch or vbs script to gather all users (local to the server. ie. administrators or a local account(not ad users)) on a collection of servers inside my network. I assume I ...
0
votes
1answer
61 views

virtual web folder served by PHP script

I am trying to configure my apache to be able to display (virtual) pages like: mywebpage.com/something1 mywebpage.com/something2 mywebpage.com/folder/something3 I would like these "somethingX" and ...
0
votes
1answer
505 views

Bash if statement equal output from last command

I am trying to equal something from last command with bash if statement: #!/bin/bash monit status if [ "status" != "error" ]; then echo -e "hostname\ttest\t0\t0" | /usr/sbin/send_nsca -H ...
1
vote
1answer
116 views

CGI Script not running in PHP file

I have a CGI script in the server called script.cgi and I have added the following code to the domain vhost: Action add-footer /cgi-bin/script.cgi AddHandler add-footer .htm .html I have ...
1
vote
1answer
218 views

Using VBscript and EnumNetworkDrives, how can I instruct our login script to NOT delete a drive letter mapping and remove the rest upon each login?

I've been working on adding some new parts to an already existing login script using VBscript. I'd like to use the below code to erase all drive mappings on login. Set WshNetwork = ...
0
votes
3answers
67 views

tail -f AND allow text input

I want to create a script that allows some interactivity by tail -f logfile from myService allows text to be entered and sent to myService What I could not solve yet is this two functions working ...
2
votes
2answers
630 views

simple script to backup PostgreSQL database

Hello I write simple batch script to backup postgeSQL databases, but I find one strange problem whether the pg_dump command can specify a password? There is batch script: REM script to backup ...
0
votes
1answer
534 views

Kill child process when the parent exits

I'm preparing a script for Docker, which allows only one top-level process, which should receive the signals so we can stop it. Therefore, I'm having a script like this: one application writes to ...
1
vote
1answer
78 views

Email administrator when a duplicate IP is found on the network

It was suggested that I ask this question on serverfault. I know this is a bit of a custom requirement but I was hoping someone currently has (or can put together) a script that checks for duplicate ...
1
vote
3answers
3k views

How to change default install path for Notepad++ in Powershell silent/unattended script

I cant figure out the parameter(s) to change the default install path C:\Program Files\ of Notepad++ to the drive I want it to install to when I run my PowerShell script. I am trying to do a silent ...
-1
votes
1answer
333 views

RSYNC only listing files when run from bash script

I am trying to copy backup files of my companies mail server to our backup server via RSYNC. I use this same script for backing up our web hosting server backup files with no issues. When I type ...