Questions tagged [scripting]

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

219 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
2answers
5k views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This is ...
4
votes
3answers
1k views

How do I launch a command on a remote computer with an invalid domain trust? (using local creds)

I intend to use WMIC to reset the trust of a machine that is remote, and off the network. All of the following variations result in an "access denied": The following works fine: net use \\patterson-...
3
votes
0answers
648 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 single, ...
3
votes
0answers
162 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
0answers
155 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 ...
3
votes
0answers
3k views

SSMS stuck scripting database objects

SQL Server Management Studio sits stuck, after scripting all objects in a database. Except it didn't script all objects in a database. i scripted all the objects in an SQL Server 2008 database from ...
3
votes
1answer
665 views

reconstructing shell session from a typescript

There is a bunch of tools like 'script', 'screen', 'ttyrec' which allow record content of shell sessions. By design these tool records everything displayed on pty, including control characters. ...
2
votes
1answer
2k 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 ...
2
votes
1answer
625 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 ...
2
votes
0answers
61 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 e-...
2
votes
1answer
242 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 ...
2
votes
0answers
3k views

How to retrieve a MDT task sequence variable and use it properly inside Powershell

I'm trying to retrieve a MDT task sequence variable inside a Powershell script, then use that variable in a Powershell function. My problem lies in that the variable I want to retrieve contains a ...
2
votes
2answers
334 views

Provide Administrator credentials within script

I am writing a script that runs from a user account. The script needs to execute another script as the Administrator account. Tried AutoIt's RunAs - didn't work. Tried PsExec - the same. Tried CMD's ...
2
votes
1answer
1k views

lftp mirror leaves empty folders on remote

My script is set up with this for lftp lftp -p 2218 -u $login,$pass sftp://$host << EOF set mirror:use-pget-n 5 mirror -c -P5 --depth-first --Remove-source-files --log=/home/dog/...
2
votes
2answers
872 views

Get hostname from url using Trafficscript

I'm looking to get the hostname from a URL as it comes through Zeus and I've looked through the documentation on Trafficscript and it seems like the only option is regex. Doe Trafficscript have a ...
2
votes
1answer
1k views

vmware thin disk usage powercli

I want to ask a question about thin provisioning. get-vm commandlet can easly give us real space used by a vm totally. Assume that you have a virtual machine which has more than one thin disk. If ...
2
votes
1answer
88 views

Rolling Oncall Distribution List with Microsoft Exchange

I'm trying to set up an "oncall" user/email for Microsoft Exchange (ex: oncall@mybiz.org), with the idea being that whoever on my team is currently "oncall" will be added to the list. Then, when they ...
2
votes
0answers
383 views

Login script on windows client does not map drives correctly

This script is located in the OU container of a sample Organization tree in an eDirectory that I created for the purpose of exploring and troubleshooting. This is not a critical/ live system setup. ...
2
votes
1answer
983 views

Amazon S3 Website & MySQL Backup

