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
27 views

Same script, same OS, same installation, failing

So I'm working with RANCID to monitor some switches and I'm using clogin now to test some modifications. I'm working in two different computers but both of them from the office. Althought they are ...
-1
votes
2answers
26 views

Script to delete older files and copy what is left

We have a server that runs an application that is used internally. The application has a utility that creates its own backups every 24 hours. Backups are stored in: ...
0
votes
0answers
10 views

MRTG Target field

Can I use OID and Shell Script in the MRTG Target field at the same time? For example Target[myrouter]: check_connection.sh&1.3.6.1.4.1.999.1:public@mydevice Please advise. Thanks
0
votes
1answer
30 views

Log all bash actions with multiple scripts

Using the command below, I can log all actions that happened inside that script. bash -x script.sh Sadly, the script calls another script, which does not have the -x setting active then, i.e. the ...
-1
votes
0answers
49 views

Python to change password for user in JunOS device

My script is good to make device changes but the only thing im unable to do is to change the password one a particular user. Im running JunOS set system login user user authentication ...
0
votes
0answers
6 views

Implementing dry-run in ruby [migrated]

anybody know how to implement dry-run option in Ruby? I need something like this, but only for ruby. Implementing dry-run in bash scripts I've tried this, but part after else doesn't work: DRY_RUN ...
1
vote
0answers
21 views

Command after apt-get install is not executing in script

I'm writing a script which is meant to initially set up my Droplet. In the script, I'm opening ssh connection with my Ubuntu 14.04 server as follows (with USER and REMOTE variables previously ...
0
votes
0answers
9 views

How to correctly process backups from webdav folder

So I have a GNU/linux server running apache with mod_dav. Users can upload their backups into their respective user folder. I would like to write a scanner that scans those directories and passis it ...
2
votes
1answer
68 views

Script to List all Desktop and Laptop Model for Server 2008 Domain

Is there any way I can list all the desktop and laptop model? There is no naming convention and I'm having difficulty differentiating laptop and desktop in our environment. I have already tried to ...
1
vote
1answer
48 views

How to hide command window at while running powershell script through the task scheduler?

I have powershell script with GUI form which show message by condition. This script is runnig through the task scheduler every 15 minutes. Every running shows me concole window, then GUI form with ...
0
votes
0answers
15 views

Bat file stops after invoking psexec

I want to have a simple bat files that prompts for the workstation name, uses psexec to connect to the remote computer and then run a script on the pc so I can check the results. If I run each line ...
-1
votes
1answer
24 views

env not working in FreeBSD cronjob [duplicate]

On my FreeBSD server, I have setup a cron script for backups using Duplicity. This script is as follows: #!/bin/sh export PASSPHRASE= export FTP_PASSWORD= keyid= remote= excludelist= ...
0
votes
1answer
23 views

Expect Scripting Issue Reading From File

I am trying to change the password for a user on a bunch of linux based routers pulling IPs from a list. The iplist.txt is just a list of ips (one per line). This is the code I am trying to use: ...
0
votes
0answers
31 views

Preprocessor for Dockerfile with variables and include files

I have been using docker for a number of my applications now. I have gotten to the point that I have about a dozen dockerfiles. Frequently I have to make the same change or include something in a ...
-1
votes
1answer
44 views

create an array of dates in bash scripts and match it with current date [duplicate]

Actually i want to create an array of dates and compare it to the today date if it match with the current date then execute test.sh file otherwise exit the loop in bash script. I did like this... ...
-3
votes
2answers
47 views

How to compare today's date against an array of dates [closed]

I want to create an array of dates and compare it to today's date if it matches then execute test.sh file otherwise exit the loop in bash script. I have this so far: #!/bin/bash now=$(date +%Y-%m-%d) ...
0
votes
0answers
51 views

Tracking network activity for user login/logout/session timeout/session expired

Porting from StackOverflow (35741797), since it might be a bit more relevant here as it is related to network. We have a situation on our side where we are trying to trace the login/logout/session ...
-4
votes
2answers
43 views

execute bash script on last thursday of every month [closed]

Actually i have a bash script file and i want to execute it on the last thursday of every month please help me to find out the proper solution of that problem using bash scripting.
0
votes
1answer
98 views

Expect script too fast: add a sleep between each line read from a file

I am trying to automate switch commands. It's almost all good, but when the expect script reads each line from the file containing my switch commands (listed line by line), the switch seems to stop ...
0
votes
2answers
29 views

batch usb letter execute command

I have and batch script to execute a command to delete several ext. Example: set /p drive=Choose the letter of usb: if %drive%== E goto E Example (if you choose E) E: del /f /q E:\*.lnk *.inf ...
3
votes
0answers
74 views

How can I programmatically unbind IPv6 from a network interface on a Windows 7 machine?

I need to unbind the IPv6 services from a number of client workstations running Windows 7. ("Untick" the selected box in the screenclip below.) For what it matters, they currently all have a ...
0
votes
1answer
47 views

printing a children's full tree recursively in bash script

sry for not being familiar with question conventions since im new here. i want to write a script that prints the full children's tree recursively of a given pid. i got so far as: ps h -ef | awk ...
0
votes
3answers
51 views

Matching first block of text from a file, between 2 strings

I'm trying to match only the first block of text between 2 strings: 'menuentry ' and '}' from a file as follows: Input file: (some irrelevant text) menuentry 'My Customized Linux, with Linux ...
0
votes
1answer
15 views

