PowerShell for Windows Admins:

Active Directory


February 6, 2012  6:28 AM

Inbound replication



Posted by: Richard Siddaway
Active Directory, PowerShell, WMI

Continuing round the MicrosoftActiveDirectory namespace we get to the MSAD_ReplCursor class which provides inbound replication state information about all replicas of a Naming Context

 

Get-WmiObject -Namespace root\MicrosoftActiveDirectory -Class MSAD_ReplCursor  | ...

February 6, 2012  5:00 AM

Automating replication testing



Posted by: Richard Siddaway
Active Directory, PowerShell

Building on the recent post about testing replication I though a bit more automation was needed. Lets create a function to discover the domain controllers

function get-DomainControllerNames 
				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


February 5, 2012  2:06 PM

Testing replication



Posted by: Richard Siddaway
Active Directory, PowerShell, WMI

We’ve seen a few things we can do with the WMI provider for Active Directory. One of the most useful is testing replication

function test-replication{            
			


January 28, 2012  2:51 PM

Naming Contexts



Posted by: Richard Siddaway
Active Directory, PowerShell, WMI

Continuing our quick look at The ActiveDirectory name space lets have a look at the MSAD_NamingContext  class

Get-WmiObject -Namespace root\MicrosoftActiveDirectory -Class MSAD_NamingContext |

Format-Table DistinguishedName, IsFullReplica –AutoSize

 

...


January 28, 2012  10:20 AM

Active Directory and WMI



Posted by: Richard Siddaway
Active Directory, PowerShell v2, WMI

A lot of the Active Directory related functionality has been removed from WMI but  there is a little bit left in the root\MicrosoftActiveDirectory namespace.

This is on a Windows 2008 R2 domain controller – I don’t know if this is available on down level versions of Windows.

...


September 6, 2011  11:29 AM

Test for domain membership



Posted by: Richard Siddaway
Active Directory, PowerShell v2, WMI

Quick function to determine if a given machine is in a domain or workgroup

function test-domain{             
[
				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


September 5, 2011  12:33 PM

Find the Time Server



Posted by: Richard Siddaway
Active Directory, PowerShell v2, Registry, WMI

No its not the latest Internet game.

Active Directory synchronises the computer clock times. To know what server is being used

function get-timeserver{             
			


September 4, 2011  12:16 PM

Clearing AD logging



Posted by: Richard Siddaway
Active Directory, PowerShell v2, WMI

Last time we looked at turning on logging – for one or more criteria. The normal state of diagnostic logging is None i.e. the options are set to zero. If we have only a few options set we can use set-logsetting to revert to no logging. Alternatively we can reset all logging to a zero state

...


September 4, 2011  3:32 AM

Setting AD logging



Posted by: Richard Siddaway
Active Directory, PowerShell v2, WMI

Now that we know what the options are we can look at switching them on.

function set-logsetting{             
[
				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


September 3, 2011  1:31 PM

Logging options



Posted by: Richard Siddaway
Active Directory, PowerShell v2, WMI

With 24 logging options to choose from its difficult to keep track of them. We already have the data in a ash table so lets just display it

function get-logsettingoptions{       ...