<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Audit &#8211; Trent Steenholdt&#039;s Blog</title>
	<atom:link href="https://blog.cortanadesign.com.au/tag/audit/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.cortanadesign.com.au</link>
	<description>A simple blog detailing all my findings, interests and work in the Information Technology industry. </description>
	<lastBuildDate>Fri, 08 May 2015 11:50:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.1</generator>
<site xmlns="com-wordpress:feed-additions:1">67701496</site>	<item>
		<title>Audit Active Directory quick and dirty. Find all administrators, disabled users and lastlogin (UTC)</title>
		<link>https://blog.cortanadesign.com.au/2014/02/22/audit-active-directory-quick-and-dirty-find-all-administrators-disabled-users-and-lastlogin-utc/</link>
		
		<dc:creator><![CDATA[Trent Steenholdt]]></dc:creator>
		<pubDate>Fri, 21 Feb 2014 17:00:38 +0000</pubDate>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[Audit]]></category>
		<guid isPermaLink="false">https://blog.cortanadesign.com.au/?p=110</guid>

					<description><![CDATA[I had the need today to do a quick audit of Active Directory and see where it was at for a client. Not just the norm like dcdiag.exe,&#160;repadmin&#160;and checking the Event Viewer to see if there were any&#160;issues&#160;but also how many administrators there are, who is disabled (if any as I had my doubts)&#160;and the &#8230; <a href="https://blog.cortanadesign.com.au/2014/02/22/audit-active-directory-quick-and-dirty-find-all-administrators-disabled-users-and-lastlogin-utc/" class="more-link">Continue reading <span class="screen-reader-text">Audit Active Directory quick and dirty. Find all administrators, disabled users and lastlogin (UTC)</span></a>]]></description>
										<content:encoded><![CDATA[<p>
	I had the need today to do a quick audit of Active Directory and see where it was at for a client. Not just the norm like <strong>dcdiag.exe,&nbsp;repadmin&nbsp;</strong>and checking the Event Viewer to see if there were any&nbsp;issues&nbsp;but also how many administrators there are, who is disabled (if any as I had my doubts)&nbsp;and the last last login for each user. PowerShell to the rescue.&nbsp;
</p>
<pre>
if ((Get-Module -Name ActiveDirectory) -eq $nul) { Import-Module ActiveDirectory }

$admins = Get-ADGroupMember -Identity &quot;Administrators&quot; -Recursive
$admins += Get-ADGroupMember -Identity &quot;Domain Admins&quot; -Recursive
$admins += Get-ADGroupMember -Identity &quot;Enterprise Admins&quot; -Recursive

Write-Host &quot;Administrative accounts&quot; -ForegroundColor Green
foreach ($admin in ($admins | Sort-Object -Property sAMAccountName -Unique)) { if ($admin.objectClass -eq &quot;user&quot;) {Write-Host $admin.sAMAccountName} }


Write-Host &quot;Disabled users&quot; -ForegroundColor Green
foreach ($user in (Get-ADUser -Filter {Enabled -eq $false} | Sort-Object -Property sAMAccountName)) { Write-Host $user.sAMAccountName }

# I&#39;d STRONGLY recommend using the -SearchBase parameter to reduce query load if at all possible
Write-Host &quot;Last logon times (UTC)&quot; -ForegroundColor Green
foreach ($user in (Get-ADUser -Filter * -Property lastLogonTimestamp | Sort-Object -Property sAMAccountName)) { if ($user.lastLogonTimestamp -eq $null) {$dt = &#39;&#39;} else { $dt = [datetime]$user.lastLogonTimestamp }; Write-Output($user.sAMAccountName +&quot;,&quot;+ $dt) | Write-Host }
</pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">110</post-id>	</item>
	</channel>
</rss>
