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)

0
votes
1answer
4 views

Retrieve SCCM collection membership via PowerShell

I'd like to find a PowerShell script that retrieve the SCCM collections for a given computer or user. I know this can be achieve via a SCCM query, but I'd like to do this using a PowerShell function. ...
1
vote
1answer
12 views

Retrieve internet proxy server address via PowerShell

I have to retrieve the proxy server address and port via PowerShell, so I can use the Invoke-Webrequest -uri http://some-site.com -Proxy command. The expected output should looks like ...
0
votes
0answers
18 views

Run script when postfix not deliver mail

I would like to run some script when postfix can't deliver e-mail (because of 5XX error, or is expired from queue). How to do it? I tried to rewrite bounce script(defined as bounce in ...
-5
votes
2answers
32 views

Why isnt this sudoer command run as root? [closed]

I want to give PHP access to a very specific script using a configuration under /etc/sudoers.d. So I did the following: visudo -f /etc/sudoers.d/99-php And entered this sudo rule: www-data ALL = ...
8
votes
3answers
138 views

PowerShell: Get-ADUser Properties with åäö

I'm trying to extract select sets of users with Get-ADUser. The users belong to companies whose names include non-ASCII characters, e.g. "Gåäördet". Unfortunately, we do have to use the company ...
-1
votes
2answers
47 views

how to extract mysql version by bash script in centos 6

I need to extract the mysql version in a bash script on CentOS 6 for a minimum requirements check Example: # mysql -V mysql Ver 14.14 Distrib 5.5.43, for Linux (x86_64) using readline 5.1 # mysql ...
0
votes
2answers
31 views

iptables blocking script using arp table lookup

I need to block certain hosts (multi-OS) on our LAN from gaining internet access. I decided to try and block certain hosts by mac address via iptables but I can't use the mac address of the ...
0
votes
1answer
29 views

Logging into file doesn't write anything

I have got some script, which I want run after start computer. I set it in group policy and script is running after PC start (I checked it), but I have in script some logging to which doesn't work. I ...
12
votes
4answers
117 views

How to lock out normal (non-admin) users during software installs?

We have a lot of thin clients running Windows Embedded Standard 7 and an SCCM 2012 R2 server to manage them. The thin clients have their write filters enabled (FBWF) so machine changes are not ...
0
votes
1answer
48 views

bash script doesn't run properly in crontab but runs fine manually

I wrote a small script to determine the average IOPs per hour in which I later manually convert to a graph and spreadsheet for management to discuss a potential SAN upgrade for an upcoming expansion ...
0
votes
0answers
60 views

How can I Deny permissions to logon to Remote Desktop Session Host server in powershell script?

I am need of some assistance please. I am a system admin and I am trying to create a script that will assist with the tedious tasks I have to do with disabling a user that no longer works for the ...
0
votes
0answers
14 views

Is it possible to “hook” into IIS site binding

I have IIS hosting several different versions of the same website. Right now, I access each one with a different hostname where the binding for each site has the hostname I want configured on it. I ...
0
votes
1answer
17 views

Set-SCOMMaintenanceMode EndTime Duration Clarification

Microsoft provides the Set-SCOMMaintenanceMode cmdlet in part to manage the SCOM maintenance system. A required parameter is the declaration of how long the maintenance mode should last (-EndTime). ...
1
vote
1answer
62 views

icacls variables in batch file

I'm moving users to a new domain, file server and user name format. I'm trying to write a simple DOS batch to copy the data and set the permissions. X: is mapped to the old server and E: is the local ...
1
vote
2answers
93 views

password check in bash script calling on expect

Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all ...
3
votes
1answer
75 views

How to import custom korn shell script into Nagios monitor

Our company is consolidating our monitoring solutions (WUG, Cacti, Zabbix) to Nagios. I have used Zabbix for years, and am trying to understand how to get Nagios to report on applications that I have ...
0
votes
1answer
57 views

Remote bash script execution via ssh causes local script to stop

I have a setup which behaves in a way i cannot get my head around. So I have a local bash script generateTrafficOnHosts.sh which reads IP addresses from a file. It then calls a bash script ...
0
votes
1answer
50 views

GPO Office Installation - Script runs on PC, How could I get it to appear when a user logs in?

I currently have a GPO created that installs Office 2010 for users during startup of the PC. This script is set to run for specific PCs. Is there any way that I can get the script to appear and run ...
0
votes
0answers
21 views

Remove KACE agents using scripting tool

Is it possible to remove KACE agents using a script from the scripting menu ? If so , can someone share with us the way to do it. I found this script: AMPTools uninstall[all\all-kuid] but not sure ...
1
vote
0answers
69 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
33 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 ...
0
votes
2answers
67 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 ...
-1
votes
1answer
43 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
41 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
53 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
61 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: ...
0
votes
0answers
39 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
416 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 ...
-1
votes
4answers
236 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
32 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
69 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
54 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
120 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
118 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
97 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. ...
0
votes
1answer
66 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
157 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
209 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
94 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
42 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
12 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
65 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
76 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 ...
2
votes
1answer
212 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
86 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
66 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
198 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
38 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
177 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
111 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. ...