Easily audit and install patches on your servers in the network by providing a graphical interf

Project Description
PoshPAIG allows you to easily audit and install patches on your servers in the network by providing a graphical interface

The utility works in any environment, but the optimal environment is a where you have a local WSUS server and your systems have Windows Update settings configured to “Download updates and do not install” either through Group Policy or local policy.

Due to licensing issues, please download PSExec.exe from the link below and place in the root of the UI folder, otherwise the Install portion will fail
http://technet.microsoft.com/en-us/sysinternals/bb897553

Version 2.1.5 has been released!
Please see release notes in the downloads section for new features/bug fixes.
http://poshpaig.codeplex.com/releases/view/100929

Capture

Hey, Scripting Guy articles:
http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/13/use-powershell-to-audit-and-install-windows-patches.aspx
http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/14/lessons-learned-while-writing-the-powershell-poshpaig-module.aspx

A list of new features available are:

  • Updated ListView UI
  • PSJobs replaced with Background runspaces for better performance
  • New reports for installed updates
  • Keyboard Shortcuts
    • F1: Display Help
    • F5: Run the selected command. Ex. Audit Patches,Install Patches
    • F8: Run a select report to generate
    • Ctrl+E: Exits the PoshPAIG applicaton
    • Ctrl+A: Select all systems in the Computer List
    • Ctrl+O: Opens up the Options menu
    • Ctrl+S: Opens window up to add more systems to Computer List
    • Ctrl+D: Removes a selected System or Systems
  • Services Reporting for non-running services set to Automatic
  • New UI changes
  • Better interaction with Windows Update Service
  • New reporting options available
  • Options menu to adjust some settings
  • MultiThreading of operations (Supports running 20 jobs at one time) without UI freeze
  • Add multiple computers with Add Server button using comma to separate each server
  • Select multiple computers in server list and perform operations on only those servers
  • Able to reboot systems with a monitored reboot
  • Ping sweep of all systems in server list
  • View windowsupdate.log on an individual server
  • View installed updates on servers
  • Remotely run wuauclt /detectnow on servers
  • Generate host list of servers
  • Sort columns
  • Notes column to track running operations
  • Error report

The PowerShell Patch Audit/Installation GUI started out as a project for work to build an interface to perform the patching of our systems to those who were not familiar enough with PowerShell to run a set of scripts I build to perform the same auditing and installation of patches. This product is currently in Alpha as there are some bugs that need to be squashed as well as other features I need to add to the tool as well as updating some some current features.

A blog post about this is available at http://learn-powershell.net/2011/06/03/powershell-patch-auditinstall-gui-poshpaig-released/

What this tool gives you is a way to first audit your systems which you can supply one of many ways. You can supply a list of systems, pull a list from Active Directory or manually add the systems yourself into the utility.

One of the best features about this tool is that it uses background jobs to perform all of the actions while the front end GUI is not affected. This means that you can freely move the GUI around as it does not get locked up like a normal WPF gui would in PowerShell if you attempted to run a job of some kind. You will also notice that the data in the GUI updates automatically as each job finishes for a server. For instance, if you are Auditing for patches, you will start seeing the number of patches waiting to be installed start updating next to each respective server. Same for Installing patches, the total number of installed patches, along with patches that gave an error when installing will be displayed in the GUI’s data window. Also, a progress bar is at the bottom of the GUI and status bar to show you how far along the process is.

After an Audit or Installation is performed, there are options to generate a Grid-View report for viewing or a CSV report can easily be generated to the default location of the GUI in no time!

Next version
The next version will have the following items that I am working on:

  • Better displaying of services report to allow restart
  • UI updates for grid view
  • Updated code and reporting
  • Various feature/bug requests

 

Project page: http://poshpaig.codeplex.com/

Download software: [wpdm_file id=84]

DiskPart has encountered an error: The media is write protected.

During the creation of a new disk, the error “The media is write protected” pops up.

Check if the disk (or volume) is in a read-only state:

DISKPART> attributes disk
Current Read-only State : Yes
Read-only : Yes
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No

If the disk or volume is in a read-only state, clear the attribute with the following command:

 

