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)

-7
votes
0answers
39 views

How can I loop my Powershell script? [migrated]

How can I loop my powershel script? It copies the local NTUSER.DAT to the file server, I understand that the local NTUSER.DAT file may be locked by the operating system so my COPY may fail. I need it ...
0
votes
2answers
37 views

Linux: How to allow a regular user to “su - anotherUser”?

I wrote a Nagios check script which checks if user peeradmin is able to touch a file in some mount on the server. Nagios user is: nagios . I've edited /etc/sudoers and added these lines but none ...
0
votes
0answers
11 views

Collecting PC to Printer relationship information across an entire domain using a script

I'm trying to create a script which will enable view every PC to Printer relationship across an entire domain of around 1200 machines. In theory I am looking for a script to be run so that it will ...
-2
votes
0answers
19 views

Terminate call freepbx via script [on hold]

We are running Elastix version 2.4 which I think runs freepbx in background, so since there is no option via web panel of Elastix version 2.4 to achieve what we need so I have to ask it here as ...
0
votes
0answers
30 views

SSH issues: keyfile and host file not working as expected

When I login to server with a key ssh -i /home/me/.ssh/id_rsa server everything goes without glitch. The key is authorized on the server. However if I try to do same from a shell script, I get a ...
-2
votes
0answers
24 views

Linux have a script download a file on your computer [closed]

I am setting up a special kind of script for a project that I am working on. I'd like my script, when executed, to take a file that is on the server and put it on the computer. I have no idea how I ...
-1
votes
0answers
9 views

How install on wordpress subfolder a php script [closed]

Currently I have a wordpress on Nginx (mysite.com) but I need to install a php scrip in a subfolder. mysite.com/script/ What are the wordpress and script settings in its .htaccess documents ?
0
votes
1answer
40 views

Script to Push Files

Script to Push Files Hey Guys, Thanks for always being helpful, I have another issue that I need a little insight on how to fix. See the below script I have and the error I get. I don't understand ...
2
votes
0answers
29 views

How to retrieve a MDT task sequence variable and use it properly inside Powershell

I'm trying to retrieve a MDT task sequence variable inside a Powershell script, then use that variable in a Powershell function. My problem lies in that the variable I want to retrieve contains a ...
0
votes
0answers
38 views

Batch/Powershell file wont run via Task Scheduler during logoff

I'm having trouble getting my Powershell file to run from Task Schedule during logoff. In short, I'm trying to upload my NTUSER.DAT (roaming profile) to my profiles folder on the file server. Dynamic ...
0
votes
1answer
39 views

Efficient way to parse Apache Access Log for CMS logins

I've been working on a way to parse large multiple access logs (sometimes in double digit GB in size) for CMSs. Right now I just need WordPress and Joomla, but I know the types will grow over time. ...
-1
votes
1answer
29 views

Check how much time has elapsed for Cron job and send email

There is a cron job that is set which runs throughout most of the day, sometimes the job gets stuck and I would like to set a time or check on it which let's me know if it has been stuck for more than ...
0
votes
1answer
23 views

Powershell cmdlet requesting optional parameters as mandatory when running as script

I am trying to use powershell to create a script which I use to add vpn connections to windows 8.1 machines. For this microsoft has made the add-vpnconnection cmdlet. When running add-vpnconnection ...
-3
votes
0answers
27 views

Next drive letter available after C:

Using a batch script, I want to capture the next existing drive letter after C: into a variable. If none exists, only then assign C: to that variable. I tried the below code, but it shows next drive ...
0
votes
2answers
47 views

Using Puppet to sync two directories

I have a bunch of servers that have two directories on them that need to be in sync. For instance, on the same server i might have /var/path/to/dir1 and /var/path/to/dir2 which could have files and ...
-1
votes
0answers
17 views

Find and replace string that include space and multiquote (php script) [duplicate]

I've got some bunch of injected script on server see the sciript here : http://pastebin.com/XyrWZhcc in that script is including multiquote, much space, and other character. what my concern is how to ...
0
votes
2answers
59 views

For Loop in batch file [closed]

