Common scripts for everyday use

phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
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.

Comments

  • RobertKaucherRobertKaucher 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.
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    I 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!
  • tierstentiersten Member Posts: 4,505
    Check 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.
  • phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
    Remote logged on user

    As in who is currently logged on to a remote host?
  • RobertKaucherRobertKaucher Member Posts: 4,299 ■■■■■■■■■■
    phoeneous wrote: »
    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.
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    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.
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    dynamik wrote: »
    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.

    Your mom is an ideal candidate for scripting?!
    Good luck to all!
  • tierstentiersten Member Posts: 4,505
    HeroPsycho wrote: »
    Your mom is an ideal candidate for scripting?!
    Badum tish! HeroPsycho will be here all week. Try the steak.
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    HeroPsycho wrote: »
    Your mom is an ideal candidate for scripting?!

    Yep, and she prefers TCL.
  • Hyper-MeHyper-Me Banned Posts: 2,059
    I 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
  • ElvisGElvisG Member Posts: 167
    Hyper-Me wrote: »
    I 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_GAForsaken_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 ;)
  • phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
    #!/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_GAForsaken_GA Member Posts: 4,024
    phoeneous wrote: »
    Looks 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.
  • NightShade03NightShade03 Member Posts: 1,383 ■■■■■■■□□□
    I liked the idea of putting together a collection of commonly used scripts...anyone else?
  • ElvisGElvisG 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.
  • phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
    ElvisG wrote: »
    /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
  • NightShade03NightShade03 Member Posts: 1,383 ■■■■■■■□□□
    phoeneous 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.
  • Hyper-MeHyper-Me Banned Posts: 2,059
    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.
  • pennystraderpennystrader Member Posts: 155
    I 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.....

Sign In or Register to comment.