Category Archives: PowerShell

New article on PowerShell Magazine: Verify Active Directory account credentials using System.DirectoryServices.DirectoryEntry

The article posted on PowerShell Magazine provides an easy example that allows for verification of Active Directory credentials using the System.DirectoryServices.DirectoryEntry class. The full article is available on PowerShell Magazine:

http://www.powershellmagazine.com/2013/05/21/pstip-verify-active-directory-account-credentials-using-system-directoryservices-directoryentry/

New article on PowerShell Magazine: Working with the Windows.Forms.Screen Class

The article posted on PowerShell Magazine explains how to utilize the Windows.Forms.Screen Class in order to determine the resolution of the monitors attached to the current system. It can also be used to determine the location of the monitors relative to each other. This can be useful when working with Windows Forms in PowerShell.

To read the full article head over to PowerShell Magazine:

http://www.powershellmagazine.com/2013/05/09/pstip-working-with-the-windows-forms-screen-class/

New article on PowerShell Magazine: List all AD attributes currently in use for AD users

The article posted on PowerShell Magazine explains how to list all AD properties that have a value for all Active Directory user accounts. To read to full article head over to PowerShell Magazine:

http://www.powershellmagazine.com/2013/05/06/pstip-list-all-ad-attributes-currently-in-use-for-ad-users/

Geolocate an IP Address from PowerShell

PowerShell.com recently published a tip, Identifying Origin of IP Address, that allows you to get the country of an IP Address. Seeing how this was built I decide to write a similar function that gathers a bit more information. The function provides information about the IP,Country,City and actual Latitude and Longtitude of an IP Address as provided by http://freegeoip.net.

Function Get-GeoIP {
param (
    [string]$IP 
)
    ([xml](Invoke-WebRequest "http://freegeoip.net/xml/$IP").Content).Response
}

The function takes an IP address as input and uses this to gather the results in XML-format from the freegeoip.net website. This output is then presented to PowerShell as an Xml element. The output can also be filtered using the Select-Object Cmdlet.

New article on PowerShell Magazine: Working with a Uniform Resource Identifier (URI) in PowerShell

The article explains how the [System.Uri] .Net class can be used to manipulate URIs and to convert them into objects. For more information on this topic please have a look at the article that has been posted on PowerShell Magazine:

http://www.powershellmagazine.com/2012/12/24/pstip-working-with-a-uniform-resource-identifier-uri-in-powershell/