The script gets the path of the configuration context of your Active Directory, finds the policies container, then lists the policies, displays the distinguished name (DN), policy type, and the policy content.
$configurationContainer = ([adsi] "LDAP://RootDSE").Get("ConfigurationNamingContext") $policyContainer = [adsi] "LDAP://CN=Policies,CN=RTC Service,CN=Services,$configurationContainer" $policies = $policyContainer.psbase.children foreach($policy in $policies) { $content=([xml] $policy.Get("msrtcsip-policycontent")).instance.property $policyType=$policy.Get("msrtcsip-policyType") $dn=$policy.distinguishedName "--------------------------------------------------------------------" "" "DN: $dn" "Policy Type: $policyType" $content ¦ ft }
Another OCS scripting example brought to you by ITAdminTools.com!
No comments:
Post a Comment