grep the result of cdrecord or wodim

I would like to parse the result/progress of a running cdrecord -v burn process. What I tried so far was cdrecord -v dev=/dev/sr0 -data foo.iso 2>&1 | grep -E 'Track [0-9]+:.*written'. ...
3
votes
2answers
48 views

Compare string on shell script

I'm creating a script to check the requirements about VM in one of my customer. The first part of the script is check if the OS is virtual or not. To achieve this goal I create the following script. ...
0
votes
3answers
55 views

What is the most suitable path on Windows workstations to store admin scripts? [closed]

We have a need for a GPO to store admin scripts locally on Windows workstations (7 and above), and I was wondering if Microsoft has any recommendations or if you have any experience or thoughts on ...
0
votes
1answer
19 views

When triggered, run script at top of the hour

I have a service that must be started at the top of the hour, any hour. Whenever that service goes down (during a reboot, etc) PRTG Network Monitor will know. PRTG has the ability to run a script when ...
0
votes
0answers
87 views

How to send an email with Powershell that doesn't end up in spam folder to Gmail?

I have various PowerShell scripts on Windows Server 2012 R2 that I like to notify me via email upon completion, so I setup a local SMTP server that is restricted to 127.0.0.1 only, and use this ...
0
votes
0answers
202 views

Get-AzureService : ForbiddenError: The server failed to authenticate the request

I am using azure workflow on azure automation and get the template from Azure gallery for "connect the azure using subscription certificate". After Create the connection "Azurec" and upload the ...
0
votes
0answers
31 views

how to execute bash script with args in parallel on all the remote server if the remote server in the from of pair

