how to see whats in the variable System.DirectoryServices.ActiveDirectory.Active

How do I get what’s inside this variable?


So far I did:

“c:\windows\system32\windowspowershell\v1.0\powershell.exe” -command “& {Get-ADReplicationConnection }”

and one of the lines it gave is:

ReplicationSchedule : System.DirectoryServices.ActiveDirectory.ActiveDirectorySchedule


How do I get the ReplicationSchedule out of System.DirectoryServices.ActiveDirectory.ActiveDirectorySchedule




I don’t have access to my ActiveDirectory environment to test, but try this.


This …


… is not a variable, this is a .Net namespace…

System.DirectoryServices namespace provides an ADSI wrapper for programmatic access to Active Directory. In PowerShell this is wrapped even further by the provision of the [ADSI] constructor. This namespace is used to administer the data held within Active Directory e.g. Users, groups computers etc.

… you’d use to get information to put into a variable to work with later.

As pointed to in the other response… this…


…can be used instead. What you get back is the properties of the request that has info in them.

Did you look at the help files on your system or online…
... and those samples to determine your use case?

As well as the other article resources on what gets returned.

What you are seeing is the property from that command and the results in that property. So, if you take you variable thought process, this…


… is the variable and this …


… is what’s in it. Yet, again, that is a proper property, not a $Variable you created.

There are scripts/modules on the MS that you can use as-is or teak as needed to get at this sort of info.