Accessing Performance Counter (for OCS A/V Edge Servers)

OCS A/V Edge servers are somewhat wierd critters.  One interface is load balanced, the other is accessed only by the trusted server list.  The Load Balancer should be able to display the number of connections, but what about the internal interface?  Say, we need to perform maintenance on an A/V Edge Server but want to…

0

Batch-Unzipping Files

Thanks to http://serverfault.com/questions/18872/how-to-zip-unzip-files-in-powershell/201604#201604 for the core code. Here’s a function to unzip files, with rudimentary error handling, and ability to specify source and destination from the command line.  It also brute-forces the “overwrite flag fails on pre-Win7” issue by allowing -force to unzip to a temp folder, then moves the contents of that folder forcibly over the…

0

Displaying an OCS Proxy Server’s List of Trusted Servers

Yesterday, we covered how to dump an OCS Edge Server’s list of trusted servers, including using PSExec.exe as a workaround to it not exposing the list over remote WMI calls. It turns out the OCS Proxy Server uses a different WMI path, but it can be called remotely.     $internal = Get-WmiObject -Query ‘SELECT *…

0

Displaying an OCS Access Edge Server’s List of Trusted Servers

Office Communications Server’s Access Edge Servers and MediaRelay roles have a list of hosts they allow to connect on the internal interface.  This is managed by the an administrative GUI accessed under ComputerManagement.   GUIs are great for discoverability (if they’re well-written, which this one isn’t), but horrible for automation.  This a problem when we talk…

0

Certificates Owned by a Service

PowerShell gives you access to certificates in many ways.  You can read it in from a file, or look at it via the certificate: PsProvider, or, use .NET to open [System.Microsoft.Win32.RegistryKey] object.  However, these don’t tell the whole story.  It turns out services can ‘own’ certificates as well.  In mmc.exe, add the Certificates Snap-in, and…

0

Hash to Arrayof Objects

As an old-time Perl user, I love hashes.  In Perl, hashes are the answer, no matter what the question is.  (No, not really, but they solve a lot of problems.)  In PowerShell, hashes are cool, but you can’t do things like “Sort-Object -property value”. Here’s a quick-and-dirty way to convert a hash into an array…

0

Propagating Default Options

Let’s say I have a function that takes parameters, which all well-written ones should.  And they have intelligent defaults, again as well-written ones should.  The outer script exposes those parameters via the outer param() statement, but how do I pass them into the script?    param ($foo = $null); function Test-It {    param ($foo = $(…

0

No Reply All

Short form: Go here http://research.microsoft.com/en-us/projects/researchdesktop/noreplyall.aspx Longer form: Outlook/Exchange, like so many other products, has some ‘undocumented features’, including a one-bit flag that allows reply-all or not.  This helpful download from Microsoft Research exposes that control.  

0

Heavyweight Help in V1

Again, in V1 PSH, this is what I use for nicely formatted help.  If you’re on V2, by all means, use the inline help, PLEASE! function Break-Line {    # synopsis::    # [-help]    #    # Description::    # Inserts linefeeds into strings read from STDIN so they wrap nicely    # for a given PowerShell window’s screen geometry   …

0

Quick and Dirty Help

I like writing help text for my scripts.  Yes, PSH V2 allows Get-Help to parse the inline help in scripts, but I’m stuck in V1 for my production environment.  For quick-and-dirty scripts where I don’t want to implement a ‘real’ help subsystem, I use the following:     if ($help) {        $functionName = (Get-Variable MyInvocation -Scope…

0