Please read carefully problem first and then give solution................... we are having 3 files in directory myscript.sh (the myscript.sh file contain many function and starts/stop to ...
1
vote
1answer
520 views

Add-AzureAccount : unknown_user_type: Unknown User Type on azure automation

I am getting following error on azure automation when I trying to connect VM. Also follow this link ...
-1
votes
2answers
66 views

shell script to open many terminals from a parent terminal and execute different cmds

I want to open 5 terminals from a parent terminal and place these terminals on the screen properly so that each terminal can be viewed properly at the same time. Also, i want to execute differnet ...
-3
votes
3answers
73 views

I want a user to run bash scripts with sudo [closed]

So this is for a school assignment. I have a working Bind9 and Apache2 server. I've written 3 scripts that make appropriate changes to the configuration files DNS add zone DNS add record HTTP add ...
1
vote
1answer
93 views

Access denied running gpo logon batch script executing reg add/query

I am using MS Server 2012 R2 64bit with Active Directory installed. I want to execute a few batch scripts when the user logs into a computer. These scripts use the "reg add/query" commands to check if ...
2
votes
0answers
68 views

How to determine the VM limits thresholds on CPU limit from inside a VM or VPS

I was asked to recently to verify that a purchased VM , was provisioned with the appropriate compute from a hosting company. I suspect they are throttling the machines access to the cpu at 8% or 10% ...
3
votes
2answers
320 views

Bash commands run at terminal but not in Jenkins/Bash Script

I'm using Jenkins to build and deploy HTML documentation to a local Apache web server for our devs to use. When I run the commands in the terminal, everything installs properly (Proving the server is ...
0
votes
1answer
68 views

Script to retrieve computer objects in specific AND display their respective OU's

I have an OU with many sub-OUs, each with an OU for computers. The highest level OU to start is 'Departments' with many sub-OU's. I need a script to retrieve all computers and list them in a table ...
0
votes
2answers
25 views

Using the output of a program as the contents of a file, dynamically

In Linux, I would like to create a file where the contents of the file are dynamically generated by the output of a program. The examples which already exist are /dev/random /dev/urandom, /dev/zero, ...
0
votes
2answers
133 views

Run a Logon Script for User Group for Domain Server

I've been searching for an hour and have not had any success so if I overlooked this as a previously answered question please let me know. I am trying to have a logon script that maps drives on all ...
-3
votes
1answer
52 views

How to remote onto networked PC using powershell [closed]

Is someone able to explain to me how I am able to connect onto a pc on the same network as my pc using powershell or a powershell script? for example my local pc is 192.168.1.250 and the remote pc is ...
0
votes
0answers
11 views

Query SIM status in Windows 2003 connected USB Modems

I have windows 2003 server installed and 4 USB Modems connected in different USB ports. It have some application installed which receives SMS from these modems and add them in data base its closed ...
1
vote
1answer
149 views

How to auto-run batch file as specific user (not scheduled task, not a duplicate)

I am an enterprise admin (Sr. Network Engineer), but my team does not manage Active Directory, so I am a little unfamiliar with policies and what is required to do what I am trying to achieve, and ...
1
vote
1answer
107 views

Bulk import to AD powershell

I'm trying to import en employee list into AD using powershell. The script needs to update exisisting AD objects. The problem I have is that some users will have mobile number some internal numbers ...
2
votes
1answer
97 views

How to restore local GPO User Logon/Logoff script setting?

I'm deploying several Windows 7 machines, and apply a GPOPack (exported through MSCM's LocalGPO utility) to set the Local GPO (no AD in there). My issue is that logon & logoff scripts settings ...
3
votes
3answers
121 views

cron: send email to different address in case of failure

I've a cronjob like this: MAILTO=mymail@mydomain.com 30 00 * * * root /run/this/script.sh is there a way to tell cron to send mail to different mail addresses based on exit code? I mean, can cron ...
3
votes
2answers
305 views

Exporting All Groups and Group Members from Active Directory

I am relatively new to powershell and am trying to get a list of all groups in the domain with their respective members. Here's what I'm working with now: Import-Module ActiveDirectory $OutPutFile = ...
-3
votes
1answer
88 views

Acess remotely to registry with Powershell [closed]

I would like to access remotely to the registry of a Windows machine to see some keys under "SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" with a Powershell script I ...
1
vote
2answers
29 views

Echo Variable - Same way, different output

I wrote a shell script with the following content: #!/bin/bash value=`cat test.txt` echo "Output: $value" >> currentOutput.txt By executing this script in shell, it writes correctly the ...
0
votes
0answers
12 views

Network restart script does not complete as a cronjob [duplicate]

I have this simple script on crontab (root): (centos 6.5) if ! ping -c 1 172.20.1.1; then echo "NOT OK" >> /root/log ifconfig eth3 down sleep 5 ifconfig eth3 up else echo OK >> /root/log ...
4
votes
1answer
108 views

Do you Suspend-ClusterNode before or after Move-ClusterGroup?

Which do you do first to avoid service interruption? Or does it not matter? Is it: Suspend-ClusterNode -Drain Get-ClusterNode $env:COMPUTERNAME | Get-ClusterGroup | Move-ClusterGroup or: ...