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
120 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
103 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
124 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
386 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
105 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
31 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
124 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: ...
-1
votes
1answer
283 views

What shebang for Anaconda Python on my directory of Server

I have anaconda python distribution in ~/anaconda/bin/python but what shebang can I use to call this version of python instead of the old one that is default on the server? # ...
2
votes
1answer
84 views

How can I use openssl to get results from HTTP GET requests?

I need to use openssl to perform some HTTP GET requests in a shell script. The line I'm using to do this right now is shown below. This is parsing the content of an XML response of the following ...
-2
votes
1answer
36 views

Modify multiple accounts script

I need a script to make modifications on multiple accounts. Within the account, in general info, the display name should include “name +surname” + Custom Title. So the script should just add the ...
0
votes
1answer
27 views

Automate s3fs-fuse install

I'm trying to write script to install s3fs-fuse, but i don't know how to change directory in a bash script. These are the script I want to automate git clone ...
2
votes
1answer
33 views

Is it possible to script rebooting to another OS once?

In Server 2012 R2 you can hold Shift when you choose to reboot from the start menu it brings you to a screen that lets you choose which OS you want to boot to if you have multi-boot set up. This ...
1
vote
1answer
20 views

SFTP script gets different destination response when run from different directories

I'm baffled by an SFTP shell script and any help would be greatly appreciated. I wrote an sftp script to connect to and upload ACH information to a banking site. The script uses 'expect' to wait for ...
0
votes
0answers
160 views

Windows batch command equivalent of “curl -s -L http://j.mp/script.sh | bash”

I would like to run a batch script that calls another batch script hosted on the internet. In bash, this can be done using something like this: curl -s -L http://j.mp/script.sh | bash How can I ...
1
vote
1answer
68 views

Is there a way to run a script file that searches for files BUT excludes hidden files and folder?

I need to search some windows servers for files created after a certain date. I have set something up with forfiles but would like to speed up the process and reduce file size of the output file by ...
2
votes
4answers
171 views

Scheduled Task for Powershell Script

So I'm trying to run a powershell script on a schedule. Every morning at 6am, repeat every hour of the day. Here is the script itself: Get-Content C:\Users\administrator\Desktop\users.txt | ...
-1
votes
1answer
78 views

Batch update user account passwords on multiple servers [closed]

I have a script to update user ID and passwords every 90 days due to security issues. With this script, I have to manually go to every server and run the batch script. I have roughly 60 odd servers in ...
0
votes
1answer
70 views

Can forfiles search multiple drives in the same command and create a txt file of results?

Can forfiles search multiple drives in the same command and create a txt file of results? I have the following that works to show me the results in command prompt but what I really need is a txt file ...
2
votes
1answer
51 views

How can I export to CSV a custom output along with Module properties? [Powershell]

Here is my code, I am pulling user names, email addresses and a random password and would like to store these nicely in a CSV. How can I export to csv a custom property like my custom generated ...
0
votes
1answer
203 views

Do CMD scripts run faster than BAT scripts?

I recently heard from someone that Windows Admins should use CMD logon scripts over BAT logon scripts, as the run or execute faster. Apparently BAT scripts are notoriously slow. I've done a bit of a ...
3
votes
1answer
112 views

Looking for script to search linux servers for files older than x amount of days with specific naming scheme

My company has a set of linux servers that users store files on. The files following a common naming scheme of #####,###,### with the numbers correlating to fields unique to them. They are supposed ...
2
votes
0answers
31 views

Retention for Attachments - - - Microsoft Exchange 2010

Currently I am working with getting rid of voicemail to email files to save space in our archiving solution. Currently I have a search-mailbox script written to take care of deleting the voicemail ...
0
votes
0answers
50 views

Issues with NAUbackup Email Notification

I've setup NAUbackup to carry out backups for my xenserver 6.5 VM's. It backups up fine but I can't get the email notification to work. I've uncommented everything in the VmBackup.py script, added my ...
-1
votes
2answers
166 views

Multiple public IP addresses on CentOS server

Is it possible to have multiple public IP addresses (500) on one server running CentOS and switch them without restarting networking service. I would like to use one public IP per specific service ...
1
vote
1answer
104 views

Possible to filter dsquery group?

