PowerShell Inventory Operating Systems in Active Directory

PowerShell Inventory KB ID 0001838

Problem

I needed to get a list of operating systems  ‘in-use‘ in my active directory this week. bear in mind this will pull information from all enables computer accounts in AD, so if you are ‘not good‘ at tidying out old machines and servers you might get a lot of garbage in your output!

Solution: PowerShell Inventory

Use the following PowerShell.

[box]

Get-ADComputer -Filter 'enabled -eq "true"' `
-Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address |
Sort-Object -Property Operatingsystem |
Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address

[/box]

All being well, your output should look something like this.

If you wanted to output that information to CSV then use the following.

[box]

Get-ADComputer -Filter 'enabled -eq "true"' `
-Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address |
Sort-Object -Property Operatingsystem |
Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address |
Export-Csv -Path “C:\Temp\AD-Operating-Systems.csv” -NoTypeInformation

[/box]

If you wanted to output that information to HTML then use the following.

[box]

Get-ADComputer -Filter 'enabled -eq "true"' `
-Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address |
Sort-Object -Property Operatingsystem |
Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address |
ConvertTo-Html | Out-File C:\Temp\AD-Operating-Systems.htm

[/box]

Related Articles, References, Credits, or External Links

NA

FortiGate Securing Remote Administration

KB ID 0001734

Problem

When considering Securing FortiGate  remote administration, I’ve written about changing the https management port to something other than TCP 443 before, I suppose that’s security by obfuscation (though even a script kiddy with one hours experience, will be able to spot an html responses).  Typically with other vendors you limit remote administration access, to specific IP addresses (or ranges). So how to do the same in Fortigate?

FortiGate Trusted Hosts

With FortiGate the approach is slightly different, (to Cisco anyway) in that, you allow access from ‘Trusted Hosts‘ and you do that ‘Per Administrator’ not for the entire remote access solution (like HTTPS or SSH). On reflection I like this, because by default you will have a user called ‘admin’ and an attacker will ‘possibly’ know that. With FortiGate you can restrict the admin account so it can only log on from inside, or from management hosts/networks or from an Out of Band management network.

You can also give an administrative password to one partner and only allow access from that partner’s public IP/Range, or if like my firm we need to support a lot of firewalls we can hard code this into our default deployments and retain remote administration. (Though FortiManager is the direction you want to be headed in, for that!)

Configure FortiGate ‘Per Administrator’ Trusted Hosts.

System > Administrators > Create New > Administrator.

Create a username/password > Select the admin level required > Enable ‘Restrict Login to Trusted Hosts’

Here’s an example where the admin account can only manage the firewall form the 192.168.1.0/24 network, and a management host 192.168.2100.3 For ‘external‘ access I’ve got a new administrator, who can get access from my management host, (for belt and braces), a single public network, and a public IP address.

Related Articles, References, Credits, or External Links

NA

Internet Explorer Puts ‘Borders’ Round Your Images

KB ID 0000823 

Problem

Chrome is my browser of choice, so I don’t look at my website with IE often. (Yes I know that’s bad practice for a webmaster). So I was surprised when I opened my home page and saw this.

IE does this IF your image is a hyperlink.

Solution

Option 1: Edit your Hyperlink

If you have a lot of them this is quite time consuming, but you can add the attribute of border and set it to zero within the IMG section of your hyperlink like so;

Option 2: Edit your CSS

This would be the preferred option, because you make one change and it will effect all your images. Simply add the following commands to your CSS.

Fixed!

Related Articles, References, Credits, or External Links

NA

WSUS Error – ‘An HTTP error has occurred’

KB ID 0000796 

Problem

Seen on SBS 2011 and Server 2008 R2. When running the WSUS configuration wizard, at the ‘Connect to Upstream Server’ page, connection fails;

An HTTP error occurred Details…

When viewing details you see;

WebExpeption: The request failed with the error message:
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href-“%2fmicrosoftupdate%2fv6ferrorinformation.aspx%3ferrror%3d15”>here</a>.</h2>
</body></html>

Well that’s great, thanks for that?

Solution

1. Nice easy one to fix, download and install this update.

2. In my case it asked for a reboot post install, however if yours does not, I would restart the server and try again. Post reboot it worked fine.

Related Articles, References, Credits, or External Links

NA