{"id":3719,"date":"2017-08-11T07:59:39","date_gmt":"2017-08-11T11:59:39","guid":{"rendered":"https:\/\/adsecurity.org\/?p=3719"},"modified":"2017-08-11T16:26:22","modified_gmt":"2017-08-11T20:26:22","slug":"gathering-ad-data-with-the-active-directory-powershell-module","status":"publish","type":"post","link":"https:\/\/adsecurity.org\/?p=3719","title":{"rendered":"Gathering AD Data with the Active Directory PowerShell Module"},"content":{"rendered":"<p>Microsoft provided several Active Directory PowerShell cmdlets with Windows Server 2008 R2 (and newer) which greatly simplify tasks which previously required putting together lengthy lines of code involving ADSI.<\/p>\n<p>On a Windows client, install the <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=45520\">Remote Sever Administration Tools (RSAT)<\/a> and ensure the Active Directory PowerShell module is installed.<\/p>\n<p>On a Windows server (2008 R2 or newer), run the following commands in a PowerShell console (as an Adminsitrator):<\/p>\n<p><strong><em>Import-Module ServerManager ;\u00a0Add-WindowsFeature RSAT-AD-PowerShell<\/em><\/strong><\/p>\n<p>Here&#8217;s my (poor) ADSI example:<\/p>\n<pre>$UserID = \u201cJoeUser\u201d\r\n$root = [ADSI]''\r\n$searcher = new-object System.DirectoryServices.DirectorySearcher($root)\r\n$searcher.filter = \"(&amp;(objectClass=user)(sAMAccountName= $UserID))\"\r\n$user = $searcher.findall()\r\n$user<\/pre>\n<p>Here&#8217;s the same thing with the AD PowerShell cmdlet:<\/p>\n<p><em>Import-module ActiveDirectory<\/em><br \/>\n<em>$UserID = \u201cJoeUser\u201d<\/em><br \/>\n<em>Get-ADUser $UserID \u2013property *<\/em><\/p>\n<p>Note that with PowerShell version 3 and newer, you don&#8217;t need to run the first line since Powershell will identify the necessary module and auto load it.<\/p>\n<p>Once you have the Active Directory PowerShell module loaded, you can do cool stuff like browse AD like a file system<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3720\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/AD-Drive-Usage.png\" alt=\"\" width=\"690\" height=\"399\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/AD-Drive-Usage.png 800w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/AD-Drive-Usage-300x174.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/AD-Drive-Usage-768x444.png 768w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Finding Useful Commands (Cmdlets):<\/strong><\/span><\/p>\n<p>Discover available PowerShell modules: <strong>Get-Module -ListAvailable<\/strong><\/p>\n<p>Discover cmdlets in a PowerShell module:\u00a0<strong>Get-Command -module ActiveDirectory<\/strong><\/p>\n<p><span style=\"text-decoration: underline;\">\u00a0PowerShell AD Module Cmdlets:<\/span><\/p>\n<ul>\n<li>Windows Server 2008 R2: 76 cmdlets<\/li>\n<li>Windows Server 2012: 135 cmdlets<\/li>\n<li>Windows Server 2012 R2: 147 cmdlets<\/li>\n<li>Windows Server 2016:\u00a0147 cmdlets<\/li>\n<\/ul>\n<pre><strong>(Get-Command -module ActiveDirectory).count<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Finding Active Directory Flexible Master Single Operation (FSMO) Roles:<\/strong><\/span><\/p>\n<p><strong>Active Directory Module:<\/strong><\/p>\n<ul>\n<li>\n<pre>(Get-ADForest).SchemaMaster<\/pre>\n<\/li>\n<li>\n<pre>(Get-ADForest).DomainNamingMaster<\/pre>\n<\/li>\n<li>\n<pre>(Get-ADDomain).InfrastructureMaster<\/pre>\n<\/li>\n<li>\n<pre>(Get-ADDomain).PDCEmulator<\/pre>\n<\/li>\n<li>\n<pre>(Get-ADDomain).RIDMaster\r\n\r\n<\/pre>\n<\/li>\n<\/ul>\n<p><strong>.NET Calls:<\/strong><\/p>\n<ul>\n<li>\n<pre>([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).SchemaRoleOwner<\/pre>\n<\/li>\n<li>\n<pre>([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).NamingRoleOwner<\/pre>\n<\/li>\n<li>\n<pre>([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).InfrastructureRoleOwner<\/pre>\n<\/li>\n<li>\n<pre>([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).PdcRoleOwner<\/pre>\n<\/li>\n<li>\n<pre>([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).RidRoleOwner<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Active Directory PowerShell Module Cmdlet Examples:<\/strong><\/span><\/p>\n<p><!--more--><\/p>\n<p><strong>Get-RootDSE<\/strong> gets information about the LDAP server (the Domain Controller) and displays it. There&#8217;s some interesting information in the results like what OS the DC is running.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3721\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADRootDSE.png\" alt=\"\" width=\"1287\" height=\"602\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADRootDSE.png 1287w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADRootDSE-300x140.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADRootDSE-768x359.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADRootDSE-1024x479.png 1024w\" sizes=\"auto, (max-width: 1287px) 100vw, 1287px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADForest<\/strong> provides information about the Active Directory forest the computer you run the command is in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3722\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADForest.png\" alt=\"\" width=\"1400\" height=\"362\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADForest.png 1400w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADForest-300x78.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADForest-768x199.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADForest-1024x265.png 1024w\" sizes=\"auto, (max-width: 1400px) 100vw, 1400px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADDomain<\/strong> provides information about the current domain you are in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3724\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomain.png\" alt=\"\" width=\"1149\" height=\"587\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomain.png 1149w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomain-300x153.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomain-768x392.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomain-1024x523.png 1024w\" sizes=\"auto, (max-width: 1149px) 100vw, 1149px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADDomainController<\/strong> provides computer information specific to Domain Controllers.<br \/>\nThis cmdlet makes it easy to find all DCs in a specific site or running an OS version.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3725\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomainController.png\" alt=\"\" width=\"1363\" height=\"554\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomainController.png 1363w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomainController-300x122.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomainController-768x312.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADDomainController-1024x416.png 1024w\" sizes=\"auto, (max-width: 1363px) 100vw, 1363px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADComputer<\/strong> provides most of what you would want to know about a computer object in AD.<br \/>\n<em>Run with &#8220;-Prop *&#8221; to show all standard properties.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3726\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADComputer.png\" alt=\"\" width=\"669\" height=\"211\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADComputer.png 1260w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADComputer-300x95.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADComputer-768x242.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADComputer-1024x323.png 1024w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADUser<\/strong> provides most of what you want to know about an AD user.<br \/>\n<em>Run with &#8220;-Prop *&#8221; to show all standard properties.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3727\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADUser.png\" alt=\"\" width=\"576\" height=\"234\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADUser.png 1183w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADUser-300x122.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADUser-768x312.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADUser-1024x415.png 1024w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADGroup<\/strong> provides information about an AD group. Find all security groups by running:<br \/>\n<em>Get-ADGroup -Filter {GroupCategory -eq &#8216;Security}<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3729\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroup.png\" alt=\"\" width=\"658\" height=\"206\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroup.png 1286w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroup-300x94.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroup-768x241.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroup-1024x321.png 1024w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADGroupMember<\/strong> enumerates and returns the group members. Use the Recursive parameter to include all members of nested groups.<br \/>\n<em>Get-ADGroupMember &#8216;Administrators&#8217; -Recursive<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3730\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroupMember.png\" alt=\"\" width=\"669\" height=\"542\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroupMember.png 782w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroupMember-300x243.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADGroupMember-768x623.png 768w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>These cmdlets are useful to identify situations that previously required purchasing a product or custom scripting.<\/p>\n<p>The following examples find inactive (stale) computers and users &#8211; accounts that haven&#8217;t changed their passwords in the last 10 days. Note that this is a lab example. For real-world checks, change this to 60 to 90 days for computers and 180 &#8211; 365 days for users.<\/p>\n<p><strong>Find inactive computers.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3731\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Computers.png\" alt=\"\" width=\"1357\" height=\"367\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Computers.png 1357w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Computers-300x81.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Computers-768x208.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Computers-1024x277.png 1024w\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" \/><\/p>\n<p><strong>Find inactive users.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3732\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Users.png\" alt=\"\" width=\"1174\" height=\"606\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Users.png 1174w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Users-300x155.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Users-768x396.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Finding-Inactive-Users-1024x529.png 1024w\" sizes=\"auto, (max-width: 1174px) 100vw, 1174px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Enumerate Domain Trusts<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3733\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Enumerate-Domain-Trusts.png\" alt=\"\" width=\"1383\" height=\"224\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Enumerate-Domain-Trusts.png 1383w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Enumerate-Domain-Trusts-300x49.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Enumerate-Domain-Trusts-768x124.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Enumerate-Domain-Trusts-1024x166.png 1024w\" sizes=\"auto, (max-width: 1383px) 100vw, 1383px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get AD site information.<\/strong><br \/>\nNote that the Windows 2012 module includes cmdlet for sites (<a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/hh852269(v=wps.630).aspx\">Get-ADReplicationSite<\/a>*).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3734\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADSites.png\" alt=\"\" width=\"1358\" height=\"257\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADSites.png 1358w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADSites-300x57.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADSites-768x145.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADSites-1024x194.png 1024w\" sizes=\"auto, (max-width: 1358px) 100vw, 1358px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Backup domain GPOs<\/strong><br \/>\nNote this requires that the Group Policy PowerShell module is installed, which is separate from the Active Directory module.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3735\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Backup-GPOs.png\" alt=\"\" width=\"1165\" height=\"366\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Backup-GPOs.png 1165w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Backup-GPOs-300x94.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Backup-GPOs-768x241.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Backup-GPOs-1024x322.png 1024w\" sizes=\"auto, (max-width: 1165px) 100vw, 1165px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Find AD Kerberos Service Accounts<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3736\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Find-AD-Kerberos-Service-Accounts.png\" alt=\"\" width=\"903\" height=\"634\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Find-AD-Kerberos-Service-Accounts.png 903w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Find-AD-Kerberos-Service-Accounts-300x211.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Find-AD-Kerberos-Service-Accounts-768x539.png 768w\" sizes=\"auto, (max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Inventory Domain Controllers<br \/>\n<\/strong>Get-ADDomainController\u2013filter * | `select hostname,IPv4Address,IsGlobalCatalog,IsReadOnly,OperatingSystem | `format-table -auto<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3737\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/DC-Inventory.png\" alt=\"\" width=\"774\" height=\"69\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/DC-Inventory.png 774w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/DC-Inventory-300x27.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/DC-Inventory-768x68.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADReplicationPartnerMetadata <\/strong>(Windows Server 2012 and newer)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3738\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationPartnerMetadata.png\" alt=\"\" width=\"1366\" height=\"513\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationPartnerMetadata.png 1366w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationPartnerMetadata-300x113.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationPartnerMetadata-768x288.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationPartnerMetadata-1024x385.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADReplicationPartnerFailure<\/strong> provides information on DC replication failure status.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3739\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationFailure.png\" alt=\"\" width=\"1380\" height=\"208\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationFailure.png 1380w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationFailure-300x45.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationFailure-768x116.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationFailure-1024x154.png 1024w\" sizes=\"auto, (max-width: 1380px) 100vw, 1380px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Get-ADReplicationUptodatenessVectorTable<\/strong> tracks replication status between Domain Controllers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3740\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationUTDV.png\" alt=\"\" width=\"1376\" height=\"374\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationUTDV.png 1376w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationUTDV-300x82.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationUTDV-768x209.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2017\/08\/Get-ADReplicationUTDV-1024x278.png 1024w\" sizes=\"auto, (max-width: 1376px) 100vw, 1376px\" \/><\/p>\n<p>These examples and more are in these presentation slides:<br \/>\n<a href=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2015\/04\/NoVaPowerShellUsersGroup2015-ActiveDirectoryPowerShell.pdf\">http:\/\/adsecurity.org\/wp-content\/uploads\/2015\/04\/NoVaPowerShellUsersGroup2015-ActiveDirectoryPowerShell.pdf<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft provided several Active Directory PowerShell cmdlets with Windows Server 2008 R2 (and newer) which greatly simplify tasks which previously required putting together lengthy lines of code involving ADSI. On a Windows client, install the Remote Sever Administration Tools (RSAT) and ensure the Active Directory PowerShell module is installed. On a Windows server (2008 R2 &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/adsecurity.org\/?p=3719\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":3721,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,2],"tags":[1248,1266,1249,1250,1252,223,1268,1265,1269,1255,1267,1260,1258,1259,1257,1262,1244,1272,1271,1273,1261,1254,1253,1256,1251,1270,575,1263,1264],"class_list":["post-3719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","category-technical-reference","tag-active-directory-powershell-module","tag-active-directory-trusts","tag-ad-cmdlets","tag-ad-powershell-cmdlets","tag-add-windowsfeature-rsat-ad-powershell","tag-adsi","tag-backup-domain-gpos","tag-enumerate-domain-trusts","tag-find-ad-kerberos-service-accounts","tag-finding-active-directory-flexible-master-single-operation-fsmo-roles","tag-get-ad-site-information","tag-get-adcomputer","tag-get-addomain","tag-get-addomaincontroller","tag-get-adforest","tag-get-adgroup","tag-get-adgroupmember","tag-get-adreplicationpartnerfailure","tag-get-adreplicationpartnermetadata","tag-get-adreplicationuptodatenessvectortable","tag-get-aduser","tag-get-command-module-activedirectory","tag-get-module-listavailable","tag-get-rootdse","tag-import-module-servermanager","tag-inventory-domain-controllers","tag-powershell","tag-powershell-find-inactive-computers","tag-powershell-find-inactive-users","item-wrap"],"_links":{"self":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/3719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3719"}],"version-history":[{"count":6,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/3719\/revisions"}],"predecessor-version":[{"id":3745,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/3719\/revisions\/3745"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/media\/3721"}],"wp:attachment":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}