I have a website (a digital asset management system/gallery - http://www.resourcespace.org) that has a huge amount of images. The total size of the website, including the images is approximately 6gb. ...
2
votes
1answer
142 views

I am trying to automate an install with Active Directory to a server core box?

I am trying to automate an install with Active Directory to a server core box? I assume I need to set up a script. Any ideas on how to go about this.
2
votes
1answer
698 views

add certificate to all files in EFS-folder with script

I try to set up collective access to EFS-folder. I want to add certificates of all users to all files in folder. Is it posible do with using powershell scripts or some another way? Thanks.
2
votes
0answers
952 views

Controlling rdp listener connections from command line

RPD on my windows 2003 server sometimes becomes incapable to accept connections. But netstat shows that port is listened. c:\> netstat -ano | find "3389" TCP 192.168.1.1:3389 0.0.0.0:0 ...
2
votes
1answer
253 views

Batch Query Dell Service Tags for System Configs

Not sure if any of the smart folks in this thread Batch Query Dell Service Tags are still around but I have a very similar problem: I need to query the Dell Support website to gather original system ...
2
votes
1answer
70 views

Is it possible to tell what machines I'm logged in to (but disconnected from)?

I infrequently work on about 20 Windows servers via remote desktop. There are times when it'd be really convenient to know if and where I have disconnected sessions open. Is there a powershell script ...
1
vote
1answer
107 views

Powershell Get-Netadapter varible pass to Set-DnsClientServerAddress

Good day everyone, Trying to write a simple script that will find the friendly name of the Ethernet Adapter on a given machine and pass this string to the cmdlet 'Set-DnsClientServerAddress' so that ...
1
vote
2answers
240 views

Change Registry Key Permissions Access Control List using only Command Prompt

I am trying to change the Access Control permissions on a specific registry key i'm generating using a batch file. I try using regini.exe to pull the configuration from a .ini file and run into ...
1
vote
0answers
35 views

How to configure a https proxy with JVM command line arguments?

I am trying to create a container with Docker that contains eclipse and some plugins. By now, I am trying to configure the proxy that I need for internet connexion and it works for the http but not ...
1
vote
0answers
99 views

MD5 hash comparison over SMB SLOW

I'm scripting a full backup solution in powershell on Windows server 2016 for Hyper-V VM's and have run into the issue that calculating the MD5 hash over the network on a mounted network drive across ...
1
vote
0answers
42 views

How nginx to update reverse proxy its conf dynamically?

I am planning to set a reverse proxy with nginx , my question is i want to dynamically change the reverse proxy in nginx depends on the request is coming Let us say i have request xyz request from ...
1
vote
0answers
21 views

ActiveMQ automatic Configuration file change and Re-Deployment

How can we automate the task of a configuration file change for ActiveMQ? Situation: We are running a T.A.P. street of ActiveMQ servers (5.15.7), the A and P environments are in a SAN Master Slave ...
1
vote
0answers
76 views

Automatic DB creation with MongoDB in Kubernetes or OpenShift

I have a MongoDB cluster in Kubernetes, it's pushed to Kube with a StatefulSet type of deployment. That part work's good, I can even create 1 DB with variables starting with that... My question is, ...
1
vote
0answers
41 views

Double bracket missing in Oracle Linux

So I was trying to write a script in an Oracle Linux server and nothing worked. To begin with, there is no double bracket as far as I can tell. Also, the error messages I get are weird. For instance, ...
1
vote
1answer
35 views

save hdf5 data when admin kills script

I have a lot of Monte-Carlo data that I need to process at a particular cluster. What I do is, for a given data sample (which is on average of size 70 GB), I run some statistics script in python on ...
1
vote
0answers
33 views

Multi VPS: Best practice for semi-automated upgrades?

I've got many virtual private servers, each needing some apt-get upgrade -y lovin' from time to time. (Ubuntu 18.04) Problems I face: I don't have time to upgrade each one manually. I don't want to ...
1
vote
0answers
496 views

Allow standard user to modify HKCU registry from script

I'm writing a batch script to launch a program for my Citrix environment and I'm running into some issues with a couple of reg keys I'm trying to set in the script. essentially I'm launching an ...
1
vote
0answers
161 views

Set Windows 10 Default Start Layout

How can we set the default start layout and task bar icons for each user in Windows 10, yet still let users modify them later? I know you can use an XML file to set these, but a standard XML file ...
1
vote
0answers
48 views

ideas needed - cut the smb connection when disk full

Hello sometimes we are having issues like when some misbehaving user copies files to a server via admin share or other share and he causes disk drive to fill and a p1 ticket be created by monitoring. ...
1
vote
0answers
577 views

remote powershell unrecognized command when calling functions

I have two servers. Server A needs to contact server B and run a specific function withing a powershell function library (just a .ps1 file) that I've created. The function that is being called also ...
1
vote
0answers
606 views

Set-Acl : Attempted to perform an unauthorized operation while using Addaudit Rule

I am trying to run Powershell script to set Audit Rule on C:\Windows\security folder on my Windows 2008 box. Below is the script: $FileDirList = ("C:\Windows\security") $AccountName = New-Object ...
1
vote
0answers
78 views

automate server downtime for different servers at different days and time

I have created script with Ansible and also with Python to put servers down in my work environment but If I can create group of all servers and set their downtime at once. Example: If I need to put ...
1
vote
0answers
53 views

Verified data retrieval from source with limited access

Briefly: I need to download data from a linux-based device, verify data integrity, and delete the source files (can't use rsync). Details: I have a hydrophone deployed at the bottom of the ocean as ...
1
vote
1answer
814 views

Schedule a Script Job to run automatically but requires user interaction/input

I initially started this script for something else, thinking it would be nice for the script to handle the full process automatically, reboot, and start more script stuff. Then I realized I had a ...
1
vote
1answer
121 views

Give user permission to change IP address from static to DHCP and vice-versa

Let me start by saying I am somewhat of a Linux newb. I have inherited some basic Ubuntu systems to admin (Ubuntu 16.04). I have a couple users that need to plug their machines from the network to ...
1
vote
0answers
50 views

Windows Firewall - Unblocking via Script

I'm trying to setup a script to unblock IP's that may get caught up in a custom rule on Windows Firewall. I am trying this: netsh advfirewall firewall delete rule name="rule_name" remoteip="ip" In ...
1
vote
0answers
954 views

Behaviour of environment variables in HKCU\Volatile Environment reg key

I have a .bat script that runs for every user at login (copies Oracle Java Exception Sites). It copies a file to: %userprofile%\appdata\LocalLow\Sun\Java\Deployment\security\exception.sites ...
1
vote
0answers
987 views

Powershell script run System.IO.FileSystemWatcher as Windows service

I need a FileWatcher script to detect new files and execute another powershell script if the files are found. The destination directory of this 2nd PS script outputs file to a UNC mount that has the ...
1
vote
0answers
2k views

Access denied in powershell when executing command to remote servers

I'm trying to execute the following script on several remote servers and I think the syntax is correct, but it keeps coming back as "access denied". A few things to note - I am executing the script ...
1
vote
2answers
55 views

Pre-run “cancellation” in bareos/bacula

DNS in my environment is a bit wonky at times. When Bareos connects to a client, the client is not always the one specified by the hostname. I have a cron script that runs jobs automatically and ...
1
vote
0answers
27 views

Make one machine look like the rest regarding packages

I've been given the daunting task of deploying one "pristine" machine's packages to the rest of them - about 120 machines in total. All of the machines are running CentOS 6.8. The power users have ...
1
vote
2answers
178 views

Bash script aborting after defining lsb functions

I'm currently trying to get a script to work, which needs to define some LSB functions. This is happening here: echo "step 1" # Read configuration variable file if it is present [ -r /etc/default/$...