Skip to content

Instantly share code, notes, and snippets.

View normansolutions's full-sized avatar

Clive Norman normansolutions

View GitHub Profile
namespace CreateADGroups
{
class Program
{
static void Main(string[] args)
{
string activeDirPath = args[0];
string activeDirOU = args[1];
string usersLocation = args[2];
string filterIn = args[3];
C:\SCHEDULE\SBGroups\CreateADGroups.exe "DC=St-Stephens, DC=Local" "OU=SBGroups" "OU=Students, OU=St Stephens Users" "Art|Photo" "UCAS"
@normansolutions
normansolutions / DisableRDPonAD.ps1
Last active August 29, 2015 13:56
For use on blog post: http://www.normansolutions.co.uk/post/PowerShell to secure AD users RDP access
Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
Get-QADUser * -OrganizationalUnit "ou=Your Sub-OU,ou=Your OU,dc=Your LDAP,dc=Your LDAP" |
?{$_.TsAllowLogon -ne $true} |
Set-QADUser -TsAllowLogon $true
CREATE VIEW DBA_RandSView
AS
SELECT TOP (100) PERCENT Sanctions.Sanction
,Pupil.Pu_Surname
,Pupil.Pu_GivenName
,Years.YearDesc
,PupSanction.PupSanDate
,PupSanction.PupSanCount
,PupSanction.PupNewNote
,Staff.UserName
#cookie-bar .cb-enable {
background: $greenDarkening10;
}
#cookie-bar .cb-enable:hover {
background: $green;
}
#cookie-bar .cb-disable {
background: $red;
//Colour Lightening 10%
$blueLighten10:lighten( $blue, 10% );
$redLighten10:lighten( $red, 10% );
$greenLighten10:lighten( $green, 10% );
//Colour Darkening 10%
$blueDarkening10:darken( $blue, 10% );
$redDarkening10:darken( $red, 10% );
$greenDarkening10:darken( $green, 10% );
public static string FingerPrint(string rootRelativePath, string cdnPath = "")
{
if (!string.IsNullOrEmpty(cdnPath) && !HttpContext.Current.IsDebuggingEnabled)
{
return cdnPath;
}
if (HttpRuntime.Cache[rootRelativePath] == null)
{
string relative = VirtualPathUtility.ToAbsolute("~" + rootRelativePath);
string absolute = HostingEnvironment.MapPath(relative);
<rules>
<rule name="fingerprint" stopProcessing="true">
<match url="(.*)(v-[0-9]+/)([\S]+)"/>
<action type="Rewrite" url="{R:1}/{R:3}"/>
</rule>
</rules>
<link rel="stylesheet" href="@CacheBust.FingerPrint("/css/mainStyle.css")" />
<link rel="shortcut icon" href="@CacheBust.FingerPrint("/favicon.ico")" type="image/x-icon" />
<script src="@CacheBust.FingerPrint("/scripts/mainScripts.js")"></script>
var mobile = $('#home_template').hasClass('mobile');
if (!mobile) {
var iPadAgent = navigator.userAgent.match(/iPad/i) === null;
var iPodAgent = navigator.userAgent.match(/iPhone/i) === null;
var AndroidAgent = navigator.userAgent.match(/Android/i) === null;
var webOSAgent = navigator.userAgent.match(/webOS/i) === null;
var hasFlash = false;
if (iPadAgent && iPodAgent && AndroidAgent && webOSAgent) {