attributes disk clear readonly

attributes volume clear readonly

Go ahead with the creation of the new disk

Crack Sheet Protection Password in Excel

This routine provides a password to unprotect your worksheet. However, it may not give you the original password that was used.

Open the workbook that has the protected sheet in it. Hit Alt+F11 to view the Visual Basic Editor. Hit Insert-Module and paste this code into the right-hand code window:

Sub PasswordBreaker()
  'Author unknown but submitted by brettdj of www.experts-exchange.com

  Dim i As Integer, j As Integer, k As Integer
  Dim l As Integer, m As Integer, n As Integer
  Dim i1 As Integer, i2 As Integer, i3 As Integer
  Dim i4 As Integer, i5 As Integer, i6 As Integer
  On Error Resume Next
  For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
  For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
  For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
  For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126

 ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
      Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
      Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
  If ActiveSheet.ProtectContents = False Then
      MsgBox "One usable password is " & Chr(i) & Chr(j) & _
          Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
          Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
   ActiveWorkbook.Sheets(1).Select
   Range("a1").FormulaR1C1 = Chr(i) & Chr(j) & _
          Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
          Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
       Exit Sub
  End If
  Next: Next: Next: Next: Next: Next
  Next: Next: Next: Next: Next: Next

End Sub

 

Close the VB Editor window. Navigate to the worksheet you want to unprotect. Hit Tools-Macro-Macros and double-click PasswordBreaker in the list.

source: http://www.theofficeexperts.com/VBASamples/Excel02.htm

Scan fast multiple subnets to CSV files

I need multipe subnets scanned and need an outpu to a CSV file.

For this i will use a program called Softperfect Network Scanner. You candownload it from their website or download it here: [wpdm_file id=80]

First i’ll create an config file which has the settings i need:

I only need the ip, hostname and response time. So i will hide the MAC address from the View menu (Visible Columns). Also i do not need to scan a mac address and shared folders which are enabled by default. I will open the Program Options under the Options memu (or CTRL+K) and deselect the resolve MAC addresses under the Additional tab. Under the Shares tab i deslect the Scan for shared resources.

Now my config is like I want it, I need to save it to a xml file. I save the running config file to xml. Choose File, Current Config, Save to file and place it with the netscan.exe in a folder.

In the online manual you can read all other parameters to scan, but i use the simple command:

netscan /range:172.16.0.1-172.16.0.255 /auto:result.csv

This command will scan all devices within the 172.16.0.0/24 range and save it to a file called result.csv

VirtualBox – PXE does not work

During a WDS implementation the image stopt. After installing the VirtualBox 4.2.4 Oracle VM VirtualBox Extension Pack PXE ran fine and WDS could deploy images.

Download the extension pack from: https://www.virtualbox.org/wiki/Downloads

Make sure the machine which you are deploying has at least 512 MB of internal memory, otherwise the pxe boot will fail.

Windows 2012 – CLI

Activating Windows 2012 with powershell:

(or use sconfig)

slmgr.vbs –ipk <productkey>
slmgr.vbs –ato

 

Rename the sever:
  • Determine the current name of the server with the hostname or ipconfig command.
  • In Windows PowerShell, run Rename-Computer.
  • Restart the computer.

 

Installing GUI with powershell:

(or use sconfig)

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

An other option is to use dism

Dism /online /enable-feature /featurename:ServerCore-FullServer /featurename:Server-Gui-Shell /featurename:Server-Gui-Mgmt

If this fail, you need to mount the files.

1. Create a folder to mount WIM (mkdir c:\mountdir)

2. Check the index number needed for a server with GUI image (where d is the DVD drive)

dism /get-wiminfo /Wimfile: d:\sources\install.wim

We want to install the SERVERSTANDARD so the index number will be 2

3. Mount the WIM for Server Standard:

dism /mount-wim /wimfile: d:\sources\install.wim /Index:2 /mountdir:c:\mountdir /readonly

4. Start powershell and execute:

Install-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell –restart –source c:\mountdir\windows\winsxs

5. Restart the server

 

 

