Posts

Showing posts with the label Powershell

Are my GPO's in Sync?

Image
Do you ever wake up at night in a panic...wondering are all my GPO's syncd?  Me too!  So today I thought I would write a GPO script that would allow me to check the versions of all my GPO's! As you know the GPO version number is stored in a TXT based file in the root of each {<random string>} GIUD number folder and in the TXT file is a version number value. The script does the following: Gets all the domain controllers in your domain (Checks if they are online or not) Gets all of the {GUID's} in each servers sysvol (If the path exists) Reads the version number for each one (If the file exists) Reports if there are errors Checks to see if all the versions match Prints out a nice report of Server, GUID, Version Required Modules :  ActiveDirectory Required Permissions :  RunAs Administrator on a domain controller as a domain admin account. Results: Script: #Group Policy Version Checker $startpath = get-location | select path $startpath = $s

Export VMware data directly into Nagios

I ran into an issue the yesterday.  In our environment there is NO budget for deploying an enterprise class monitoring solution.  In this case the team had chosen to deploy Nagios.  Nagios is a pretty robust tool, but limited in what you can do on the web interface.  In addtion we had 200+ VM's that had yet to be added.  There are some handy web UI tools to manage the configuration scripts, but who has time for that.  I whipped up this handy PowerCLI script to pull all the live VM data from VCenter and export that data into a .CFG file ready for Nagios Core to use.  Feel free to download and share. You can copy and paste this right into your powerCLI interface once you connect to your VI Server. #Export VM Info into Nagios Ready Configuration Files $VMInfo = Get-Cluster "BladeServers" | get-vm | Select Name, @{N="IP Address";E={@($_.guest.IPAddress[0])}},PowerState New-Item c:\temp\windowsVms.cfg -ItemType file foreach ($vm in $VMInfo){ $os = get-vm $vm