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

Welcome Forums General PowerShell Q&A how to see whats in the variable System.DirectoryServices.ActiveDirectory.Active

Viewing 2 reply threads
  • Author
    • #205785
      Topics: 2
      Replies: 0
      Points: 27
      Rank: Member

      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




    • #205797
      Topics: 5
      Replies: 349
      Points: 632
      Helping Hand
      Rank: Major Contributor

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

    • #206109
      Topics: 2
      Replies: 1014
      Points: 2,105
      Helping Hand
      Rank: Community Hero

      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.



Viewing 2 reply threads
  • The topic ‘how to see whats in the variable System.DirectoryServices.ActiveDirectory.Active’ is closed to new replies.