Remove the GUI with powershell:
Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

 

SCONFIG

Use SCONFIG to configure a lot of options (domain/Computername/updates/nic/…)

 

For other options to remove/install the GUI look at http://www.howtogeek.com/111967/how-to-turn-the-gui-off-and-on-in-windows-server-2012/

Configure a Server Core Server: http://technet.microsoft.com/en-us/library/jj592692.aspx#BKMK_1_5

Script – Get HP Serial Numbers

To get a list of HP Serial numers run the following Powershell script. Place the servernames/ipaddresses you want to check in the serverlist parameter.

 

#
# Get HP Serial Numbers from server text file
#
# Written by Bastiaan van Leeuwen
#
# Change $serverlist parameter to the right text file

$serverlist = "d:\script\servers.txt"
$username = Get-Credential domain\user

foreach($server in get-content $serverlist)
{
gwmi win32_systemenclosure -computer "$server" -credential $username –ErrorAction SilentlyContinue | 
select __SERVER,serialnumber
}

 

SCRIPT – Computer Inventory

The Computer Inventory Script enumerates Hardware, OS, System, Processor, Memory, Disk, and Network information and neatly organizes it in an Excel file. I’ve provided Version 2 of the script that allows you to choose a number of computer resources; all computers in the domain, all servers in the domain, computers from a list maintained in a text file, and the ability manually pick a computer. Version 2 of the PowerShell script also allows you to send credential information should you wish to logon the remote computer with an alternative user account. This is helpful for DMZ servers as well as stand alone servers that are not members of your domain.

source: http://www.powershellpro.com/why-i-no-longer-hate-writing-documentation/614/

 

[wpdm_file id=78]

Active Directory Users and Computers Saved Queries

source: http://myitforum.com/cs2/blogs/rcrumbaker/archive/2008/08/07/active-directory-users-and-computers-saved-queries.aspx

Right Click on Saved Queries and Choose New and then Query.

Name the Query accordingly and then click on Define Query…

 

Then Find the Custom Search and click on the Advanced tab.

Paste each of these in the <add criteria from above to this list> area and then click OK.

 

 

Locked Out Users

(&(&(&(&(objectCategory=person)(objectClass=user)(lockoutTime:1.2.840.113556.1.4.804:=4294967295)))))

 

Dial In Access

(&(&(&(&(objectCategory=person)(objectClass=user)(msNPAllowDialin=TRUE)))))

 

Disabled User Accounts

(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))

 

No Expiring Accounts

(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))

 

Active Accounts

(&(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)))

 

Hidden Mailboxes

(&(objectCategory=person)(objectClass=user)(msExchHideFromAddressLists=TRUE))

 

Windows 2000 SP4

(&(&(&(objectCategory=Computer)(operatingSystem=Windows 2000 Professional)(operatingSystemServicePack=Service Pack 4))))

 

Windows XP SP3

(&(&(&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP Professional)(operatingSystemServicePack=Service Pack 3))))))))

 

Vista SP1 Machines

(&(&(&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=Service Pack 1)))))

 

All Workstations

(sAMAccountType=805306369)

 

2003 Servers Non-DCs

(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2003*)))

 

2003 Servers – DCs

(&(&(&(samAccountType=805306369)(primaryGroupID=516)(objectCategory=computer)(operatingSystem=Windows Server 2003*))))

 

Server 2008

(&(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2008*))))

View BSOD (blue screen) crash information stored in dump files

Description

BlueScreenView scans all your minidump files created during ‘blue screen of death’ crashes, and displays the information about all crashes in one table. For each crash, BlueScreenView displays the minidump filename, the date/time of the crash, the basic crash information displayed in the blue screen (Bug Check Code and 4 parameters), and the details of the driver or module that possibly caused the crash (filename, product name, file description, and file version).
For each crash displayed in the upper pane, you can view the details of the device drivers loaded during the crash in the lower pane. BlueScreenView also mark the drivers that their addresses found in the crash stack, so you can easily locate the suspected drivers that possibly caused the crash.

http://www.nirsoft.net/utils/blue_screen_view.html

[wpdm_file id=76]