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
1answer
26 views

How to cast as ArrayList AND preset data in param block?

As I need to be able to add and remove items from an array I need to cast it as an ArrayList as opposed to the more common options ([string[]], [Array], $Var=@()). I also need to preset it with data, ...
0
votes
0answers
24 views

bash scripting and comparing 2 directories - Beginner [duplicate]

My problem is that i have to check what files are included in the $directory, then i have to make a new file with name specified by me and compare if the name doesn't already exist in this directory ( ...
0
votes
1answer
5 views

Puppet case statements with integer range

I need to write a case using some ranges in order to write in a better way something like the following spaghetti code : if $mem < 1024 { $retvalue = "128M" } elsif $mem < 7000 { ...
-1
votes
1answer
40 views

Linux Backup Methods? [closed]

I want to ask for a good methode to backup some folders on my server with many files (all files together +/- 50 GB). The Files are web of private homepages? Maybe earlier take a backup from ...
0
votes
1answer
27 views

cron and lftp issue

I have the following scripts running on raspbian. start #!/bin/bash /root/config/commands 2>&1 > /root/log/$HOSTNAME.log commands #!/bin/bash source /root/config/variables echo TestLine ...
0
votes
1answer
28 views

Copy-item with multiple filter

How can I use copy with multiple filter values? For example, it works if I specify only 1 value to filter (*.jpg) Copy-Item -Path Y:\TEST -Recurse -Filter *.jpg -Destination ...
0
votes
1answer
24 views

Dynamic timezone change for OpenWrt (Chaos Calmer), NTP

I have this idea for my routers running OpenWrt, since for them there is no way of knowing in what time zone they are by default. What if there was a list of lets say three time servers each per one ...
1
vote
1answer
25 views

Kickstart not working

I'm trying to create a kickstart to automate the installation procedure but when the installation ends and I check to see the result nothing happened. I'm trying to debug it by putting read statements ...
0
votes
0answers
10 views

shell script for checking the list of websites status [duplicate]

How can i write a shell script for Checking the list of websites in a server which are running up or not. If they are running leave it. Those who are not running what type of error it is popping out ...
0
votes
0answers
11 views

Script to propagate root folder inheritance to sub folders every X minutes?

Is there a batch script that I can run every 15 minutes (assuming task scheduler) that will propagate inheritable permissions to every sub folder from the root folder? A little background on why I ...
2
votes
3answers
54 views

PSExec shutdown list of servers

I have a system I inherited that used a simple psexec script and a list of servers to automatically shut down the servers in the list should a temperature threshold be reached or the UPS only has a ...
0
votes
1answer
55 views

How to add allowed relay IPs for Windows SMTP using command line or script

I have a long list of IP addresses I need to add as allowed relays to the built-in SMTP service on Windows Server 2008 R2 (IIS 7.5, but SMTP uses the old IIS 6.0 manager) I know how to add allowed ...
-2
votes
0answers
25 views

Old file daletion script [migrated]

I used script: #!/bin/sh for file in "$( find /var/backup/web2 -type f -mtime +1 -maxdepth 1 -exec rm -f {} \; )" do rm -f $file done exit 0 to delete files older than 24h from fixed directory. ...
2
votes
1answer
33 views

How to properly deploy internal self-signed scripts (Powershell)

Completely new to certificate usage so be gentle. I'd like to deploy Powershell scripts that I made to other employee computers so they can use them, but I will need to sign them in order for them to ...
0
votes
2answers
79 views

#!/usr/bin/expect not working

This is probably an easy question, however have a simple expect script that I've add the executable bit to that seems to be ignoring the #!/usr/bin/expect interpreter line. Further more, it also ...
1
vote
2answers
36 views

Bash script rsync --include-from fail

I have writted a bash script to backup folders and files from a machine to our backup server. My goal is to exclude all the files older than 6 months from this weekly backup. To do that, I used a find ...
0
votes
1answer
54 views

Using curl with cookies

I hope someone can help me out on this one. I have been trying this for a while now, with all sorts of variations and cannot seem to get this to work. I am trying to script a way to log in to ...
1
vote
1answer
173 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
2answers
136 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 ...
-5
votes
2answers
44 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
277 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
80 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
46 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
39 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
181 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
63 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
106 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
19 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
47 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
191 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
240 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
104 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
90 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
0answers
69 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
34 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
105 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
64 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
154 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
51 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
83 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
59 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
89 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
60 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, ...
2
votes
1answer
983 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
429 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
43 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
92 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
64 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
159 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
138 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 ...