Questions tagged [scripting]

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

Scripting is usually done in a scripting language. Such scripting languages are often dynamically typed and interpreted, as opposed to compiled languages. Examples of such languages include PowerShell, Perl and Bash.

1826 questions
5
votes
1 answer

How does Outlook identify "Extra Line Breaks"

I am writing a script that emails the output to me, and I read it in Outlook. For some reason Outlook removes all the line breaks in the message, and gives me a little notice that it has removed the extra line breaks from the message How can I fix…
Brent
  • 22,857
  • 19
  • 70
  • 102
5
votes
2 answers

Windows Group Policy Startup script is not executed at startup

I have written a .cmd file which calls ten different .exe files. I am able to run this .cmd file locally, on my server, and it works fine. When I use [gpedit.msc] (Group Policy Editor) for "Computer Configuration, Windows Settings" and set my .cmd…
5
votes
5 answers

Pass your password to your SSH key via a script

I am writing a script that will allow me to retrieve a file from all of my servers at once. I have SSH keys in place in order to log into my servers. My SSH key however requires a password. The script I am writing will not be automated, it will only…
mhost
  • 1,179
  • 3
  • 16
  • 25
5
votes
4 answers

Logging to a file, prepending a timestamp to each line (Debian)

I am trying to log output from some shell scripts of mine to a file, and I want the timestamp prepended to each line. From what I understood, that's what logger(1) is for, but I don't want the output to go to /var/log/messages, and I can't see that…
obeattie
  • 304
  • 1
  • 6
  • 13
5
votes
6 answers

Useful WMI admin scripts

In a comment to my response to this question , cop1152 said he loved WMI scripts. Well, so do I! What are your favourite, best, most useful scripts you'd like to share with the community? thanks.
gbjbaanb
  • 3,892
  • 1
  • 23
  • 27
5
votes
3 answers

Scritp to wait for few seconds before executing next line

I have a script which copies(scp) .war file to tomcat's webapps and the .war file extracts creating a folder under webapps directory on a ubuntu system. My next line of the script is restarting the tomcat which is executed immediately before the…
user53864
  • 1,723
  • 11
  • 37
  • 66
5
votes
3 answers

How to switch proxy settings via script?

There are a number of users in our organization that use their laptops on multiple networks. Each network has its own proxy setting requirements for accessing the Internet and currently, the users must manually change these settings in Internet…
Jeff Yates
  • 227
  • 1
  • 3
  • 11
5
votes
4 answers

Get maximum memory usage of linux executable

I need a shell script which will retrieve the maximum memory consumption of a linux executable. The executable may spawn child processes using significant amounts of RAM which should be included in the total. I've tried /usr/bin/time -f "%M"…
Isaac Sutherland
  • 787
  • 2
  • 9
  • 17
5
votes
1 answer

How can I find all groups a user belongs to via DSQUERY

How can I find all groups for a specific user (groups for which the user is assigned) using dsquery?
atricapilla
  • 615
  • 6
  • 12
  • 15
5
votes
4 answers

How to execute a system-wide script upon any ssh login (with OpenSSH)?

Upon any ssh login/connection (anybody logging in through ssh), is there a way to have a script executed? Using OpenSSH server. The script should not be modifiable by any of the users, -- of course --, so this should be a system-wide…
Weboide
  • 3,345
  • 1
  • 25
  • 33
5
votes
3 answers

Moving to an outside Exchange provider - How to create new Outlook profile on multiple PCs?

Following an acquisition we are switching from our local Exchange to an outside provider. I need to change account settings / create new profile so that users are able to access their new mailbox, and I hate the idea of doing it manually on every…
imagodei
  • 499
  • 1
  • 3
  • 13
5
votes
1 answer

Shorcut to list pending updates in Microsoft Windows

Is it possible to create a shortcut to "View update history"? Or, do you have a script (powershell, vbs, cmd, ...) to list pending updates?
TN.
  • 557
  • 5
  • 10
  • 21
5
votes
4 answers

How do I list currently running shell scripts?

I think I have a shell script (launched by root's crontab) that's stuck in a loop. How do I list running scripts and how can I kill them? I'm running Ubuntu 9.04, but I imagine it's similar for all *nix systems...
Nick
  • 4,503
  • 29
  • 69
  • 97
4
votes
1 answer

Changing PF rules on the fly to mitigate damage of DDoS (OpenBSD 6.4)

This is a two part question, really. Keep in mind that I am a developer not a system admin, but being the only employee in the company, I wear ALL the hats. I have deployed my server with two firewalls running on CARP for load balancing/redundancy…
Miguel
  • 171
  • 4
4
votes
1 answer

Do group policy shutdown scripts run before Windows Services shut down?

You can have a [shutdown] section in group policy which specifies some scripts to run during system shutdown. Do all these scripts run before Windows services start receiving 'Preshutdown' notifications (if they registered for those) or get…