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
0answers
11 views

Allow Powershell script executed on Exchange server to send mail - best practice?

I've got a single multi-role Exchange 2010 server and a need to execute a Powershell script on monthly schedule. And i really would like to send a report via email to some local company's mailbox by ...
0
votes
0answers
13 views

VBS won't execute with elevated permissions via script

I'm having an issue with running a VBS via scheduler unattended. I've been banging my head against a wall for the last week trying off and on to get this to work. I work for an MSP so we have ...
-2
votes
0answers
50 views

Syntax Error: unexpected end of file — Bash script [migrated]

I am trying to create an spritz app! Everything was working fine, but since yesterday I keep getting this error: ./spritz: line 176: syntax error: unexpected end of file I have checked the script ...
0
votes
2answers
47 views

Windows: change own password of standard user by using commandline

I want to change the password of the current logged in Windows user (no Active Directory) in a scriptable way. The users have the right to change their own passwords and already can change the ...
-2
votes
0answers
20 views

Script to bulk import groups and contacts for Lync2013 [closed]

Does anyone have a script out there that will allow me as the administrator for our Lync 2013 Server to administer the groups and contact lists in Lync 2013? I have seen Contact Manager for Lync by a ...
-1
votes
1answer
34 views

Delete files by date and character count

I have an interesting problem. I need to delete directories that are older than x days but are only numerical. We have a log folder that has log files that we need to delete but other files and ...
-2
votes
1answer
26 views

Script to open a webpage or at least hit a web api [closed]

I need to write some kind of script that runs on a windows server that can be scheduled to run throughout a day to open a webpage to a specific address or at least hit an HTTP api it doesn't ...
-1
votes
1answer
32 views

Centos running if - then command with multiple allowed values

Is there a way to run a if command in a script that can match multiple values for example I would push a script to a bunch of servers and each server would only run the command if the servers host ...
0
votes
1answer
20 views

Logrotate executes postrotate even if file not rotated

I have a problem with my rsyslog and imfile that fails when one of my log file gets truncated.. So to workaround the problem I have modified the logrotate script as follow: ...
1
vote
0answers
25 views

Parsing part of a file name to use as a variable in bash [migrated]

I need to get the DB name and use it as a variable from part of a file name. Currently I have it pulling in the name of the file from a ls command. This is what it returns: Test-20150311-1200.sql I ...
0
votes
0answers
26 views

Powershell - Printer settings not applying

I'm currently trying to script settings for a printer connected through a local network, a normal TCP/IP-printer setup if you will. Since I'm on my phone I don't have access to the code right now, ...
1
vote
1answer
76 views

Transfer files via Powershell Remoting (like scp in linux)

During the creation of a few powershell-based deployment scripts, I sorely missed an easy way to quickly transfer a file to another server (over the internet) via Powershell Remoting, something like ...
0
votes
0answers
38 views

Is shell parent of all the processes in linux [migrated]

I have been trying to understand shell scopes and environment in depth. I have been reading about how if we do export VARIABLE=VALUE it will be available in subshell. So I wanted to ask a question I ...
-1
votes
4answers
150 views

How to test if two given files are identical?

Just updated the code... I get out everytime on the "else" sequence. You can download the update.sh file from my server. it only contains echo "Hallo update" Updated code (03.11.2015) ...
1
vote
1answer
25 views

How to get value of environment variable from passed command line parameter

I have to use/reference an environment variable value which will be passed as a command line argument. Something like below set myvar=%1 echo Value of %myvar% is %%myvar%% Here in %%myvar%% I want ...
0
votes
1answer
41 views

Trouble with embedding html email with PowerCLI/Powershell for gmail

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 ...
1
vote
1answer
49 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
76 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 ...
2
votes
1answer
107 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
71 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
47 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
65 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
82 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
77 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
33 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
59 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
61 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
95 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
62 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
1answer
49 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
105 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
25 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
83 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 ...
3
votes
1answer
83 views

How can I have Linux execute a bash script when a specific disk is hotswapped in?

I have a set of hard drives which are rotated for offsite backup. There are several steps that need to be performed when one of the disks is reinserted which I've rolled into a simple bash script. ...
1
vote
2answers
78 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
30 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
55 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
78 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
244 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
409 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
104 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
39 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
82 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
141 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
166 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
138 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
201 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
460 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
536 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.