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

BASH script presenting IF syntax error [migrated]

for k in {794..800} if [ -f "vesta_$k.xyz" ] then do mkdir $k mv vesta_$k.xyz $k/vesta.xyz cd $k/ <<COMMANDS>> cd .. ...
3
votes
2answers
25 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
1answer
24 views

Powershell script for SCVMM that queries VM's for name and removes the ones with a status of missing

I'm kind of new to powershell and I'm looking for a script that will help me find out what VM's have the name staging and to delete them if they have the status of missing. I know it should probably ...
0
votes
0answers
14 views

Reading Hyper-V event logs using C# [migrated]

I need to be able to retrieve event log entries for Hyper-V as part of a monitoring system we use. At the moment I use VBScript and WMI and do something like: query = "Select * from Win32_NTLogEvent ...
0
votes
3answers
53 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
0answers
27 views

linefeed in bash script - to email [migrated]

I am doing printf to a logfile and having that logfile send through mailx, however, it seems that the linefeed "\n" are not recognised or captured in the mail. Snippet of script as below (notice the ...
0
votes
1answer
13 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 ...
-2
votes
0answers
27 views

netstat and retrieving user ip behind cloudflare

Im wondering if its possible to retrieve user ip behind cloudflare (HTTP_CF_CONNECTING_IP header) with netstat netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
0
votes
0answers
43 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
29 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
24 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
91 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
48 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
57 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
55 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
63 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
92 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
55 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
22 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
68 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
50 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
80 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
83 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
59 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
111 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
149 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
56 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
27 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
72 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
107 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
46 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
35 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
19 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
27 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
19 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
79 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
47 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
3answers
116 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
62 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
41 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
44 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
0answers
67 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
91 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
28 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
35 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
132 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
79 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
103 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. ...