Common scripts for everyday use
I'm starting to get into scripting a little bit more. Just vbscript for now but eventually powershell, python, and perl.
What are some of the common scripts that you use to manage your network? No need to post code, just a short description.
What are some of the common scripts that you use to manage your network? No need to post code, just a short description.
Comments
-
RobertKaucher Member Posts: 4,299 ■■■■■■■■■■Remote install of TightVNC
Remote logged on user
Remote kill of a process based on user name for the TS server
I have a PoweShell script that is used at the branch office for the person there to do diagnostics. It will tell the person if the Internet is down, if the VPN connection is down, or if there is an issue with the servers at the main office. -
HeroPsycho Inactive Imported Users Posts: 1,940I had a script that checked for low disk space on servers, NetApp filers, and made sure all things Exchange were good.
I also had scripts to test replication for Active Directory.Good luck to all! -
tiersten Member Posts: 4,505Check disk usage on the various servers.
Clean up temp files on server.
Purge print queues at night. If you haven't printed it by the end of the day then you gotta reprint it tomorrow. -
phoeneous Member Posts: 2,333 ■■■■■■■□□□RobertKaucher wrote: »Remote logged on user
As in who is currently logged on to a remote host? -
RobertKaucher Member Posts: 4,299 ■■■■■■■■■■As in who is currently logged on to a remote host?
Yes.
http://www.techexams.net/forums/off-topic/49318-monitor-im-traffic.html#post368190
I actually posted that one in another thread you started. It could easily be changed to do bulk queries, though. -
dynamik Banned Posts: 12,312 ■■■■■■■■■□RobertKaucher wrote: »Oooooh. Double post. This may be deleted.
You could have just hit "edit" and deleted it yourself. Now it's been saved for all time. You're welcome
Any tedious, repetitive task is an ideal candidate for scripting. -
HeroPsycho Inactive Imported Users Posts: 1,940You could have just hit "edit" and deleted it yourself. Now it's been saved for all time. You're welcome
Any tedious, repetitive task is an ideal candidate for scripting.
Your mom is an ideal candidate for scripting?!Good luck to all! -
tiersten Member Posts: 4,505HeroPsycho wrote: »Your mom is an ideal candidate for scripting?!
-
dynamik Banned Posts: 12,312 ■■■■■■■■■□HeroPsycho wrote: »Your mom is an ideal candidate for scripting?!
Yep, and she prefers TCL. -
Hyper-Me Banned Posts: 2,059I have used some powershell scripts with the quest cmdlets to count the computers in various OUs that represent branch sites.
We created a script to to the following tasks for the technicians for the AD rollout:
Enable admin account
change admin password
**** IP settings to a txt file
enable DHCP
join domain
reboot
clean old local profiles -
ElvisG Member Posts: 167I have used some powershell scripts with the quest cmdlets to count the computers in various OUs that represent branch sites.
We created a script to to the following tasks for the technicians for the AD rollout:
Enable admin account
change admin password
**** IP settings to a txt file
enable DHCP
join domain
reboot
clean old local profiles
We (as in this forum) need to start creating a list and the commands to preform for each other. Like for example, common scripts that I preform on a daily basis. I'm sure there are admins here who (namely me) who would love to have a print-out tacked up beside them for quick reference. -
Forsaken_GA Member Posts: 4,024#!/bin/bash
for a in `find -iname '*.cgi' -or -iname '*.pl' -or -iname '*.php' -or -user www-data`; do grep -HE 'passthru\(|system\(|eval\(|`|qx' "$a"; done|grep -v '^Binary'
Let's see who can figure out what this script is for -
phoeneous Member Posts: 2,333 ■■■■■■■□□□Forsaken_GA wrote: »#!/bin/bash
for a in `find -iname '*.cgi' -or -iname '*.pl' -or -iname '*.php' -or -user www-data`; do grep -HE 'passthru\(|system\(|eval\(|`|qx' "$a"; done|grep -v '^Binary'
Let's see who can figure out what this script is for
Looks like a pentest script on a webserver. Am I close? -
Forsaken_GA Member Posts: 4,024Looks like a pentest script on a webserver. Am I close?
Close enough. It's what we use for a first run through to find code that's been added to a webserver that will generally allow remote execution. -
NightShade03 Member Posts: 1,383 ■■■■■■■□□□I liked the idea of putting together a collection of commonly used scripts...anyone else?
-
ElvisG Member Posts: 167/me raises hand!
With all the Windows admin out there in the wild, you would think there would be a book. We need a Network Warrior book for Windows scripts. -
phoeneous Member Posts: 2,333 ■■■■■■■□□□/me raises hand!
With all the Windows admin out there in the wild, you would think there would be a book. We need a Network Warrior book for Windows scripts.
Perl Cookbook - O'Reilly Media
Python Cookbook, Second Edition - O'Reilly Media
Windows PowerShell Cookbook - O'Reilly Media -
NightShade03 Member Posts: 1,383 ■■■■■■■□□□
The python one is pretty good....I don't think everyone is using powershell yet. I still use alot of vbscript for the day to day stuff. -
Hyper-Me Banned Posts: 2,059NightShade03 wrote: »The python one is pretty good....I don't think everyone is using powershell yet. I still use alot of vbscript for the day to day stuff.
Ive been using powershell a bit.
I, unfortuantely, never learned VBscript. -
pennystrader Member Posts: 155I am wanting to learn powershell but have VBscript scripts for the following.
Add/Remove Domain Groups
Change local admin pw
Diskspace report
email script
ping
enter all dns and dhcp information across an entire domain
check on windows trusts to ensure they are working correctly
query registry
scheduled tasks
MonitorHighSecurityAdmins
terminal services mode
etc...
The more knowledge one obtains the more there is too accumulate.....