Expected Input: Start=1, End=500, Interval=100 Expected Output: 1, 100 101, 200 201, 300 301, 400 401, 500 @echo off set start=1 set end=500 set interval=100 for /L %%g in (%start%, ...
-2
votes
1answer
49 views

How to automate a java service to start if server restarts

I normally run my java service on centOS box using nohup like below: nohup java -jar myapp-0.0.1-SNAPSHOT.jar server my-configure.yml > outfile & However, if the server restarts the service ...
2
votes
1answer
171 views

Powershell script scheduled task will not end

I want to use this Powershell script to automate some backups on Win7 machines. When run manually from the Powershell terminal the script runs as advertised and ends after a few seconds (it is a small ...
4
votes
1answer
156 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.
0
votes
0answers
21 views

Change vlan settings to Yealink phones at once

I have about 90 yealink ip phones. My target is to change vlan settings to all of them massively. For example, when it's going to reboot all of them, I run the following ...
2
votes
2answers
74 views

bc: using “scale” with bash variable [closed]

Easily, I'm writing a script that needs some values with 2 digits after floating point. Trying to use bc I don't understand how use "scale", i.e. A=12 ; bc <<< $(($A/5)) it's correct, but ...
0
votes
0answers
26 views

name of script within a init script

I'm trying to figure this out. i have /etc/init.d/startup inside the startup script I'm doing a few things: (or i will like to do) creating a PID file that should look like: /var/run/startup.pid ...
1
vote
1answer
40 views

Mysql optimize one table in all databases

I see in the mysqlcheck manual that there's an option for --tables that overrides that databases option, but it isn't well explained. I'm trying to run mysqlcheck -o and I want it to optimize a ...
-1
votes
1answer
126 views

Bash Script - Expect does not send password that ends with $!. Also need improvement to report connection timed out

Update: Password issue is fixed and connection timed out message was fixed too. Adding \ before $! worked. Example: *password\$! set passwds { *password\$! @tempP@ss %Test4%} For connection timed ...
2
votes
1answer
43 views

Provide Administrator credentials within script

I am writing a script that runs from a user account. The script needs to execute another script as the Administrator account. Tried AutoIt's RunAs - didn't work. Tried PsExec - the same. Tried ...
0
votes
0answers
38 views

Why does freshly created MySQL slave keep throwing foreign key errors?

We are running Ubuntu-14.04 LTS with its stock mysql-5.5.40 and mysql-utilities-1.3.5 and we are setting up some master/slaves couples. Some of them get up without any issues just like usual, but some ...
0
votes
2answers
35 views

Script out SQL Job Create Statement Without SSMS

Does anyone have an idea of how to generate the Create statement for a SQL Agent Job? I've looked everywhere, and I can't seem to find a search result that doesn't involve using SSMS and going ...
1
vote
1answer
56 views

Monitor a process using monit in ubuntu

On my server I have started a service using a script created by myself. I want to monitor that process using monit. I didn't see any .pid file for that process in the /var/run directory. How can I ...
-1
votes
2answers
108 views

How to run batch file without a window in ONE file

I know how to run batch files without a window thanks to this question here: Run a .bat file in a scheduled task without a window. The first answer is the one I am using. It states that to run a ...
0
votes
2answers
65 views

Powershell script that executes another powershell remotely

It's a long story, but I need to create a SQL trigger that executes a script remotely which executes another script remotely (yeah, I know). I'm using PowerShell. I have started at the end: ...
0
votes
2answers
159 views

Ola Hallengren's SQL Backup to Network Location not working

Good Evening All, I have set up Ola Hallengren's SQL Server Maintenance Solution on several SQL Express servers (2008 to 2012 R2) in the past few years. I recently have started having issues with the ...
2
votes
1answer
32 views

Automate Windows Server 2008 Local Policy Changes?

I'm a student assistant in IT at a large organization with several less than cooperative separate IT departments. My little IT group currently doesn't have Active Directory rights to send a Group ...
0
votes
1answer
113 views

Script to delete users profile only months old profile with the Registry itself but should leave current profile intact

first of all sry if this post is repetitive for the profile deletion. If you have a correct link please post it below or the script itself. Question: as i have a lot of computers with windows 7 ...
1
vote
1answer
54 views

Will systeminfo's “OS Name:” line distinguish between Windows 2003 and 2003 R2?

First, please verify visually that you have a 2003 R2 installation by opening Control Panel\System Properties and checking that R2 is shown like this: Alternatively, R2 should be mentioned on the ...
0
votes
1answer
239 views

Is there a way to restart automatically the HHVM service if I get a '502 Bad Gateway Error'?

I've reported the error on stackoverflow - from time to time my Nginx/PageSpeed+HHVM+MariaDB+WordPress blog stops working. There is some problem with the HHVM service that I don't locate, and I'm ...
0
votes
0answers
89 views

lftp mirror leaves empty folders on remote

My script is set up with this for lftp lftp -p 2218 -u $login,$pass sftp://$host << EOF set mirror:use-pget-n 5 mirror -c -P5 --depth-first --Remove-source-files ...
1
vote
3answers
380 views

Batch script to export info from Active Directory (name, phone numbers, location, etc) into a csv file

The secretary at my work uses a spreadsheet that lists names, phone numbers, and locations of employees to look up info if someone asks. All this info is located in AD, but the problem is that we are ...
0
votes
1answer
212 views

Zabbix: debug external script

I have made an external script (snmp_max_io written in Perl). When run with and IP-address, it logs input to syslog and it prints a single 64-bit numeric value and set the exit value to 0. Example ...
1
vote
2answers
176 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
33 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 ...
0
votes
0answers
50 views

Modifying squid proxy configuration programmatically

Is there any way to manage squid proxy programmatically, so I can add a cache peer or modify an access list using something like an api for squid?
-1
votes
1answer
53 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
112 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
39 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 ...
-1
votes
2answers
47 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
188 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
84 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
45 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 ...
33
votes
8answers
5k 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 ...