Scripts By Tim Parkinson

  • advanced10.ps1 by Tim Parkinson 20 Apr 2011 06:01 PM UTC
    by 2 users

    Advanced Event 10

    An advanced function which creates the log file and writes out to it. By default uses temporary folder of the user, and a GUID as the filename with a .txt extension. All of these may be overridden by parameters (including a scriptblock to generate the filename). Supports encoding and whatif, verbose and debug parameters. Allows display of the program in notepad (may be overridden) and returns the filename that is written to.

  • advanced8.ps1 by Tim Parkinson 19 Apr 2011 05:30 PM UTC
    by 2 users

    Advanced Event 8

    Uses powerboots to display a GUI for image directory selection and display. Has a re-usable function for exporting the image at lower quality and without metadata, using the PSImage functions. When first run it downloads and unzips these libraries local to it's own folder so as to avoid making changes elsewhere on the system. It remembers paths that are entered on the next run and allows processing of the whole folder.

  • advanced9.ps1 by Tim Parkinson 15 Apr 2011 05:40 AM UTC
    by 2 users

    Advanced Event 9
    1 Comments

    A single function which creates the daily log file, assumes it is called by another routine. Creates the file, doesn't overwrite it if it already exists and is silent unless -Verbose is requested or an error is thrown (which it deliberately doesn't handle because it is expected to be called by another routine). Meets the Extra Credit functionality by creating the logfile folder if it doesn't exist and also creating it in the My Documents folder of the user. Additionally accepts parameters to override any of the default values.

  • advanced7.ps1 by Tim Parkinson 12 Apr 2011 07:29 PM UTC
    by 2 users

    Advanced Event 7

    This one has a Get-SQLSaturdayRegistrant function which uses IE and the DOM to get each registrants details. It then calls the function written for event 6 (code re-use!) to get twitter details. There is also a slightly superfluous lookup function which will check a CSV file. It's all dynamic parameter driven. It detects whether it is being dot-sourced and if not runs some sample code (again parameter driven)

  • advanced5.ps1 by Tim Parkinson 11 Apr 2011 06:52 PM UTC
    by 2 users

    Advanced Event 5

    A function which queries a remote computer for the information required for determination of Windows 7 eligibility. It assumes that since the event is corporate, that it will be run with domain admin rights or similar and that the video driver capabilities can be provided as a CSV, etc. The 32 and 64bit requirements are taken as hashtables in case they need to be altered (a decision may be made that more memory is required for a better experience, for instance).

  • advanced6 by Tim Parkinson 11 Apr 2011 06:01 PM UTC
    by 2 users

    Advanced Event 6

    Couple of very simple functions. Get-WebPage just gets the text of a webpage and spits it out to the pipeline. Find-Twitter user searches for url, @username or just username twitter users and outputs those items to the pipeline. The two are wrapped by a simple statement to generate the file required by the event.

  • advanced4.ps1 by Tim Parkinson 10 Apr 2011 10:20 AM UTC
    by 2 users

    Advanced Event 4
    1 Comments

    A function using WMI to get service info, because all the info isn't available to the built-in PS cmdlets. Includes a wrapper which allows selection of output type (console tables, gridview, raw object and html report) including a check for elevated privs.

  • advanced3.ps1 by Tim Parkinson 09 Apr 2011 02:34 PM UTC
    by 2 users

    Advanced Event 3
    1 Comments

    A function using PS remoting to query a remote computer for events in enabled logs that have been written to on the day of the query. Wrapped in a wrapper with logic for computer selection and output property selection.

  • advanced2.ps1 by Tim Parkinson 09 Apr 2011 11:20 AM UTC
    by 3 users

    Advanced Event 2
    1 Comments

    A function that gets the Running services and their dependencies on remote computers using built in RPC of get-service. Also has an output prettifying function and a wrapper with computer selection logic (local machine, specified machines (could come from file) or from AD).

  • advanced1.ps1 by Tim Parkinson 09 Apr 2011 09:53 AM UTC
    by 2 users

    Advanced Event 1
    1 Comments

    A fairly simple function which uses PS remoting to query a computer. Is wrapped in a simple wrapper that allows selection of computer to run against (including AD query) and outputs requested properties as a CSV. Assumes all machines are WinRM enabled and that it's being run by a domain admin or similar.