Skip to main content

Posts

Use PowerShell to get BING Map Quadkeys

I spent part of my day trying to decipher how to ask BING for map tiles from its database. You can find a lot of useful information at Bing Maps Tile System . I’m plucking through the logic of how BING handles maps for a project that I am working on.  One of the mysteries is how to calculate a tile based on the zoom level and location.  I am not going to go through the specifics of how this works.  You can read the reference article for that.  My objective was to feed a function the X and Y location values and zoom level and get the Quadkey value back.  This is not going to be a stand alone function, but inside other code. Here it is.   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Function ConvertQuadKeyTo-String { Param (     $ZoomLevel = 3 ,     $TileX = "3" ,   ...

How to Hide a Mailbox from Exchange’s Global Address List

Good thing I fired up an Exchange server this week’s for my PowerShell class.  Here is a quick answer to a problem one of the my class attendees had.  How to hide someone from the Global Address List (GAL) using PowerShell.  In the Exchange Admin Center, you can configure this in the user’s mailbox general properties. We had a discussion about what is in the GUI and what is in PowerShell. The direction that Microsoft is moving is a GUI free environment, at least on the servers.  PowerShell is designed to do what the GUI can, and cannot do.  We simply need to find the path.  Fortunately, the path to success on this one was simple. 1 2 Get-Mailbox -Identity jyoder | Set-Mailbox -HiddenFromAddressListsEnabled $True Line 1 will get the mailbox object of the user in question and pipe the object to line 2. Line 2 uses the Set-Mailbox cmdlet and it’s HiddenFromAddressListEnabled property.  When set to $True, the address is hidden.  Let...

Listing Public Folder Permissions with PowerShell

We started off class this morning in a Q&A session.  One of the questions was how to get the public folder permissions on an Exchange Server.  In this example, Exchange Server 2013 is being used. 1 2 Get-PublicFolder -Recurse |     Get-PublicFolderClientPermission Line 1 Gathers all of the Public folder objects, including subfolders. Line 2 Gathers the user rights on each public folder and then displays them FolderName            User                  AccessRights                                                       ----------     ...

Accuracy problem with System.Double and System.Single

So, what do I do while my class is working on labs?  Well, if I’m not answer emails from the Navy, I’m working on some side projects.  Right now, I’m working on a project to grab meta data via geographical coordinates. When I develop code, I brake the objective down into manageable parts.  I then look at each part and ask myself if I know how to do it.  For each part that I do not know how, I start writing code to discover the path to success. Well, while working on a bit of code, I needed to increment my value for latitude by .05.  Something odd happened so I wrote out a small bit of code to focus in on the issue.  Here is the code. $Increment = .05 $Start = 0 $Value2 = $Start   While ( $Value2 -lt 10 ) {     Write-host $Value2     $Value2 += $Increment } The data type of $Value2 is Double .  Everything starts out fine. 0 0.05 0.1 0.15 0.2 Until… 3.45 3.5 3.55 3.6 3.65 3.6999999999...