I am trying to output the members of an AD group in an easy to read format with the following: dsquery group -name "<AD GROUP NAME>" | dsget group -members -expand | dsget user -samid -fn -ln ...
0
votes
2answers
154 views

i need a sip softphone that would on incoming call open an url containing the caller number

The idea is that : a customer call, I automaticly open the page of his accout in my CRM. On the many SIP softphone on ubuntu (ekiga, linphone,...), the only one that i could make do that is twinkle. ...
3
votes
5answers
1k views

PowerShell prompt to continue execution of code

I have a script I am using to automate WSUS processes, and the last stage of it goes on to remove all old/unnecessary files/objects. I would like to prompt 'Press 'Enter' to continue with removal or ...
1
vote
1answer
169 views

What is the best way to get a list of nodes that belong to a Cassandra cluster?

I'm creating some scripts for some Cassandra clusters I operate. Some of these scripts need a list of nodes that are part of the cluster. nodetool status will print a list of the nodes and their ...
0
votes
0answers
6 views

Maintain and version controll config- and SQL scripts

I'm looking for recomandations of handling variouse config scripts for a few databaseservers. The scrips fall into the following categories: OS Config scripts and files, such as crontab for multiple ...
-1
votes
1answer
62 views

Cron: Execute python script, capture stdout & stderr and send via msmtp [duplicate]

I try this for almost 4 hours now, in different ways. I googled a lot, but nothing I try work as expected. I have a simple .msmtprpc file, that allows me to send mails like this: echo -e "Subject: ...
0
votes
1answer
301 views

NAUbackup - Xenserver 6.5 Backup Solutions

Has anybody every successfully used NAUBackups for xenserver 6.5 and had their backups go to a SAN storage repository? I see the default script backs up to an NFS share but I am trying to avoid NFS ...
3
votes
0answers
78 views

Robocopy from one to many

I am trying to use robocopy to update some internal AV clients that are not working. They will update once I the files are copied manually in. I've tried the following robocopy script, but can't get ...
7
votes
1answer
3k views

How to get SCCM to recognize return codes from Powershell script completion?

I'm using an SCCM 2012 application deployment to install software. The specific install type is scripted installer as SCCM kept failing for exe validation errors. The script is powershell and ...
1
vote
1answer
94 views

Automating user password creation and User privileges restriction in solaris 8

I have couple of questions. Here is the first one We are trying to automate the creation of a user in solaris 8. We provide a default password and then force the user to change the password at first ...
0
votes
0answers
88 views

Using a .PAC file for switching proxies

My question is similar to this one: I need to connect to distinct proxies depending on whether I attempt to visit internal or external sites using my organization's network. No .PAC files have been ...
0
votes
0answers
141 views

LDAP NET-IQ DRA (Active Directory) Group member of does not work

I am trying to list a couple computers, that do not have a specific group membership. This is what I have at the moment: ...
-1
votes
1answer
44 views

CentOS 6 script at server boot up

I have three terminal commands that I would like to execute when server boots up. How can I achieve this? I have seen many solutions, but none of them seems to be simple and working. Here are the ...
0
votes
1answer
43 views

iptables-save syntax

My goal is to automate my iptables config, so while analyzing my current iptables rules setup on my local box for reference I get the following when using iptables-save > ./iptables.save; cat ...
2
votes
2answers
512 views

PowerShell to remotely invoke Exchange with other credentials

I've been tasked with creating a script that is going to be run on multiple user machines throughout the network. The commands that we're ultimately going to have run will change the user's email ...
3
votes
2answers
1k views

Can't Get PSExec to work with Powershell

Last week I developed a script that would check if psremoting was enabled on specified machines. This week I began working on a script that would enable psremoting on specified machines but I can't ...
0
votes
2answers
150 views

Accept Value From Pipeline Powershell Function

I would like to create a script that tell the user whether or not PSRemoting is enabled on multiple remote machines. Here is what I have so far: function Test-PSRemoting { Param( ...
0
votes
0answers
14 views

Identifying cached JNLP applications via batch script

I am attempting to script a solution to install JRE 7 only to systems that run a particular JavaWS application. Essentially the current application requires Java 6 and the upgrade will break ...
1
vote
1answer
218 views

How to cast as ArrayList, preset data in param block, and return as ArrayList?

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
27 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
46 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 { ...
0
votes
1answer
242 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
468 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
187 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
88 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 ...