This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Snippet.Helpers.Timezone | |
{ | |
/// <summary> | |
/// Class TimeZoneHelper. | |
/// </summary> | |
public static class TimeZoneHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.DirectoryServices | |
/// Gets a user's thumbnail photo from active directory. Returns null if no image found. | |
let ActiveDirectoryImageFor(samAccount:string):byte[] = | |
use adSearcher = new DirectorySearcher() | |
adSearcher.Filter <- "(&(objectClass=user) (sAMAccountName=" + samAccount + "))" | |
let adResult = adSearcher.FindOne() | |
if adResult = null | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (-not (Test-Path -Path "C:\\certs\\win-acme")) { | |
$url = "https://github.com/win-acme/win-acme/releases/download/v2.1.7/win-acme.v2.1.7.807.x64.pluggable.zip" | |
$output = "C:\\certs\\win-acme.zip" | |
Invoke-WebRequest -Uri $url -OutFile $output | |
Expand-Archive "C:\\certs\\win-acme.zip" -DestinationPath "C:\\certs\\win-acme" | |
} | |
cd "C:\\certs\\win-acme" |