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)

-3
votes
0answers
23 views

How can I programmatically determine if a website uses HTTPS? [migrated]

I'd like to build a script of some kind that can tell if a website uses https or not. What is a way of programmatically determining this? I tried visiting one of my own domains that I know does not ...
0
votes
0answers
3 views

Trouble with embedding html email with Send-MailMessage in PowerCLI/Powershell

I am new to Powershell, I am a junior admin for a VMware environment. I am trying to automate a weekly report for snapshots in PowerCli. I am making the script in Powershell. I have made a simple ...
0
votes
0answers
19 views

powershell script to copy to backup files from multiple computers on a single location

I need to write a powershell script that will help me with my situation: I need to backup the event viewer files from multiple servers to a backup server so I could access it when a server crashes. ...
1
vote
1answer
44 views

How to make a simple script that increases a number character by 1

I have to add a single command for MANY vlans, and wondering if I can generate a simple text file somehow? Then I can simply paste the text file into the network switch and it will add the needed ...
2
votes
1answer
61 views

How do I prevent Apache2 from trying to execute a file as a script?

So basically, I followed this guide about iptraf monitoring and rrdtool to the letter. I put it in /usr/lib/cgi-bin/ as usual for cgi scripts. Then, when I visit it from a browser, the images it makes ...
-3
votes
0answers
19 views

remove lines from a file based on whether corrersponde to a list of names [closed]

could help to create a perl script to delete a line file based on a specific name , eg if I want to delete me from node 1 and node 4 and its contents until you find another based on one ready names eg ...
2
votes
1answer
101 views

Joining 150 computers to Active Directory

I am a junior system IT administrator. We have Windows server 2008 R2 standard and 150 computers with Windows 7 professional (32 bit). We have installed an Active Directory domain on the server and we ...
1
vote
2answers
55 views

Loop in a Windows batch file

I have a problem where I need to clone one virtual machine into several machines for production. The machines have names that is assigned by variables and a rdp port is also assigned by a variable. ...
1
vote
1answer
40 views

Puppet: How to write a proper “condition and condition” statement?

I wrote a "Message of the day" Puppet module which affects all proxy servers in my company. Within the template file, I have the following "if statement": <% if @hostname !~ /^haproxy\d+/ and ...
1
vote
2answers
42 views

How to import or export nagios host Data from command line

This might be a basic question for some of you but being a beginner i wanted to know how to export or import data of the current status(CPU, Memory, Diskspace etc) of the host from command line into a ...
0
votes
1answer
39 views

Turning off specific Icinga 2 notifications over HTTP

In Nagios Core, it is possible to turn off notifications for a specific service or host through the web interface. This is a simple web request, which we can also construct in a command line ...
1
vote
2answers
71 views

Linux: How to get a machine's IP address? [duplicate]

I'm using Linux CentOS 6.4 . I'm writing a shell script and I need to extract a machine's IP in order to use it in the script. How can I find the machine's IP? I'm looking for the "best" way because ...
0
votes
1answer
30 views

Need looping Powershell script to email me when site has error message [closed]

Running 08 windows server on a VM We need to be notified by email or by other means whenever the site is either 404 or goes to maintenance page. Therefore, we need the script to be constantly ...
0
votes
0answers
10 views

Apache2 on Ubuntu - Start external process on request?

I am using Apache2 on Ubuntu Server 14.04.01 LTS (i368). I would like to start an external process whenever a request comes in (The process started will actually get the request proxied to it.) I am ...
-7
votes
1answer
57 views

Trying to understand linux script [closed]

I have this Linux script I found and I'm trying to understand it. Could someone please help me to understand it. The script if [ ! -d "/home/ftp/$PAM_USER" ]; then /bin/su - ftp -s /bin/sh -c ...
-3
votes
1answer
46 views

bash script mysql reset pass

It seems that this code is not working I tried using it on my debian 7 machine and the password it gives me is wrong. # Please confirm that you want to reset the MySQL passwords CONFIRM="n" echo -n ...
1
vote
1answer
53 views

Configuring Pfsense via ssh

I want to know how i can completely configure and add add tables to pfsense via ssh. my goal is to have a web installer that configured multiple system and based on the output it will configure the ...
0
votes
1answer
50 views

Assigning Department based on Active Directory OU's

We have just gone to Office 365 tied in with ADFS. We want to be able to see people's departments automatically when we view their contact info in Office 365. We do not have any Department ...
0
votes
0answers
28 views

Programatically Pull Account Track Data from Konica Minolta/Ricoh Copy Machines

To be safe, I checked the serverfault guidelines, and I think this question falls under management of 3rd party platforms or administration of networks. I'm sure I'm not the only sysadmin with this ...
0
votes
1answer
75 views

Powershell script to display all groups and the users they contain [duplicate]

I'm currently trying to write a script that displays each group and user in the domain. Import-Module ActiveDirectory $Groups = (Get-AdGroup -filter * | Where {$_.name -like "**"} | select ...
0
votes
0answers
22 views

Can I dynamically generate apache config files without using <perl> tag? Similar alternatives are an option

I am trying to find a way to dynamically generate vhost configurations when Apache starts. I am aware of mod_vhost_alias and mod_rewrite [suggested by Apache][1]. I'm afraid these won't work since ...
2
votes
1answer
64 views

How to make BSDP NetBoot image selection from a script on OS X 10.9+?

Background: BSDP is Apple's protocol used to discover and make selections on NetBoot servers on the network (Not to be confused with PC-style PXE boot). specs (Word doc). Long story short - it's a ...
1
vote
2answers
68 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
28 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 ...
1
vote
1answer
51 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 ...
0
votes
1answer
73 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
170 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
273 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
95 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. ...
0
votes
1answer
37 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
72 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 ...
0
votes
2answers
101 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
vote
1answer
115 views

Saltstack load pillar in a for loop

I'm developing a automatic proftpd installation whit Salt. I won't to get the ftp users from a template but I can't get work the pillar. I initialized the pillar whit the users data and call it into a ...
0
votes
2answers
107 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
141 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
382 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
422 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
60 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
190 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 ...
1
vote
1answer
36 views

name of script within a init script

I have a script /etc/init.d/startup, where I do the following: creating a PID file that should look like: /var/run/**startup**.pid executing a screen of a java process, so I will like to create the ...
1
vote
1answer
53 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
219 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
61 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
71 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
60 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
62 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 ...
0
votes
2answers
157 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
125 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: ...
1
vote
2answers
450 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
36 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 ...